Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
sunethwarna committed Mar 17, 2024
1 parent 09c2e33 commit f10d1af
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ def PrepareModelPart(self) -> str:
# the model part needs to be created.
self.__helmholtz_model_part = self.model.CreateModelPart(computing_model_part_name)
KOA.OptimizationUtils.CopySolutionStepVariablesList(self.__helmholtz_model_part, self.GetOriginRootModelPart())
self.GetOriginModelPart()[KOA.NUMBER_OF_SOLVERS_USING_NODES] = 1

# now fill with the appropriate elements and conditions
self._FillComputingModelPart()
Expand All @@ -259,10 +258,9 @@ def __IncrementModelPartUsageCounter(self) -> None:
# in here, the origin model part and its parents are updated. This is because,
# the computing model part shares nodes with the origin model part.
def increase_counter(model_part: KM.ModelPart) -> None:
if model_part.Has(KOA.NUMBER_OF_SOLVERS_USING_NODES):
model_part[KOA.NUMBER_OF_SOLVERS_USING_NODES] += 1
else:
model_part[KOA.NUMBER_OF_SOLVERS_USING_NODES] = 1
if not model_part.Has(KOA.NUMBER_OF_SOLVERS_USING_NODES):
model_part[KOA.NUMBER_OF_SOLVERS_USING_NODES] = 0
model_part[KOA.NUMBER_OF_SOLVERS_USING_NODES] += 1

current_model_part = self.GetOriginModelPart()
increase_counter(current_model_part)
Expand Down

0 comments on commit f10d1af

Please sign in to comment.