81 const compressed_matrix<int>& rCoord,
83 bool InterpolateInternalVariables
95 const compressed_matrix<int>& rCoord
109 if (New_Conditions.
size() > 0)
119 compressed_matrix<int>& rCoord
125 ModelPart::ConditionsContainerType::iterator it_begin = rConditions.ptr_begin();
126 ModelPart::ConditionsContainerType::iterator it_end = rConditions.ptr_end();
128 this->SearchEdgeToBeRefinedGeneric<ModelPart::ConditionsContainerType::iterator>(it_begin,it_end,rCoord);
137 if(!rNode.Has(FATHER_NODES)){
138 GlobalPointersVector<Node> empty_father_vector;
139 rNode.SetValue(FATHER_NODES, empty_father_vector);
155 unsigned int to_be_deleted = 0;
156 NewConditions.
clear();
160 for (
auto iCond = iSubModelPart->ConditionsBegin(); iCond != iSubModelPart->ConditionsEnd(); iCond++) {
161 if( iCond->GetValue(SPLIT_ELEMENT) ) {
165 for (
auto iChild = rChildConditions.
ptr_begin(); iChild != rChildConditions.
ptr_end(); iChild++ ) {
166 NewConditions.
push_back((*iChild)->shared_from_this());
172 iSubModelPart->Conditions().reserve( iSubModelPart->Conditions().size() + NewConditions.
size() );
174 iSubModelPart->Conditions().push_back(*(it_new.base()));
178 iSubModelPart->Conditions().Sort();
179 iSubModelPart->Conditions().erase(iSubModelPart->Conditions().end() - to_be_deleted, iSubModelPart->Conditions().end());
182 if (NewConditions.
size() > 0) {
183 ModelPart &rSubModelPart = *iSubModelPart;
184 UpdateSubModelPartConditions(rSubModelPart,NewConditions);
191 compressed_matrix<int>& rCoord
197 NodesArrayType::iterator it_begin = pNodes.ptr_begin();
198 NodesArrayType::iterator it_end = pNodes.ptr_end();
200 rCoord.resize(pNodes.size(), pNodes.size(),
false);
202 for(
auto i = it_begin;
i!=it_end;
i++) {
203 int index_i = mMapNodeIdToPos[
i->Id()];
206 std::vector<unsigned int> aux(neighb_nodes.
size());
208 for (
auto inode = neighb_nodes.
begin(); inode != neighb_nodes.
end(); inode++) {
209 int index_j = mMapNodeIdToPos[inode->Id()];
210 if (index_j > index_i) {
216 std::sort(aux.begin(), aux.begin() +
active);
217 for (
unsigned int k = 0;
k <
active;
k++) {
218 rCoord.push_back(index_i, aux[
k], -1);
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
ptr_iterator ptr_begin()
Definition: global_pointers_vector.h:253
iterator begin()
Definition: global_pointers_vector.h:221
size_type size() const
Definition: global_pointers_vector.h:307
ptr_iterator ptr_end()
Definition: global_pointers_vector.h:261
iterator end()
Definition: global_pointers_vector.h:229
ModelPart::NodesContainerType NodesArrayType
Definition: local_refine_geometry_mesh.hpp:54
ModelPart & mModelPart
Definition: local_refine_geometry_mesh.hpp:238
Definition: local_refine_triangle_mesh_conditions.hpp:43
void CSRRowMatrix(ModelPart &rModelPart, compressed_matrix< int > &rCoord) override
Definition: local_refine_triangle_mesh_conditions.hpp:189
LocalRefineTriangleMeshConditions(ModelPart &model_part)
Default constructors.
Definition: local_refine_triangle_mesh_conditions.hpp:53
void EraseOldElementAndCreateNewElement(ModelPart &rModelPart, const compressed_matrix< int > &rCoord, PointerVector< Element > &rNewElements, bool InterpolateInternalVariables) override
Definition: local_refine_triangle_mesh_conditions.hpp:79
void SearchEdgeToBeRefined(ModelPart &rModelPart, compressed_matrix< int > &rCoord) override
Definition: local_refine_triangle_mesh_conditions.hpp:117
void ResetFatherNodes(ModelPart &rModelPart) override
Definition: local_refine_triangle_mesh_conditions.hpp:133
void UpdateSubModelPartConditions(ModelPart &rModelPart, PointerVector< Condition > &NewConditions)
Definition: local_refine_triangle_mesh_conditions.hpp:149
~LocalRefineTriangleMeshConditions() override=default
Destructor.
void EraseOldConditionsAndCreateNew(ModelPart &rModelPart, const compressed_matrix< int > &rCoord) override
Definition: local_refine_triangle_mesh_conditions.hpp:93
Definition: local_refine_triangle_mesh_generic.hpp:47
void EraseOldObjetcsAndCreateNewObjects(ModelPart &rThisModelPart, ModelPart::ConditionsContainerType &rObjects, const compressed_matrix< int > &rCoord, PointerVector< Condition > &rNewObjects, bool InterpolateInternalVariables)
Definition: local_refine_triangle_mesh_generic.hpp:81
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ModelPart & GetRootModelPart()
Definition: model_part.cpp:510
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
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
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
model_part
Definition: face_heat.py:14
active
Definition: generate_frictionless_components_mortar_condition.py:175
int k
Definition: quadrature.py:595
integer i
Definition: TensorModule.f:17