Skip to content

Commit

Permalink
moved source location from vertex
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Jun 28, 2022
1 parent 509e8d2 commit dd61a13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def transport_particles_on_h5m_geometry(

# initialises a new source object
my_source = openmc.Source()
# sets the location of the source to x=0 y=0 z=0
my_source.space = openmc.stats.Point((0, 0, 0))
# sets the location of the source to x=0.1 y=0.1 z=0.1 which is not on a vertex
my_source.space = openmc.stats.Point((0.1, 0.1, 0.1))
# sets the direction to isotropic
my_source.angle = openmc.stats.Isotropic()
# sets the energy distribution to 100% 14MeV neutrons
Expand Down
15 changes: 2 additions & 13 deletions vertices_to_h5m/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Tuple
from typing import Iterable, Tuple

import numpy as np
import trimesh
Expand All @@ -16,21 +16,12 @@ def fix_normals(vertices, triangles_in_each_volume):
def fix_normal(vertices, triangles):

# for triangles in triangles_in_each_volume:
print("fixing", triangles)
mesh = trimesh.Trimesh(vertices=vertices, faces=triangles, process=False)

mesh.fix_normals()

print("fixed", mesh.faces)
return mesh.faces

# # triangles = mesh.faces
# print('fixed',mesh.faces)
# fixed_triangles.append(mesh.faces)
# print('appending triangles')

# return fixed_triangles


def _define_moab_core_and_tags() -> Tuple[core.Core, dict]:
"""Creates a MOAB Core instance which can be built up by adding sets of
Expand Down Expand Up @@ -131,6 +122,7 @@ def add_vertices_to_moab_core(moab_core, vertices, surface_set):
def add_triangles_to_moab_core(
material_tag, surface_set, moab_core, tags, triangles, moab_verts, volume_set
):

for triangle in triangles:

tri = (
Expand All @@ -155,9 +147,6 @@ def add_triangles_to_moab_core(
return moab_core


from typing import Iterable


def vertices_to_h5m(
vertices: Iterable[Tuple[float, float, float]],
triangles: Iterable[Tuple[int, int, int]],
Expand Down

0 comments on commit dd61a13

Please sign in to comment.