12 #if !defined(KRATOS_FACE_HEAT_UTILITIES_INCLUDED )
13 #define KRATOS_FACE_HEAT_UTILITIES_INCLUDED
30 #include "utilities/geometry_utilities.h"
44 double face_heat_source
48 for(ModelPart::ConditionsContainerType::iterator iii = conditions.begin(); iii != conditions.end(); iii++)
52 for(
unsigned int k = 0;
k<geom.
size();
k++)
53 geom[
k].FastGetSolutionStepValue(FACE_HEAT_FLUX) = face_heat_source;
56 std::cout <<
"Conditions are generated" << std::endl;
67 DestinationModelPart.
Nodes().clear();
68 DestinationModelPart.
Nodes() = OriginModelPart.
Nodes();
73 for(ModelPart::ElementsContainerType::iterator iii = OriginModelPart.
ElementsBegin(); iii != OriginModelPart.
ElementsEnd(); iii++)
76 Properties::Pointer properties = iii->pGetProperties();
77 Element::Pointer p_element = rReferenceElement.
Create(
id, geom ,properties);
78 DestinationModelPart.
Elements().push_back(p_element);
81 std::cout <<
"Elements are generated" << std::endl;
88 double nfree_surf = 0;
89 for(
unsigned int k = 0;
k<geom.
size();
k++)
90 nfree_surf += geom[
k].FastGetSolutionStepValue(IS_FREE_SURFACE);
94 Properties::Pointer properties = iii->pGetProperties();
95 Condition::Pointer p_condition = rReferenceBoundaryCondition.
Create(
id, geom,properties);
96 DestinationModelPart.
Conditions().push_back(p_condition);
100 std::cout <<
"Conditions are generated" << std::endl;
128 int n_int=
im->GetGeometry()[0].FastGetSolutionStepValue(MATERIAL_VARIABLE);
129 for(
int j=1;
j<nd+1;
j++) n_int+=
im->GetGeometry()[
j].FastGetSolutionStepValue(MATERIAL_VARIABLE);
138 n_int=
im->GetGeometry()[1].FastGetSolutionStepValue(MATERIAL_VARIABLE) +
im->GetGeometry()[2].FastGetSolutionStepValue(MATERIAL_VARIABLE);
148 int id = (
im->Id()-1)*3;
149 Condition::Pointer p_cond = Kratos::make_intrusive<ThermalFace>(
id, cond, properties);
154 n_int=
im->GetGeometry()[2].FastGetSolutionStepValue(MATERIAL_VARIABLE) +
im->GetGeometry()[0].FastGetSolutionStepValue(MATERIAL_VARIABLE);
165 int id = (
im->Id()-1)*3+1;
166 Condition::Pointer p_cond = Kratos::make_intrusive<ThermalFace>(
id, cond, properties);
171 n_int=
im->GetGeometry()[0].FastGetSolutionStepValue(MATERIAL_VARIABLE) +
im->GetGeometry()[1].FastGetSolutionStepValue(MATERIAL_VARIABLE) ;
181 int id = (
im->Id()-1)*3+2;
183 Condition::Pointer p_cond = Kratos::make_intrusive<ThermalFace>(
id, cond, properties);
195 int n_int=
im->GetGeometry()[0].FastGetSolutionStepValue(MATERIAL_VARIABLE);
196 for(
int j=1;
j<nd+1;
j++) n_int+=
im->GetGeometry()[
j].FastGetSolutionStepValue(MATERIAL_VARIABLE);
205 n_int=
im->GetGeometry()[1].FastGetSolutionStepValue(MATERIAL_VARIABLE);
206 n_int+=
im->GetGeometry()[2].FastGetSolutionStepValue(MATERIAL_VARIABLE);
207 n_int+=
im->GetGeometry()[3].FastGetSolutionStepValue(MATERIAL_VARIABLE);
213 temp.push_back(
im->GetGeometry()(1));
214 temp.push_back(
im->GetGeometry()(2));
215 temp.push_back(
im->GetGeometry()(3));
217 int id = (
im->Id()-1)*4;
218 Condition::Pointer p_cond = Kratos::make_intrusive<ThermalFace>(
id, cond, properties);
222 n_int=
im->GetGeometry()[0].FastGetSolutionStepValue(MATERIAL_VARIABLE);
223 n_int+=
im->GetGeometry()[3].FastGetSolutionStepValue(MATERIAL_VARIABLE);
224 n_int+=
im->GetGeometry()[2].FastGetSolutionStepValue(MATERIAL_VARIABLE);
230 temp.push_back(
im->GetGeometry()(0));
231 temp.push_back(
im->GetGeometry()(3));
232 temp.push_back(
im->GetGeometry()(2));
234 int id = (
im->Id()-1)*4;
235 Condition::Pointer p_cond = Kratos::make_intrusive<ThermalFace>(
id, cond, properties);
239 n_int=
im->GetGeometry()[0].FastGetSolutionStepValue(MATERIAL_VARIABLE);
240 n_int+=
im->GetGeometry()[1].FastGetSolutionStepValue(MATERIAL_VARIABLE);
241 n_int+=
im->GetGeometry()[3].FastGetSolutionStepValue(MATERIAL_VARIABLE);
247 temp.push_back(
im->GetGeometry()(0));
248 temp.push_back(
im->GetGeometry()(1));
249 temp.push_back(
im->GetGeometry()(3));
251 int id = (
im->Id()-1)*4;
252 Condition::Pointer p_cond = Kratos::make_intrusive<ThermalFace>(
id, cond, properties);
258 n_int=
im->GetGeometry()[0].FastGetSolutionStepValue(MATERIAL_VARIABLE);
259 n_int+=
im->GetGeometry()[2].FastGetSolutionStepValue(MATERIAL_VARIABLE);
260 n_int+=
im->GetGeometry()[1].FastGetSolutionStepValue(MATERIAL_VARIABLE);
266 temp.push_back(
im->GetGeometry()(0));
267 temp.push_back(
im->GetGeometry()(2));
268 temp.push_back(
im->GetGeometry()(1));
270 int id = (
im->Id()-1)*4;
271 Condition::Pointer p_cond = Kratos::make_intrusive<ThermalFace>(
id, cond, properties);
Base class for all Conditions.
Definition: condition.h:59
virtual Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const
It creates a new condition pointer.
Definition: condition.h:205
Base class for all Elements.
Definition: element.h:60
virtual Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const
It creates a new element pointer.
Definition: element.h:202
Definition: face_heat_utilities.h:37
void GenerateModelPart(ModelPart &OriginModelPart, ModelPart &DestinationModelPart, Element const &rReferenceElement, Condition const &rReferenceBoundaryCondition)
Definition: face_heat_utilities.h:61
void ApplyFaceHeat(ModelPart::ConditionsContainerType &conditions, double face_heat_source)
Definition: face_heat_utilities.h:42
void ConditionModelPart(ModelPart &temperature_model_part, ModelPart &full_model_part, const int TDim)
Definition: face_heat_utilities.h:109
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
Definition: mesh.h:394
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
PropertiesContainerType & rProperties(IndexType ThisIndex=0)
Definition: model_part.h:1003
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void reserve(size_type dim)
Definition: pointer_vector.h:319
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
im
Definition: GenerateCN.py:100
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
temperature_model_part
Definition: script_THERMAL_CORRECT.py:32