Skip to content

Commit

Permalink
Removing grain geometries after re-meshing
Browse files Browse the repository at this point in the history
  • Loading branch information
AHartmaier committed Feb 1, 2024
1 parent 857740b commit d678c0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/kanapy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ def voxelize(self, particles=None, dim=None):
f'{self.mesh.ngrains_phase} during voxelization.')
self.ngrains = self.mesh.ngrains_phase
self.Ngr = np.sum(self.mesh.ngrains_phase, dtype=int)
# remove grain information if it already exists to avoid inconsistencies
if self.geometry is not None:
logging.info('Removing polyhedral grain geometries and statistical data after re-meshing.')
self.geometry = None
self.res_data = None

def smoothen(self, nodes_v=None, voxel_dict=None, grain_dict=None):
""" Generates smoothed grain boundary from a voxelated mesh."""
Expand Down Expand Up @@ -222,7 +227,7 @@ def generate_grains(self):
grain_store = None
nphases = self.rve.nphases

self.geometry = \
self.geometry: dict = \
calc_polygons(self.rve, self.mesh) # updates RVE_data
# verify that geometry['Grains'] and mesh.grain_dict are consistent
if np.any(self.geometry['Ngrains'] != self.ngrains):
Expand Down

0 comments on commit d678c0a

Please sign in to comment.