10 #if !defined(KRATOS_ASSIGN_SCALAR_FIELD_TO_PFEM_ENTITIES_PROCESS_H_INCLUDED)
11 #define KRATOS_ASSIGN_SCALAR_FIELD_TO_PFEM_ENTITIES_PROCESS_H_INCLUDED
46 pybind11::object& pPyObject,
47 const std::string& pPyMethodName,
48 const bool SpatialFieldFunction,
56 "model_part_name":"MODEL_PART_NAME",
57 "variable_name": "VARIABLE_NAME",
58 "entity_type": "NODES",
60 "compound_assignment": "direct"
76 if( rParameters[
"local_axes"].
Has(
"origin") ){
80 for(
unsigned int i=0;
i<3;
i++)
81 mLocalOrigin[
i] = rParameters[
"local_axes"][
"origin"][
i].GetDouble();
85 if( rParameters[
"local_axes"].
Has(
"axes") ){
89 for(
unsigned int i=0;
i<3;
i++)
90 for(
unsigned int j=0;
j<3;
j++)
94 if( rParameters[
"entity_type"].GetString() ==
"NODES" ){
97 else if( rParameters[
"entity_type"].GetString() ==
"CONDITIONS" ){
100 else if( rParameters[
"entity_type"].GetString() ==
"ELEMENTS" ){
104 KRATOS_ERROR <<
" Entity type "<< rParameters[
"entity_type"].
GetString() <<
" is not supported "<<std::endl;
114 KRATOS_ERROR <<
"trying to set a variable that is not in the model_part - variable name is " << this->
mvariable_name << std::endl;
127 KRATOS_ERROR <<
"trying to set a variable that is not in the model_part - variable name is " << this->
mvariable_name << std::endl;
132 KRATOS_ERROR <<
" Assignment to " << rParameters[
"entity_type"].
GetString() <<
" not implemented "<< std::endl;
142 pybind11::object& pPyObject,
143 const std::string& pPyMethodName,
144 const bool SpatialFieldFunction
179 const double& rCurrentTime = rCurrentProcessInfo[TIME];
292 std::string
Info()
const override
294 return "AssignScalarFieldToPfemEntitiesProcess";
300 rOStream <<
"AssignScalarFieldToPfemEntitiesProcess";
345 double& rx_local,
double& ry_local,
double& rz_local)
347 rx_local = rX_global;
348 ry_local = rY_global;
349 rz_local = rZ_global;
355 GlobalPosition[0] = rX_global;
356 GlobalPosition[1] = rY_global;
357 GlobalPosition[2] = rZ_global;
368 rx_local = LocalPosition[0];
369 ry_local = LocalPosition[1];
370 rz_local = LocalPosition[2];
380 double x = 0.0,
y = 0.0,
z = 0.0;
398 unsigned int size = rConditionGeometry.
size();
400 rValue.
resize(size,
false);
404 double x = 0,
y = 0,
z = 0;
406 for(
unsigned int i=0;
i<size;
i++)
416 for(
unsigned int i=0;
i<size;
i++)
430 unsigned int size = rElementGeometry.
size();
432 rValue.
resize(size,
false);
436 double x = 0,
y = 0,
z = 0;
438 for(
unsigned int i=0;
i<size;
i++)
448 for(
unsigned int i=0;
i<size;
i++)
457 template<
class TVarType >
464 AssignmentMethodPointer AssignmentMethod = this->GetAssignmentMethod<AssignmentMethodPointer>();
477 ModelPart::NodesContainerType::iterator it = it_begin +
i;
481 (this->*AssignmentMethod)(*it, rVariable, Value);
488 template<
class TVarType >
495 AssignmentMethodPointer AssignmentMethod = this->GetAssignmentMethod<AssignmentMethodPointer>();
506 for(
int i = 0;
i<nconditions;
i++)
508 ModelPart::ConditionsContainerType::iterator it = it_begin +
i;
512 (this->*AssignmentMethod)(*it, rVariable, Value);
519 template<
class TVarType,
class TDataType >
526 AssignmentMethodPointer AssignmentMethod = this->GetAssignmentMethod<AssignmentMethodPointer>();
534 #pragma omp parallel for
535 for(
int i = 0;
i<nconditions;
i++)
537 ModelPart::ConditionsContainerType::iterator it = it_begin +
i;
539 (this->*AssignmentMethod)(*it, rVariable, Value);
548 template<
class TVarType >
555 AssignmentMethodPointer AssignmentMethod = this->GetAssignmentMethod<AssignmentMethodPointer>();
566 for(
int i = 0;
i<nelements;
i++)
568 ModelPart::ElementsContainerType::iterator it = it_begin +
i;
572 (this->*AssignmentMethod)(*it, rVariable, Value);
669 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
AssignScalarFieldToPfemEntitiesProcess(AssignScalarFieldToPfemEntitiesProcess const &rOther)
Copy constructor.
void CallFunction(const Element::Pointer &pElement, const double &time, Vector &rValue)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:426
void AssignValueToConditions(TVarType &rVariable, const double &rTime)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:489
~AssignScalarFieldToPfemEntitiesProcess() override
Destructor.
Definition: assign_scalar_field_to_pfem_entities_process.hpp:152
AssignScalarFieldToPfemEntitiesProcess(ModelPart &rModelPart, pybind11::object &pPyObject, const std::string &pPyMethodName, const bool SpatialFieldFunction)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:141
bool mIsSpatialField
Definition: assign_scalar_field_to_pfem_entities_process.hpp:328
KRATOS_CLASS_POINTER_DEFINITION(AssignScalarFieldToPfemEntitiesProcess)
Pointer definition of AssignScalarFieldToPfemEntitiesProcess.
void AssignValueToNodes(TVarType &rVariable, const double &rTime)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:458
void CallFunction(const Node::Pointer &pNode, const double &time, double &rValue)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:375
void AssignValueToElements(TVarType &rVariable, const double &rTime)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:549
void ExecuteAfterOutputStep() override
this function will be executed at every time step AFTER writing the output
Definition: assign_scalar_field_to_pfem_entities_process.hpp:245
std::string Info() const override
Turn back information as a string.
Definition: assign_scalar_field_to_pfem_entities_process.hpp:292
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
void Execute() override
Execute method is used to execute the AssignScalarFieldToPfemEntitiesProcess algorithms.
Definition: assign_scalar_field_to_pfem_entities_process.hpp:172
Matrix mTransformationMatrix
Definition: assign_scalar_field_to_pfem_entities_process.hpp:326
Vector mLocalOrigin
Definition: assign_scalar_field_to_pfem_entities_process.hpp:325
AssignScalarFieldToPfemEntitiesProcess(ModelPart &rModelPart, pybind11::object &pPyObject, const std::string &pPyMethodName, const bool SpatialFieldFunction, Parameters rParameters)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:45
void ExecuteBeforeSolutionLoop() override
Definition: assign_scalar_field_to_pfem_entities_process.hpp:222
void ExecuteInitialize() override
Definition: assign_scalar_field_to_pfem_entities_process.hpp:216
bool mHasLocalOrigin
Definition: assign_scalar_field_to_pfem_entities_process.hpp:330
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: assign_scalar_field_to_pfem_entities_process.hpp:233
AssignScalarVariableToPfemEntitiesProcess BaseType
Definition: assign_scalar_field_to_pfem_entities_process.hpp:40
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: assign_scalar_field_to_pfem_entities_process.hpp:160
bool mHasLocalAxes
Definition: assign_scalar_field_to_pfem_entities_process.hpp:331
void ExecuteBeforeOutputStep() override
this function will be executed at every time step BEFORE writing the output
Definition: assign_scalar_field_to_pfem_entities_process.hpp:239
void AssignValueToConditions(TVarType &rVariable, const TDataType Value)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:520
void ExecuteFinalize() override
Definition: assign_scalar_field_to_pfem_entities_process.hpp:252
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: assign_scalar_field_to_pfem_entities_process.hpp:304
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: assign_scalar_field_to_pfem_entities_process.hpp:228
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: assign_scalar_field_to_pfem_entities_process.hpp:298
void CallFunction(const Condition::Pointer &pCondition, const double &time, Vector &rValue)
Definition: assign_scalar_field_to_pfem_entities_process.hpp:394
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
Base class for all Conditions.
Definition: condition.h:59
Base class for all Elements.
Definition: element.h:60
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
ElementIterator ElementsBegin()
Definition: mesh.h:548
NodesContainerType & Nodes()
Definition: mesh.h:346
ConditionIterator ConditionsBegin()
Definition: mesh.h:671
NodeIterator NodesBegin()
Definition: mesh.h:326
ElementsContainerType & Elements()
Definition: mesh.h:568
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
VariablesList & GetNodalSolutionStepVariablesList()
Definition: model_part.h:549
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
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
bool Has(const VariableData &rThisVariable) const
Definition: variables_list.h:372
#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
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
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
x
Definition: sensitivityMatrix.py:49
int nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17