Skip to content

Commit

Permalink
Clean up python processes
Browse files Browse the repository at this point in the history
  • Loading branch information
loumalouomega authored Mar 15, 2024
1 parent 5c58b32 commit 99dadbc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def __init__(self, Model, settings ):
settings["entities"] = default_settings["entities"]

# Construct the base process.
super(AssignScalarVariableToConditionsProcess, self).__init__(Model, settings)
super().__init__(Model, settings)
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def __init__(self, Model, settings ):
settings["entities"] = default_settings["entities"]

# Construct the base process.
super(AssignScalarVariableToConstraintsProcess, self).__init__(Model, settings)
super().__init__(Model, settings)
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def __init__(self, Model, settings ):
settings["entities"] = default_settings["entities"]

# Construct the base process.
super(AssignScalarVariableToElementsProcess, self).__init__(Model, settings)
super().__init__(Model, settings)
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, Model, settings ):
"interval" : [0.0, 1e30],
"value" : 0.0,
"local_axes" : {},
"historical" : false,
"entities" : []
}
"""
Expand Down Expand Up @@ -77,7 +78,10 @@ def __init__(self, Model, settings ):
self.value_is_numeric = True
for i in range(len(self.entities)):
if self.entities[i] == "nodes":
self.aux_processes.append( KratosMultiphysics.AssignScalarVariableToNodesProcess(self.model_part, params))
if settings["historical"].GetBool():
self.aux_processes.append( KratosMultiphysics.AssignScalarVariableHistoricalToNodesProcess(self.model_part, params))
else:
self.aux_processes.append( KratosMultiphysics.AssignScalarVariableToNodesProcess(self.model_part, params))
elif self.entities[i] == "conditions":
self.aux_processes.append( KratosMultiphysics.AssignScalarVariableToConditionsProcess(self.model_part, params))
elif self.entities[i] == "elements":
Expand All @@ -88,7 +92,10 @@ def __init__(self, Model, settings ):
params.AddValue("local_axes", settings["local_axes"])
for i in range(len(self.entities)):
if self.entities[i] == "nodes":
self.aux_processes.append( KratosMultiphysics.AssignScalarFieldToNodesProcess(self.model_part, params))
if settings["historical"].GetBool():
self.aux_processes.append( KratosMultiphysics.AssignScalarFieldHistoricalToNodesProcess(self.model_part, params))
else:
self.aux_processes.append( KratosMultiphysics.AssignScalarFieldToNodesProcess(self.model_part, params))
elif self.entities[i] == "conditions":
self.aux_processes.append( KratosMultiphysics.AssignScalarFieldToConditionsProcess(self.model_part, params))
elif self.entities[i] == "elements":
Expand All @@ -110,7 +117,6 @@ def ExecuteInitializeSolutionStep(self):
for process in self.aux_processes:
process.ExecuteInitializeSolutionStep()


def ExecuteFinalizeSolutionStep(self):
""" This method is executed in order to finalize the current step
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, Model, settings ):
"interval" : [0.0, 1e30],
"value" : 0.0,
"local_axes" : {},
"historical" : false,
"entities" : ["nodes"]
}
"""
Expand All @@ -58,4 +59,4 @@ def __init__(self, Model, settings ):
settings["entities"] = default_settings["entities"]

# Construct the base process.
super(AssignScalarVariableToNodesProcess, self).__init__(Model, settings)
super().__init__(Model, settings)

0 comments on commit 99dadbc

Please sign in to comment.