15 #if !defined(UPDATE_THERMAL_MODEL_PART_PROCESS)
16 #define UPDATE_THERMAL_MODEL_PART_PROCESS
65 this->ResetDestinationModelPart();
67 this->DuplicateElements();
68 this->BuildThermalComputingDomain();
69 this->UpdateConditions();
93 void ResetDestinationModelPart()
const {
102 void CopyNodes()
const {
112 destination_part.
AddNodes(i_part->NodesBegin(), i_part->NodesEnd());
116 void DuplicateElements()
const {
120 if (i_mp->NumberOfElements()) {
123 temp_elements.
reserve(i_mp->NumberOfElements());
126 if ((i_mp->Is(SOLID) && i_mp->IsNot(ACTIVE)) || (i_mp->Is(FLUID) && i_mp->IsNot(ACTIVE)) ||
127 (i_mp->Is(BOUNDARY) && i_mp->Is(RIGID))) {
128 for (
auto it_elem = i_mp->ElementsBegin(); it_elem != i_mp->ElementsEnd(); ++it_elem) {
129 Properties::Pointer properties = it_elem->pGetProperties();
131 Element::Pointer p_element =
132 mReferenceElement.Create(it_elem->Id(), it_elem->GetGeometry(), properties);
133 temp_elements.push_back(p_element);
136 destination_part.AddElements(temp_elements.begin(), temp_elements.end());
142 void BuildThermalComputingDomain()
const {
147 std::vector<ModelPart::IndexType> ids;
151 #pragma omp parallel for
153 auto it_elem = it_elem_begin +
i;
155 { ids.push_back(it_elem->Id()); }
161 void UpdateConditions()
const
167 VariableUtils().SetFlag(TO_ERASE,
true, destination_part.Conditions());
171 unsigned int condition_id = 0;
180 for (
auto i_cond(i_mp->ConditionsBegin()); i_cond != i_mp->ConditionsEnd(); ++i_cond)
183 Geometry<Node>& r_geometry = i_cond->
GetGeometry();
185 cond_nodes.
reserve(r_geometry.size());
186 for (
unsigned int i = 0;
i < r_geometry.size();
i++)
187 cond_nodes.push_back(r_geometry(
i));
190 Properties::Pointer p_property = i_cond->pGetProperties();
193 std::string condition_type;
194 if (
rDomainSize == 2) condition_type =
"ThermalFace2D2N";
195 else if (
rDomainSize == 3) condition_type =
"ThermalFace3D3N";
199 Condition::Pointer p_condition = r_reference_condition.Create(++condition_id, cond_nodes, p_property);
200 destination_part.Conditions().push_back(p_condition);
208 void FixDOFs()
const {
213 Geometry<Node>& cond_geometry = i_cond->GetGeometry();
214 for (
unsigned int i = 0;
i < cond_geometry.size();
i++)
219 for (
unsigned int j = 0;
j < neighbour_elements.size();
j++)
222 GeometryType neighbour_elements_geom = neighbour_elements(
j)->GetGeometry();
223 if (neighbour_elements_geom.size() != 2) {
246 rOStream << std::endl;
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: condition.h:86
Dof * Pointer
Pointer definition of Dof.
Definition: dof.h:93
Base class for all Elements.
Definition: element.h:60
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
void RemoveElementsFromAllLevels(Flags IdentifierFlag=TO_ERASE)
Definition: model_part.cpp:1163
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
void RemoveNodesFromAllLevels(Flags IdentifierFlag=TO_ERASE)
Definition: model_part.cpp:504
bool HasSubModelPart(std::string const &ThisSubModelPartName) const
Definition: model_part.cpp:2142
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
SubModelPartsContainerType::iterator SubModelPartIterator
Iterator over the sub model parts of this model part.
Definition: model_part.h:258
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
void RemoveConditionsFromAllLevels(Flags IdentifierFlag=TO_ERASE)
Definition: model_part.cpp:1673
GeometryType & GetGeometry(IndexType GeometryId)
Returns a reference geometry corresponding to the id.
Definition: model_part.h:1584
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
ModelPart & CreateSubModelPart(std::string const &NewSubModelPartName)
Definition: model_part.cpp:2000
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
void AddElements(std::vector< IndexType > const &ElementIds, IndexType ThisIndex=0)
Definition: model_part.cpp:941
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
void AddNodes(std::vector< IndexType > const &NodeIds, IndexType ThisIndex=0)
Definition: model_part.cpp:235
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
void reserve(size_type dim)
Definition: pointer_vector.h:319
void reserve(int reservedsize)
Reserves memory for a specified number of elements.
Definition: pointer_vector_set.h:733
The base class for all processes in Kratos.
Definition: process.h:49
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: process.h:204
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: process.h:210
Definition: update_thermal_model_part_process.hpp:37
std::string ReferenceElement
Definition: update_thermal_model_part_process.hpp:89
KRATOS_CLASS_POINTER_DEFINITION(UpdateThermalModelPartProcess)
UpdateThermalModelPartProcess(ModelPart &origin_model_part, ModelPart &destination_model_part, ModelPart &computing_model_part, unsigned int DomainSize)
Constructor.
Definition: update_thermal_model_part_process.hpp:44
ModelPart & rDestinationModelPart
Definition: update_thermal_model_part_process.hpp:87
void ExecuteInitializeSolutionStep() override
This function will be executed at every time step BEFORE performing the solve phase.
Definition: update_thermal_model_part_process.hpp:83
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: update_thermal_model_part_process.hpp:62
void ExecuteInitialize() override
This function is designed for being called at the beginning of the computations right after reading t...
Definition: update_thermal_model_part_process.hpp:81
void operator()()
Definition: update_thermal_model_part_process.hpp:60
unsigned int rDomainSize
Definition: update_thermal_model_part_process.hpp:90
~UpdateThermalModelPartProcess() override
Destructor.
Definition: update_thermal_model_part_process.hpp:58
ModelPart & rComputingModelPart
Definition: update_thermal_model_part_process.hpp:88
ModelPart & rOriginModelPart
Definition: update_thermal_model_part_process.hpp:86
Element BaseType
Definition: update_thermal_model_part_process.hpp:39
This class implements a set of auxiliar, already parallelized, methods to perform some common tasks r...
Definition: variable_utils.h:63
void SetFlag(const Flags &rFlag, const bool FlagValue, TContainerType &rContainer)
Sets a flag according to a given status over a given container.
Definition: variable_utils.h:900
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: build_model_part_boundary_process.hpp:60
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Geometry< Node > GeometryType
The definition of the geometry.
Definition: mortar_classes.h:37
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
int dof
Definition: ode_solve.py:393
int j
Definition: quadrature.py:648
computing_model_part
processes settings end ####
Definition: script.py:170
integer i
Definition: TensorModule.f:17