1 #ifndef KRATOS_FIELD_UTILITY_H
2 #define KRATOS_FIELD_UTILITY_H
40 mDomain(p_sts), mpVectorField(p_vector_field){}
52 const double time = r_current_process_info[TIME];
55 #pragma omp parallel for
58 double coor_x = node_it->X();
59 double coor_y = node_it->Y();
60 double coor_z = node_it->Z();
61 bool is_in = mDomain->IsIn(
time, coor_x, coor_y, coor_z);
62 node_it->Set(INSIDE, is_in);
63 mIsInArray[
i] = is_in;
72 RealField::Pointer formula)
74 if (mDomain->IsIn(
time, coor[0], coor[1], coor[2])){
75 return(formula->Evaluate(
time, coor));
88 if (mDomain->IsIn(
time, coor[0], coor[1], coor[2])){
103 const double default_value,
104 RealField::Pointer formula,
107 const bool recalculate_domain)
109 const unsigned int nnodes = r_model_part.
Nodes().size();
110 const double time = r_current_process_info[TIME];
112 if (recalculate_domain ||
nnodes != mIsInArray.size()){
113 MarkNodesInside(r_model_part, r_current_process_info);
116 #pragma omp parallel for
119 double& destination_value = node_it->FastGetSolutionStepValue(destination_variable);
120 destination_value = default_value;
124 coor[0] = node_it->X();
125 coor[1] = node_it->Y();
126 coor[2] = node_it->Z();
127 destination_value = formula->Evaluate(
time, coor);
140 const bool recalculate_domain)
142 const unsigned int nnodes = r_model_part.
Nodes().size();
143 const double time = r_current_process_info[TIME];
145 if (recalculate_domain ||
nnodes != mIsInArray.size()){
146 MarkNodesInside(r_model_part, r_current_process_info);
149 #pragma omp parallel for
152 array_1d<double, 3>& destination_value = node_it->FastGetSolutionStepValue(destination_variable);
153 destination_value[0] = default_value[0];
154 destination_value[1] = default_value[1];
155 destination_value[2] = default_value[2];
159 coor[0] = node_it->X();
160 coor[1] = node_it->Y();
161 coor[2] = node_it->Z();
188 virtual std::string
Info()
const
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: field_utility.h:30
SpaceTimeSet::Pointer mDomain
Definition: field_utility.h:222
virtual void ImposeFieldOnNodes(Variable< array_1d< double, 3 > > &destination_variable, const array_1d< double, 3 > default_value, VectorField< 3 >::Pointer formula, ModelPart &r_model_part, const ProcessInfo &r_current_process_info, const bool recalculate_domain)
Definition: field_utility.h:135
FieldUtility(SpaceTimeSet::Pointer p_sts, VectorField< 3 >::Pointer p_vector_field)
Definition: field_utility.h:39
FieldUtility()
Default constructor.
Definition: field_utility.h:37
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: field_utility.h:201
virtual std::string Info() const
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: field_utility.h:188
array_1d< double, 3 > EvaluateFieldAtPoint(const double &time, const array_1d< double, 3 > &coor, VectorField< 3 >::Pointer formula)
Definition: field_utility.h:84
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: field_utility.h:195
virtual void ImposeFieldOnNodes(Variable< double > &destination_variable, const double default_value, RealField::Pointer formula, ModelPart &r_model_part, const ProcessInfo &r_current_process_info, const bool recalculate_domain)
Definition: field_utility.h:102
virtual ~FieldUtility()
Destructor.
Definition: field_utility.h:44
void MarkNodesInside(ModelPart &r_model_part, const ProcessInfo &r_current_process_info)
Definition: field_utility.h:49
KRATOS_CLASS_POINTER_DEFINITION(FieldUtility)
double EvaluateFieldAtPoint(const double &time, const array_1d< double, 3 > &coor, RealField::Pointer formula)
Definition: field_utility.h:70
std::vector< bool > mIsInArray
Definition: field_utility.h:224
VectorField< 3 >::Pointer mpVectorField
Definition: field_utility.h:223
RealField::Pointer mFormula
Definition: field_utility.h:221
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Holds a list of variables and their position in VariablesListDataValueContainer.
Definition: variables_list.h:50
Definition: vector_field.h:26
virtual void Evaluate(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &vector, const int i_thread=0)
Definition: vector_field.h:46
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
time
Definition: face_heat.py:85
int nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17