88 const compressed_matrix<int>& Coord,
90 bool interpolate_internal_variables
98 interpolate_internal_variables
102 if (New_Elements.
size() > 0)
120 const compressed_matrix<int>& Coord
129 if (rConditions.size() > 0)
131 ConditionsArrayType::iterator it_begin = rConditions.ptr_begin();
132 ConditionsArrayType::iterator it_end = rConditions.ptr_end();
133 unsigned int to_be_deleted = 0;
134 unsigned int large_id = (rConditions.end() - 1)->Id() * 7;
138 const unsigned int dimension = it_begin->GetGeometry().WorkingSpaceDimension();
140 unsigned int current_id = (rConditions.end() - 1)->Id() + 1;
142 for (ConditionsArrayType::iterator it = it_begin; it != it_end; ++it)
146 if (geom.
size() == 2)
152 if (index_0 > index_1)
154 new_id = Coord(index_1, index_0);
158 new_id = Coord(index_0, index_1);
167 this_model_part.
Nodes()(geom[0].Id()),
168 this_model_part.
Nodes()(new_id)
172 this_model_part.
Nodes()(new_id),
173 this_model_part.
Nodes()(geom[1].Id())
176 Condition::Pointer pcond1 = it->Create(
current_id++, newgeom1, it->pGetProperties());
177 Condition::Pointer pcond2 = it->Create(
current_id++, newgeom2, it->pGetProperties());
179 pcond1->GetData() = it->GetData();
180 pcond2->GetData() = it->GetData();
188 this_model_part.
Nodes()(geom[0].Id()),
189 this_model_part.
Nodes()(new_id)
193 this_model_part.
Nodes()(new_id),
194 this_model_part.
Nodes()(geom[1].Id())
197 Condition::Pointer pcond1 = it->Create(
current_id++, newgeom1, it->pGetProperties());
198 Condition::Pointer pcond2 = it->Create(
current_id++, newgeom2, it->pGetProperties());
200 pcond1->GetData() = it->GetData();
201 pcond2->GetData() = it->GetData();
219 unsigned int total_size = this_model_part.
Conditions().size() + New_Conditions.
size();
220 this_model_part.
Conditions().reserve(total_size);
225 it_new->Initialize(rCurrentProcessInfo);
226 it_new->InitializeSolutionStep(rCurrentProcessInfo);
227 it_new->FinalizeSolutionStep(rCurrentProcessInfo);
228 this_model_part.
Conditions().push_back(*(it_new.base()));
232 unsigned int my_index = 1;
235 it->SetId(my_index++);
253 unsigned int to_be_deleted = 0;
259 iElem != iSubModelPart->ElementsEnd(); iElem++)
261 if( iElem->GetValue(SPLIT_ELEMENT) )
266 for (
auto iChild = rChildElements.
ptr_begin();
267 iChild != rChildElements.
ptr_end(); iChild++ )
269 NewElements.
push_back((*iChild)->shared_from_this());
275 iSubModelPart->Elements().reserve( iSubModelPart->Elements().size() + NewElements.
size() );
277 it_new != NewElements.
end(); it_new++)
279 iSubModelPart->Elements().push_back(*(it_new.base()));
283 iSubModelPart->Elements().Sort();
284 iSubModelPart->Elements().erase(iSubModelPart->Elements().end() - to_be_deleted, iSubModelPart->Elements().end());
293 if (NewElements.
size() > 0)
295 ModelPart &rSubModelPart = *iSubModelPart;
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
ptr_iterator ptr_begin()
Definition: global_pointers_vector.h:253
ptr_iterator ptr_end()
Definition: global_pointers_vector.h:261
An two node 2D line geometry with linear shape functions.
Definition: line_2d_2.h:65
An two node 3D line geometry with linear shape functions.
Definition: line_3d_2.h:64
std::unordered_map< std::size_t, unsigned int > mMapNodeIdToPos
The current refinement level.
Definition: local_refine_geometry_mesh.hpp:240
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: local_refine_geometry_mesh.hpp:56
Definition: local_refine_triangle_mesh_generic.hpp:47
void EraseOldObjetcsAndCreateNewObjects(ModelPart &rThisModelPart, ModelPart::ElementsContainerType &rObjects, const compressed_matrix< int > &rCoord, PointerVector< Element > &rNewObjects, bool InterpolateInternalVariables)
Definition: local_refine_triangle_mesh_generic.hpp:81
Definition: local_refine_triangle_mesh.hpp:47
void UpdateSubModelPartElements(ModelPart &this_model_part, PointerVector< Element > &NewElements)
Definition: local_refine_triangle_mesh.hpp:248
void EraseOldElementAndCreateNewElement(ModelPart &this_model_part, const compressed_matrix< int > &Coord, PointerVector< Element > &New_Elements, bool interpolate_internal_variables) override
Definition: local_refine_triangle_mesh.hpp:86
~LocalRefineTriangleMesh() override=default
Destructor.
LocalRefineTriangleMesh(ModelPart &model_part)
Default constructors.
Definition: local_refine_triangle_mesh.hpp:57
void EraseOldConditionsAndCreateNew(ModelPart &this_model_part, const compressed_matrix< int > &Coord) override
Definition: local_refine_triangle_mesh.hpp:118
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
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
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ModelPart & GetRootModelPart()
Definition: model_part.cpp:510
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::ElementIterator ElementIterator
Definition: model_part.h:174
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 clear()
Definition: pointer_vector.h:309
size_type size() const
Definition: pointer_vector.h:255
iterator end()
Definition: pointer_vector.h:177
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector.h:89
iterator begin()
Definition: pointer_vector.h:169
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
model_part
Definition: face_heat.py:14
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
int current_id
Output settings end ####.
Definition: script.py:194