10 #if !defined(KRATOS_ASSIGN_VECTOR_FIELD_TO_PFEM_ENTITIES_PROCESS_H_INCLUDED)
11 #define KRATOS_ASSIGN_VECTOR_FIELD_TO_PFEM_ENTITIES_PROCESS_H_INCLUDED
44 pybind11::object &rPyObject,
45 const std::string &rPyMethodName,
46 const bool SpatialFieldFunction,
47 Parameters rParameters) :
BaseType(rModelPart, rPyObject, rPyMethodName, SpatialFieldFunction)
53 "model_part_name":"MODEL_PART_NAME",
54 "variable_name": "VARIABLE_NAME",
55 "entity_type": "NODES",
56 "value" : [0.0, 0.0, 0.0],
58 "compound_assignment": "direct"
73 if (rParameters[
"local_axes"].
Has(
"origin"))
77 for (
unsigned int i = 0;
i < 3;
i++)
78 this->
mLocalOrigin[
i] = rParameters[
"local_axes"][
"origin"][
i].GetDouble();
82 if (rParameters[
"local_axes"].
Has(
"axes"))
86 for (
unsigned int i = 0;
i < 3;
i++)
87 for (
unsigned int j = 0;
j < 3;
j++)
91 if (rParameters[
"entity_type"].GetString() ==
"NODES")
95 else if (rParameters[
"entity_type"].GetString() ==
"CONDITIONS")
101 KRATOS_ERROR <<
" Entity type " << rParameters[
"entity_type"].
GetString() <<
" is not supported " << std::endl;
118 KRATOS_ERROR <<
" Assignment to " << rParameters[
"entity_type"].
GetString() <<
" not implemented " << std::endl;
121 mvector_value[0] = rParameters[
"value"][0].
GetDouble();
122 mvector_value[1] = rParameters[
"value"][1].
GetDouble();
123 mvector_value[2] = rParameters[
"value"][2].
GetDouble();
155 const double &rCurrentTime = rCurrentProcessInfo[TIME];
258 std::string
Info()
const override
260 return "AssignVectorFieldToPfemEntitiesProcess";
266 rOStream <<
"AssignVectorFieldToPfemEntitiesProcess";
316 template <
class TDataType>
317 void CallFunction(
const Condition::Pointer &pCondition,
const double &
time, TDataType &rValue)
321 unsigned int size = rConditionGeometry.
size();
325 rValue.resize(size * 3,
false);
330 double x = 0.0,
y = 0.0,
z = 0.0;
332 for (
unsigned int i = 0;
i < size;
i++)
338 for (
unsigned int j = 0;
j < 3;
j++)
340 rValue[
counter] = value * mvector_value[
j];
349 for (
unsigned int i = 0;
i < size;
i++)
351 for (
unsigned int j = 0;
j < 3;
j++)
353 rValue[
counter] = value * mvector_value[
j];
360 template <
class TVarType,
class TDataType>
361 void AssignValueToConditions(TVarType &rVariable, TDataType &Value,
const double &rTime)
366 AssignmentMethodPointer AssignmentMethod = this->GetAssignmentMethod<AssignmentMethodPointer>();
370 if (nconditions != 0)
375 for (
int i = 0;
i < nconditions;
i++)
377 ModelPart::ConditionsContainerType::iterator it = it_begin +
i;
379 this->CallFunction<TDataType>(*(it.base()), rTime, Value);
381 (this->*AssignmentMethod)(*it, rVariable, Value);
427 rOStream << std::endl;
The base class for assigning a value to scalar variables or array_1d components processes in Kratos.
Definition: assign_scalar_field_to_pfem_entities_process.hpp:32
bool mIsSpatialField
Definition: assign_scalar_field_to_pfem_entities_process.hpp:328
void LocalAxesTransform(const double &rX_global, const double &rY_global, const double &rZ_global, double &rx_local, double &ry_local, double &rz_local)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:344
std::string mPyMethodName
Definition: assign_scalar_field_to_pfem_entities_process.hpp:323
pybind11::object mPyObject
Definition: assign_scalar_field_to_pfem_entities_process.hpp:322
Matrix mTransformationMatrix
Definition: assign_scalar_field_to_pfem_entities_process.hpp:326
Vector mLocalOrigin
Definition: assign_scalar_field_to_pfem_entities_process.hpp:325
bool mHasLocalOrigin
Definition: assign_scalar_field_to_pfem_entities_process.hpp:330
bool mHasLocalAxes
Definition: assign_scalar_field_to_pfem_entities_process.hpp:331
The base class for assigning a value to scalar variables or array_1d components processes in Kratos.
Definition: assign_scalar_variable_to_pfem_entities_process.hpp:34
ModelPart & mrModelPart
Definition: assign_scalar_variable_to_pfem_entities_process.hpp:250
EntityType mEntity
Definition: assign_scalar_variable_to_pfem_entities_process.hpp:253
void SetAssignmentType(std::string method, AssignmentType &rAssignment)
Definition: assign_scalar_variable_to_pfem_entities_process.hpp:272
std::string mvariable_name
Definition: assign_scalar_variable_to_pfem_entities_process.hpp:251
AssignmentType mAssignment
Definition: assign_scalar_variable_to_pfem_entities_process.hpp:254
The base class for assigning a value to scalar variables or array_1d components processes in Kratos.
Definition: assign_vector_field_to_pfem_entities_process.hpp:30
AssignScalarFieldToPfemEntitiesProcess BaseType
Definition: assign_vector_field_to_pfem_entities_process.hpp:38
void ExecuteBeforeOutputStep() override
this function will be executed at every time step BEFORE writing the output
Definition: assign_vector_field_to_pfem_entities_process.hpp:202
void ExecuteAfterOutputStep() override
this function will be executed at every time step AFTER writing the output
Definition: assign_vector_field_to_pfem_entities_process.hpp:207
std::string Info() const override
Turn back information as a string.
Definition: assign_vector_field_to_pfem_entities_process.hpp:258
~AssignVectorFieldToPfemEntitiesProcess() override
Destructor.
Definition: assign_vector_field_to_pfem_entities_process.hpp:131
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: assign_vector_field_to_pfem_entities_process.hpp:264
void Execute() override
Execute method is used to execute the AssignVectorFieldToPfemEntitiesProcess algorithms.
Definition: assign_vector_field_to_pfem_entities_process.hpp:148
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: assign_vector_field_to_pfem_entities_process.hpp:192
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: assign_vector_field_to_pfem_entities_process.hpp:197
AssignVectorFieldToPfemEntitiesProcess(ModelPart &rModelPart, pybind11::object &rPyObject, const std::string &rPyMethodName, const bool SpatialFieldFunction, Parameters rParameters)
Definition: assign_vector_field_to_pfem_entities_process.hpp:43
void ExecuteBeforeSolutionLoop() override
Definition: assign_vector_field_to_pfem_entities_process.hpp:187
void ExecuteFinalize() override
Definition: assign_vector_field_to_pfem_entities_process.hpp:213
AssignVectorFieldToPfemEntitiesProcess(AssignVectorFieldToPfemEntitiesProcess const &rOther)
Copy constructor.
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: assign_vector_field_to_pfem_entities_process.hpp:138
void ExecuteInitialize() override
Definition: assign_vector_field_to_pfem_entities_process.hpp:181
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: assign_vector_field_to_pfem_entities_process.hpp:270
KRATOS_CLASS_POINTER_DEFINITION(AssignVectorFieldToPfemEntitiesProcess)
Pointer definition of AssignVectorFieldToPfemEntitiesProcess.
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
ConditionsContainerType & Conditions()
Definition: mesh.h:691
ConditionIterator ConditionsBegin()
Definition: mesh.h:671
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
Condition ConditionType
Definition: model_part.h:121
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
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
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
z
Definition: GenerateWind.py:163
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
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
time
Definition: face_heat.py:85
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
int j
Definition: quadrature.py:648
int counter
Definition: script_THERMAL_CORRECT.py:218
x
Definition: sensitivityMatrix.py:49
integer i
Definition: TensorModule.f:17