15 #if !defined(KRATOS_ASSIGN_SCALAR_VARIABLE_TO_ENTITIES_PROCESS_H_INCLUDED )
16 #define KRATOS_ASSIGN_SCALAR_VARIABLE_TO_ENTITIES_PROCESS_H_INCLUDED
43 template<
class TEntity>
94 void Execute()
override;
107 const Parameters GetDefaultParameters()
const override;
124 std::string
Info()
const override
126 return "AssignScalarVariableToEntitiesProcess";
132 rOStream <<
"AssignScalarVariableToEntitiesProcess";
180 std::string mVariableName;
195 template<
class TVarType,
class TDataType >
196 void InternalAssignValue(TVarType& rVar,
const TDataType Value)
206 template<
class TVarType,
class TDataType >
207 void InternalAssignValueSerial(TVarType& rVar,
const TDataType Value)
209 auto& r_entities_array = GetEntitiesContainer();
210 const int number_of_entities =
static_cast<int>(r_entities_array.size());
212 if(number_of_entities != 0) {
213 const auto it_begin = r_entities_array.begin();
215 for(
int i = 0;
i<number_of_entities;
i++) {
216 auto it_entity = it_begin +
i;
218 it_entity->SetValue(rVar, Value);
227 EntityContainerType& GetEntitiesContainer();
262 template<
class TEntity>
267 template<
class TEntity>
272 rOStream << std::endl;
The base class for assigning a value to scalar variables or array_1d components processes in Kratos.
Definition: assign_scalar_variable_to_entities_process.h:46
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: assign_scalar_variable_to_entities_process.h:82
~AssignScalarVariableToEntitiesProcess() override
Destructor.
Definition: assign_scalar_variable_to_entities_process.h:75
std::string Info() const override
Turn back information as a string.
Definition: assign_scalar_variable_to_entities_process.h:124
PointerVectorSet< TEntity, IndexedObject > EntityContainerType
The container of the entities.
Definition: assign_scalar_variable_to_entities_process.h:55
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: assign_scalar_variable_to_entities_process.h:130
Node NodeType
Node type definition.
Definition: assign_scalar_variable_to_entities_process.h:52
KRATOS_CLASS_POINTER_DEFINITION(AssignScalarVariableToEntitiesProcess)
Pointer definition of AssignScalarVariableToEntitiesProcess.
void ExecuteInitializeSolutionStep() override
This function will be executed at every time step BEFORE performing the solve phase.
Definition: assign_scalar_variable_to_entities_process.h:99
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: assign_scalar_variable_to_entities_process.h:136
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
The base class for all processes in Kratos.
Definition: process.h:49
This class implements a set of auxiliar, already parallelized, methods to perform some common tasks r...
Definition: variable_utils.h:63
void SetNonHistoricalVariable(const TVarType &rVariable, const TType &Value, TContainerType &rContainer)
Sets the container value of any type of non historical variable.
Definition: variable_utils.h:790
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
integer i
Definition: TensorModule.f:17