Skip to content

Commit

Permalink
Merge pull request #147 from BAMresearch:143-fenics-version-0.7.0-dan…
Browse files Browse the repository at this point in the history
…ielandresarcones

Updated sensors to 0.7.0
  • Loading branch information
danielandresarcones authored Oct 23, 2023
2 parents 624caee + 728877d commit 516d775
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/fenicsxconcrete/sensor_definition/displacement_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ def measure(self, problem: MaterialProblem) -> None:
t : time of measurement for time dependent problems, default is 1
"""
# get displacements
bb_tree = df.geometry.BoundingBoxTree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
bb_tree = df.geometry.bb_tree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
cells = []

# Find cells whose bounding-box collide with the points
cell_candidates = df.geometry.compute_collisions(bb_tree, [self.where])
cell_candidates = df.geometry.compute_collisions_points(bb_tree, [self.where])

# Choose one of the cells that contains the point
colliding_cells = df.geometry.compute_colliding_cells(problem.experiment.mesh, cell_candidates, [self.where])
Expand Down
4 changes: 2 additions & 2 deletions src/fenicsxconcrete/sensor_definition/doh_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def measure(self, problem: MaterialProblem) -> None:
# project stress onto visualization space

# finding the cells corresponding to the point
bb_tree = df.geometry.BoundingBoxTree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
bb_tree = df.geometry.bb_tree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
cells = []

# Find cells whose bounding-box collide with the points
cell_candidates = df.geometry.compute_collisions(bb_tree, [self.where])
cell_candidates = df.geometry.compute_collisions_points(bb_tree, [self.where])

# Choose one of the cells that contains the point
colliding_cells = df.geometry.compute_colliding_cells(problem.experiment.mesh, cell_candidates, [self.where])
Expand Down
6 changes: 3 additions & 3 deletions src/fenicsxconcrete/sensor_definition/strain_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ def measure(self, problem: MaterialProblem) -> None:

strain_function = project(
strain, # stress fct from problem
df.fem.TensorFunctionSpace(problem.experiment.mesh, problem.q_fields.plot_space_type), # tensor space
df.fem.functionspace(problem.experiment.mesh, problem.q_fields.plot_space_type), # tensor space
problem.q_fields.measure,
)
# project stress onto visualization space

# finding the cells corresponding to the point
bb_tree = df.geometry.BoundingBoxTree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
bb_tree = df.geometry.bb_tree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
cells = []

# Find cells whose bounding-box collide with the points
cell_candidates = df.geometry.compute_collisions(bb_tree, [self.where])
cell_candidates = df.geometry.compute_collisions_points(bb_tree, [self.where])

# Choose one of the cells that contains the point
colliding_cells = df.geometry.compute_colliding_cells(problem.experiment.mesh, cell_candidates, [self.where])
Expand Down
6 changes: 3 additions & 3 deletions src/fenicsxconcrete/sensor_definition/stress_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ def measure(self, problem: MaterialProblem) -> None:

stress_function = project(
stress, # stress fct from problem
df.fem.TensorFunctionSpace(problem.experiment.mesh, problem.q_fields.plot_space_type), # tensor space
df.fem.functionspace(problem.experiment.mesh, problem.q_fields.plot_space_type), # tensor space
problem.q_fields.measure,
)

# finding the cells corresponding to the point
bb_tree = df.geometry.BoundingBoxTree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
bb_tree = df.geometry.bb_tree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
cells = []

# Find cells whose bounding-box collide with the points
cell_candidates = df.geometry.compute_collisions(bb_tree, [self.where])
cell_candidates = df.geometry.compute_collisions_points(bb_tree, [self.where])

# Choose one of the cells that contains the point
colliding_cells = df.geometry.compute_colliding_cells(problem.experiment.mesh, cell_candidates, [self.where])
Expand Down
4 changes: 2 additions & 2 deletions src/fenicsxconcrete/sensor_definition/temperature_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ def measure(self, problem: MaterialProblem) -> None:
t : time of measurement for time dependent problems, default is 1
"""
# get displacements
bb_tree = df.geometry.BoundingBoxTree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
bb_tree = df.geometry.bb_tree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
cells = []

# Find cells whose bounding-box collide with the points
cell_candidates = df.geometry.compute_collisions(bb_tree, [self.where])
cell_candidates = df.geometry.compute_collisions_points(bb_tree, [self.where])

# Choose one of the cells that contains the point
colliding_cells = df.geometry.compute_colliding_cells(problem.experiment.mesh, cell_candidates, [self.where])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def measure(self, problem: MaterialProblem) -> None:
# project stress onto visualization space

# finding the cells corresponding to the point
bb_tree = df.geometry.BoundingBoxTree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
bb_tree = df.geometry.bb_tree(problem.experiment.mesh, problem.experiment.mesh.topology.dim)
cells = []

# Find cells whose bounding-box collide with the points
cell_candidates = df.geometry.compute_collisions(bb_tree, [self.where])
cell_candidates = df.geometry.compute_collisions_points(bb_tree, [self.where])

# Choose one of the cells that contains the point
colliding_cells = df.geometry.compute_colliding_cells(problem.experiment.mesh, cell_candidates, [self.where])
Expand Down

0 comments on commit 516d775

Please sign in to comment.