16 #if !defined(KRATOS_ASSIGN_SCALAR_FIELD_TO_ENTITIES_PROCESS_H_INCLUDED )
17 #define KRATOS_ASSIGN_SCALAR_FIELD_TO_ENTITIES_PROCESS_H_INCLUDED
48 template<
class TEntity>
108 void Execute()
override;
121 const Parameters GetDefaultParameters()
const override;
138 std::string
Info()
const override
140 return "AssignScalarFieldToEntitiesProcess";
146 rOStream <<
"AssignScalarFieldToEntitiesProcess";
197 std::string mVariableName;
199 std::size_t mMeshId = 0;
212 const typename TEntity::Pointer& pEntity,
223 void CallFunctionComponents(
224 const typename TEntity::Pointer& pEntity,
235 void CallFunctionLocalSystem(
236 const typename TEntity::Pointer& pEntity,
247 void CallFunctionLocalSystemComponents(
248 const typename TEntity::Pointer& pEntity,
260 void AssignTimeDependentValue(
261 const typename TEntity::Pointer& pEntity,
272 template<
class TVarType >
273 void InternalAssignValueVector(
278 auto& r_entities_array = GetEntitiesContainer();
279 const SizeType number_of_entities = r_entities_array.size();
283 if(number_of_entities != 0) {
284 auto it_begin = r_entities_array.
begin();
286 if(mpFunction->DependsOnSpace()) {
287 if(mpFunction->UseLocalSystem()) {
290 auto it_entity = it_begin +
i;
291 this->CallFunctionLocalSystem(*(it_entity.base()), Time, Value);
292 it_entity->SetValue(rVar, Value);
297 auto it_entity = it_begin +
i;
298 this->CallFunction(*(it_entity.base()), Time, Value);
299 it_entity->SetValue(rVar, Value);
303 const double TimeValue = mpFunction->CallFunction(0.0, 0.0, 0.0, Time);
306 auto it_entity = it_begin +
i;
307 this->AssignTimeDependentValue(*(it_entity.base()), Time, Value, TimeValue);
308 it_entity->SetValue(rVar, Value);
319 template<
class TVarType >
320 void InternalAssignValueScalar(
325 auto& r_entities_array = GetEntitiesContainer();
326 const SizeType number_of_entities = r_entities_array.size();
328 if(number_of_entities != 0) {
329 auto it_begin = r_entities_array.begin();
331 if(mpFunction->DependsOnSpace()) {
334 if(mpFunction->UseLocalSystem()) {
337 auto it_entity = it_begin +
i;
338 this->CallFunctionLocalSystemComponents(*(it_entity.base()), Time, Value);
339 it_entity->SetValue(rVar, Value);
344 auto it_entity = it_begin +
i;
345 this->CallFunctionComponents(*(it_entity.base()), Time, Value);
346 it_entity->SetValue(rVar, Value);
350 const double TimeValue = mpFunction->CallFunction(0.0, 0.0, 0.0, Time);
353 auto it_entity = it_begin +
i;
354 it_entity->SetValue(rVar, TimeValue);
365 EntityContainerType& GetEntitiesContainer();
375 AssignScalarFieldToEntitiesProcess&
operator=(AssignScalarFieldToEntitiesProcess
const& rOther);
403 template<
class TEntity>
408 template<
class TEntity>
413 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
The base class for assigning a value to scalar variables or array_1d components processes in Kratos.
Definition: assign_scalar_field_to_entities_process.h:51
std::size_t SizeType
The sizeType definition.
Definition: assign_scalar_field_to_entities_process.h:66
KRATOS_CLASS_POINTER_DEFINITION(AssignScalarFieldToEntitiesProcess)
Pointer definition of AssignScalarFieldToEntitiesProcess.
Geometry< NodeType > GeometryType
The definitionof the geometry.
Definition: assign_scalar_field_to_entities_process.h:60
Node NodeType
The definitionof the node.
Definition: assign_scalar_field_to_entities_process.h:57
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: assign_scalar_field_to_entities_process.h:96
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: assign_scalar_field_to_entities_process.h:144
PointerVectorSet< TEntity, IndexedObject > EntityContainerType
The container of the entities.
Definition: assign_scalar_field_to_entities_process.h:69
void ExecuteInitializeSolutionStep() override
This function will be executed at every time step BEFORE performing the solve phase.
Definition: assign_scalar_field_to_entities_process.h:113
std::string Info() const override
Turn back information as a string.
Definition: assign_scalar_field_to_entities_process.h:138
std::size_t IndexType
The IndexType definition.
Definition: assign_scalar_field_to_entities_process.h:63
~AssignScalarFieldToEntitiesProcess() override
Destructor.
Definition: assign_scalar_field_to_entities_process.h:89
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: assign_scalar_field_to_entities_process.h:150
Geometry base class.
Definition: geometry.h:71
iterator begin()
Definition: amatrix_interface.h:241
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
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
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