10 #if !defined(KRATOS_ASSIGN_PROPERTIES_TO_NODES_PROCESS_H_INCLUDED)
11 #define KRATOS_ASSIGN_PROPERTIES_TO_NODES_PROCESS_H_INCLUDED
60 "fluid_mixture": false,
61 "solid_mixture": false
68 mFluidMixture = rParameters[
"fluid_mixture"].
GetBool();
69 mSolidMixture = rParameters[
"solid_mixture"].
GetBool();
108 this->AssignPropertiesToNodes();
125 this->AssignMaterialPercentageToNodes();
170 std::string
Info()
const override
172 return "AssignPropertiesToNodesProcess";
178 rOStream <<
"AssignPropertiesToNodesProcess";
241 void AssignPropertiesToNodes()
243 const int nnodes = mrModelPart.GetMesh().Nodes().size();
247 ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh().NodesBegin();
252 ModelPart::NodesContainerType::iterator it = it_begin +
i;
253 it->SetValue(PROPERTIES_VECTOR,mpProperties);
258 void AssignMaterialPercentageToNodes()
260 const int nnodes = mrModelPart.GetMesh().Nodes().size();
264 ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh().NodesBegin();
269 ModelPart::NodesContainerType::iterator it = it_begin +
i;
270 Vector MaterialPercentage;
271 this->CalculateMaterialPercentage(*it, MaterialPercentage);
272 it->SetValue(MATERIAL_PERCENTAGE, MaterialPercentage);
278 void CalculateMaterialPercentage(
NodeType& rNode,
Vector& MaterialPercentage)
282 unsigned int size = mpProperties->size();
283 MaterialPercentage.resize(size,
false);
287 if( rNode.
Is(FLUID) && mFluidMixture ){
291 for(
auto& i_nelem : nElements)
293 if(i_nelem.Is(FLUID)){
294 unsigned int id = i_nelem.GetProperties().Id();
296 MaterialPercentage[id] += 1;
302 else if( rNode.
Is(SOLID) && mSolidMixture ){
305 for(
auto& i_nelem : nElements)
307 if(i_nelem.Is(SOLID)){
308 unsigned int id = i_nelem.GetProperties().Id();
310 MaterialPercentage[id] += 1;
318 double divider = 1.0;
322 for(
unsigned int i=0;
i<size; ++
i)
323 MaterialPercentage[
i] *= divider;
371 rOStream << std::endl;
The base class for fixing scalar variable Dof or array_1d component Dof processes in Kratos.
Definition: assign_properties_to_nodes_process.hpp:34
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: assign_properties_to_nodes_process.hpp:176
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: assign_properties_to_nodes_process.hpp:121
void ExecuteBeforeOutputStep() override
this function will be executed at every time step BEFORE writing the output
Definition: assign_properties_to_nodes_process.hpp:137
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: assign_properties_to_nodes_process.hpp:131
void ExecuteBeforeSolutionLoop() override
Definition: assign_properties_to_nodes_process.hpp:115
void ExecuteInitialize() override
Definition: assign_properties_to_nodes_process.hpp:104
void ExecuteFinalize() override
Definition: assign_properties_to_nodes_process.hpp:150
PointerVectorSet< Properties, IndexedObject > PropertiesContainerType
Definition: assign_properties_to_nodes_process.hpp:42
void ExecuteAfterOutputStep() override
this function will be executed at every time step AFTER writing the output
Definition: assign_properties_to_nodes_process.hpp:143
AssignPropertiesToNodesProcess(AssignPropertiesToNodesProcess const &rOther)
Copy constructor.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: assign_properties_to_nodes_process.hpp:182
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: assign_properties_to_nodes_process.hpp:45
void Execute() override
Execute method is used to execute the AssignPropertiesToNodesProcess algorithms.
Definition: assign_properties_to_nodes_process.hpp:98
virtual ~AssignPropertiesToNodesProcess()
Destructor.
Definition: assign_properties_to_nodes_process.hpp:78
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: assign_properties_to_nodes_process.hpp:86
Node NodeType
NodeType.
Definition: assign_properties_to_nodes_process.hpp:40
PropertiesContainerType::Pointer PropertiesContainerPointerType
Definition: assign_properties_to_nodes_process.hpp:43
AssignPropertiesToNodesProcess(ModelPart &model_part, Parameters rParameters)
Definition: assign_properties_to_nodes_process.hpp:52
std::string Info() const override
Turn back information as a string.
Definition: assign_properties_to_nodes_process.hpp:170
KRATOS_CLASS_POINTER_DEFINITION(AssignPropertiesToNodesProcess)
Pointer definition of AssignPropertiesToNodesProcess.
bool Is(Flags const &rOther) const
Definition: flags.h:274
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
PropertiesContainerType::Pointer pProperties(IndexType ThisIndex=0)
Definition: model_part.h:1008
This class defines the node.
Definition: node.h:65
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: node.h:466
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
bool GetBool() const
This method returns the boolean contained in the current Parameter.
Definition: kratos_parameters.cpp:675
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
model_part
Definition: face_heat.py:14
int counter
Definition: script_THERMAL_CORRECT.py:218
int nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17