Skip to content

Commit 8b3003b

Browse files
committed
Add scalar field handling and surface count tracking
Introduced `scalar_field_at_surface_points` and `n_surfaces` to better manage scalar field data and track the number of surfaces. Updated `_set_scalar_field_at_surface_points` to populate these attributes from octree output. This improves data organization and enables easier surface-related computations.
1 parent 3821295 commit 8b3003b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gempy_engine/core/data/raw_arrays_solution.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class BlockSolutionType(enum.Enum):
5858
topology_count: Optional[np.ndarray] = None # ? I am not 100% sure the type is correct
5959

6060
# endregion
61+
scalar_field_at_surface_points: list[np.ndarray] = None
62+
n_surfaces: int = 0
6163

6264
# ? TODO: This could be just the init
6365
@classmethod
@@ -107,9 +109,11 @@ def from_gempy_engine_solutions(cls, octrees_output: list[OctreeLevel], meshes:
107109

108110
def _set_scalar_field_at_surface_points(self, octree_output: OctreeLevel):
109111
temp_list = []
112+
self.n_surfaces = 0
110113
for i in range(octree_output.number_of_outputs):
111114
at_surface_points = octree_output.outputs_centers[i].scalar_fields.exported_fields.scalar_field_at_surface_points
112115
temp_list.append(BackendTensor.t.to_numpy(at_surface_points))
116+
self.n_surfaces += at_surface_points.shape[0]
113117

114118
self.scalar_field_at_surface_points = temp_list
115119

0 commit comments

Comments
 (0)