13 #if !defined(KRATOS_CUTTING_ISOSURFACE_APPLICATION)
14 #define KRATOS_CUTTING_ISOSURFACE_APPLICATION
90 template <
class TDataType>
94 KRATOS_WATCH(
"Generating Isosurface with the following data:")
99 boost::numeric::ublas::vector<array_1d<int, 2 > > Position_Node;
100 boost::numeric::ublas::vector<int> List_New_Nodes;
102 compressed_matrix<int> Coord;
103 ModelPart& this_model_part = mr_model_part;
104 ModelPart& new_model_part = mr_new_model_part;
106 vector<double> Value_Nodes(this_model_part.
Elements().size());
107 vector<int> Elems_In_Isosurface( this_model_part.
Elements().size());
108 int number_of_triangles = 0;
114 FirstLoop(this_model_part, Coord, variable, isovalue, number_of_triangles, Elems_In_Isosurface, tolerance);
120 GenerateElements (this_model_part, new_model_part, Position_Node, Elems_In_Isosurface, Coord, variable, isosurface_number);
138 ModelPart& this_model_part = mr_model_part;
139 NodesArrayType::iterator it_begin_node_old = this_model_part.
Nodes().ptr_begin();
140 ModelPart& new_model_part = mr_new_model_part;
142 KRATOS_WATCH(
"Adding Skin Conditions to the new model part, added in layer:")
146 vector<int> Element_Nodes( this_model_part.
Nodes().size());
147 int number_of_tetrahedras = 0;
148 int number_of_nodes = 0;
149 int number_of_previous_nodes = 0;
153 if (new_model_part.
Nodes().size()!=0)
156 NodesArrayType::iterator it_end_node_new = rNodes_new.ptr_end();
157 NodesArrayType::iterator it_begin_node_new = rNodes_new.ptr_begin();
158 number_of_previous_nodes=(it_end_node_new-it_begin_node_new);
167 for (
unsigned int index=0 ; index != this_model_part.
Nodes().size() ; ++index)
170 Element_Nodes[index] = number_of_nodes + number_of_previous_nodes;
171 ModelPart::NodesContainerType::iterator it_node = this_model_part.
Nodes().begin()+index;
172 Node ::Pointer pnode = new_model_part.
CreateNewNode(number_of_nodes+number_of_previous_nodes, it_node->X(), it_node->Y(), it_node->Z());
173 pnode->SetBufferSize(this_model_part.
NodesBegin()->GetBufferSize());
174 pnode->GetValue(FATHER_NODES).resize(0);
175 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node.base() ) );
176 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node.base() ) );
177 pnode->
GetValue(WEIGHT_FATHER_NODES) = 1.0;
179 pnode->X0() = it_node->X0();
180 pnode->Y0() = it_node->Y0();
181 pnode->Z0() = it_node->Z0();
185 vector<int> tetrahedra_nodes(4);
189 for(ModelPart::ElementsContainerType::iterator i_element = rElements.begin() ; i_element != rElements.end() ; i_element++)
192 for(
unsigned int i = 0;
i < i_element->GetGeometry().size() ;
i++)
194 int position = this_model_part.
Nodes().find(geom[
i].Id()) - it_begin_node_old;
196 tetrahedra_nodes[
i]=Element_Nodes[position];
200 new_model_part.
Nodes()(tetrahedra_nodes[0]),
201 new_model_part.
Nodes()(tetrahedra_nodes[1]),
202 new_model_part.
Nodes()(tetrahedra_nodes[2]),
203 new_model_part.
Nodes()(tetrahedra_nodes[3])
206 Element::Pointer p_element = rReferenceElement.
Create(number_of_tetrahedras+1, geometry, properties);
207 new_model_part.
Elements().push_back(p_element);
208 ++number_of_tetrahedras;
228 ModelPart& this_model_part = mr_model_part;
229 ModelPart& new_model_part = mr_new_model_part;
231 KRATOS_WATCH(
"Adding Skin Conditions to the new model part, added in layer:")
234 vector<int> Condition_Nodes( this_model_part.
Nodes().size());
235 int number_of_triangles = 0;
236 int number_of_nodes = 0;
237 int number_of_previous_nodes = 0;
248 ConditionsArrayType::iterator cond_it_end_new = rConditions_new.ptr_end();
249 ConditionsArrayType::iterator cond_it_begin_new = rConditions_new.ptr_begin();
251 if (new_model_part.
Nodes().size()!=0)
254 NodesArrayType::iterator it_end_node_new = rNodes_new.ptr_end();
255 NodesArrayType::iterator it_begin_node_new = rNodes_new.ptr_begin();
256 number_of_previous_nodes=(it_end_node_new-it_begin_node_new);
257 number_of_triangles=cond_it_end_new - cond_it_begin_new ;
267 for (
unsigned int index=0 ; index != this_model_part.
Nodes().size() ; ++index) Condition_Nodes[index]=0;
269 for(ModelPart::ConditionsContainerType::iterator i_condition = rConditions.begin() ; i_condition != rConditions.end() ; i_condition++)
272 for(
unsigned int i = 0;
i < i_condition->GetGeometry().size() ;
i++)
274 int position = (geom[
i].
Id()) - 1;
275 Condition_Nodes[position] = -1 ;
280 for (
unsigned int index=0 ; index != this_model_part.
Nodes().size() ; ++index)
282 if (Condition_Nodes[index]==-1)
285 Condition_Nodes[index] = number_of_nodes + number_of_previous_nodes;
286 ModelPart::NodesContainerType::iterator it_node = this_model_part.
Nodes().begin()+index;
287 Node ::Pointer pnode = new_model_part.
CreateNewNode(number_of_nodes+number_of_previous_nodes, it_node->X(), it_node->Y(), it_node->Z());
288 pnode->SetBufferSize(this_model_part.
NodesBegin()->GetBufferSize());
289 pnode->GetValue(FATHER_NODES).resize(0);
290 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node.base() ) );
291 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node.base() ) );
292 pnode->
GetValue(WEIGHT_FATHER_NODES) = 1.0;
294 pnode->X0() = it_node->X0();
295 pnode->Y0() = it_node->Y0();
296 pnode->Z0() = it_node->Z0();
301 vector<int> triangle_nodes(3);
305 for(ModelPart::ConditionsContainerType::iterator i_condition = rConditions.begin() ; i_condition != rConditions.end() ; i_condition++)
308 for(
unsigned int i = 0;
i < i_condition->GetGeometry().size() ;
i++)
310 int position = (geom[
i].
Id()) - 1;
311 triangle_nodes[
i]=Condition_Nodes[position];
314 new_model_part.
Nodes()(triangle_nodes[0]),
315 new_model_part.
Nodes()(triangle_nodes[1]),
316 new_model_part.
Nodes()(triangle_nodes[2])
318 Condition::Pointer p_condition = rReferenceCondition.
Create(number_of_triangles+1, geometry, properties);
319 new_model_part.
Conditions().push_back(p_condition);
320 ++number_of_triangles;
334 Coord.resize(pNodes.size(), pNodes.size());
335 NodesArrayType::iterator i_begin = pNodes.ptr_begin();
336 NodesArrayType::iterator i_end = pNodes.ptr_end();
338 std::vector<unsigned int> aux(10000);
342 int index_i =
i->Id() - 1;
344 Coord.push_back(index_i, index_i, -1);
349 int index_j = inode->Id() - 1;
350 if (index_j > index_i)
356 std::sort(aux.begin(), aux.begin() +
active);
358 for (
unsigned int k = 0;
k <
active;
k++)
360 Coord.push_back(index_i, aux[
k], -1);
367 void FirstLoop(
ModelPart& this_model_part, compressed_matrix<int>& Coord,
Variable<double>& variable,
double isovalue,
int number_of_triangles, vector<int>& Elems_In_Isosurface,
float tolerance)
374 ElementsArrayType::iterator it_begin = rElements.ptr_begin();
375 ElementsArrayType::iterator it_end = rElements.ptr_end();
383 unsigned int exact_nodes=0;
385 number_of_triangles = 0;
386 int current_element= 0;
388 int number_of_cuts= 0;
390 for (ElementsArrayType::iterator it = it_begin; it != it_end; ++it)
396 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
399 node_value[
i] = geom[
i].FastGetSolutionStepValue(variable);
401 diff_node_value[
i] = isovalue - node_value[
i];
403 for(
unsigned int j = 0;
j < it->GetGeometry().size() ;
j++)
407 neigh_value[
j] = geom[
j].FastGetSolutionStepValue(variable);
409 diff_neigh_value[
j] = isovalue - neigh_value[
j];
411 bool isovernode=
false;
413 if (fabs(diff_node_value[
i]) < (tolerance))
415 int index_i = geom[
i].
Id() -1 ;
416 Coord(index_i, index_i) = -2;
420 list_matching_nodes[
i]= geom[
i].
Id();
424 if ((diff_node_value[
i]*diff_neigh_value[
j]) < 0.0 && isovernode==
false && fabs(diff_neigh_value[
j]) > tolerance)
426 int index_i = geom[
i].
Id() - 1;
427 int index_j = geom[
j].
Id() - 1;
428 if (index_j > index_i) Coord(index_i, index_j) = -2;
429 else Coord(index_j, index_i) = -2;
435 if (tolerance > (diff_node_value[0]) && tolerance > (diff_node_value[1]) && tolerance > (diff_node_value[2]) && tolerance > (diff_node_value[3]))
437 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
444 Elems_In_Isosurface[current_element-1] = 0 ;
446 if (number_of_cuts == 6)
448 number_of_triangles +=1;
449 Elems_In_Isosurface[current_element-1] = 1 ;
451 else if (number_of_cuts == 8 )
453 number_of_triangles +=2;
454 Elems_In_Isosurface[ current_element-1] = 2 ;
468 ElementsArrayType::iterator it_begin = rElements.ptr_begin();
469 ElementsArrayType::iterator it_end = rElements.ptr_end();
475 double squared_isovalue = isovalue * isovalue;
487 unsigned int exact_nodes=0;
489 number_of_triangles = 0;
490 int current_element= 0;
492 int number_of_cuts= 0;
494 for (ElementsArrayType::iterator it = it_begin; it != it_end; ++it)
501 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
504 vector_node_value[
i] = geom[
i].FastGetSolutionStepValue(variable);
506 squared_node_value[
i] = (vector_node_value[
i][0] * vector_node_value[
i][0]) + (vector_node_value[
i][1] * vector_node_value[
i][1]) + (vector_node_value[
i][2] * vector_node_value[
i][2]);
507 node_value[
i] = sqrt(squared_node_value[
i]);
509 diff_node_value[
i] = isovalue - node_value[
i];
511 for(
unsigned int j = 0;
j < it->GetGeometry().size() ;
j++)
515 vector_neigh_value[
j] = geom[
j].FastGetSolutionStepValue(variable);
517 squared_neigh_value[
j] = (vector_neigh_value[
j][0] * vector_neigh_value[
j][0]) + (vector_neigh_value[
j][1] * vector_neigh_value[
j][1]) + (vector_neigh_value[
j][2] * vector_neigh_value[
j][2]);
518 neigh_value[
j] = sqrt(squared_neigh_value[
j]);
520 diff_neigh_value[
j] = isovalue - neigh_value[
j];
522 aux_value = (vector_node_value[
j][0] * vector_neigh_value[
j][0]) + (vector_node_value[
j][1] * vector_neigh_value[
j][1]) + (vector_node_value[
j][2] * vector_neigh_value[
j][2]);
524 a = squared_node_value[
i] + squared_neigh_value[
j] - (2 * aux_value);
525 b = 2 * (aux_value - squared_node_value[
i]);
526 c = squared_node_value[
i] - squared_isovalue;
528 float tol = 0.000001;
546 weight1 = (-
b + sqrt((
b *
b) - (4 *
a *
c))) / (2 *
a);
547 weight2 = (-
b - sqrt((
b *
b) - (4 *
a *
c))) / (2 *
a);
549 bool isovernode=
false;
551 if (fabs(diff_node_value[
i]) <= (tolerance))
553 int index_i = geom[
i].
Id() -1 ;
554 Coord(index_i, index_i) = -2;
558 list_matching_nodes[
i]= geom[
i].
Id();
562 if (weight1 > 0.0 && weight1 < 1.0 && fabs(diff_neigh_value[
j]) > tolerance && isovernode==
false)
564 int index_i = geom[
i].
Id() - 1;
565 int index_j = geom[
j].
Id() - 1;
566 if (index_j > index_i) Coord(index_i, index_j) = -2;
567 else Coord(index_j, index_i) = -2;
572 if (weight2 > 0.0 && weight2 < 1.0 && fabs(diff_neigh_value[
j]) > tolerance && isovernode==
false)
574 int index_i = geom[
i].
Id() - 1;
575 int index_j = geom[
j].
Id() - 1;
576 if (index_j > index_i) Coord(index_i, index_j) = -2;
577 else Coord(index_j, index_i) = -2;
583 if (tolerance > (diff_node_value[0]) && tolerance > (diff_node_value[1]) && tolerance > (diff_node_value[2]) && tolerance > (diff_node_value[3]))
585 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
592 Elems_In_Isosurface[current_element-1] = 0 ;
594 if (number_of_cuts == 6)
596 number_of_triangles +=1;
597 Elems_In_Isosurface[current_element-1] = 1 ;
599 else if (number_of_cuts == 8 )
601 number_of_triangles +=2;
602 Elems_In_Isosurface[ current_element-1] = 2 ;
612 unsigned int number_of_new_nodes = 0;
614 typedef compressed_matrix<int>::iterator1 i1_t;
615 typedef compressed_matrix<int>::iterator2 i2_t;
618 for (i1_t i1 = Coord.begin1(); i1 != Coord.end1(); ++i1)
620 for (i2_t i2 = i1.begin(); i2 != i1.end(); ++i2)
622 if (Coord(i2.index1(), i2.index2()) == -2)
624 number_of_new_nodes++;
628 if (number_of_new_nodes != 0)
631 List_New_Nodes.resize(number_of_new_nodes);
634 if (new_model_part.
Nodes().size()!=0)
637 NodesArrayType::iterator it_end_node_new = rNodes_new.ptr_end();
638 NodesArrayType::iterator it_begin_node_new = rNodes_new.ptr_begin();
639 List_New_Nodes[0]=(it_end_node_new-it_begin_node_new)+1;
641 first_cutting_surface =
false;
647 first_cutting_surface =
true;
650 for (
unsigned int i = 1;
i < number_of_new_nodes;
i++)
652 List_New_Nodes[
i] = List_New_Nodes[0] +
i;
656 Position_Node.resize(number_of_new_nodes);
657 unsigned int index = 0;
658 for (i1_t i1 = Coord.begin1(); i1 != Coord.end1(); ++i1)
660 for (i2_t i2 = i1.begin(); i2 != i1.end(); ++i2)
662 if (Coord(i2.index1(), i2.index2()) == -2)
664 Coord(i2.index1(), i2.index2()) = List_New_Nodes[index];
665 Position_Node[index][0] = i2.index1() + 1;
666 Position_Node[index][1] = i2.index2() + 1;
684 double diff_node_value;
685 double diff_neigh_value;
686 double diff_neigh_node_value;
688 boost::numeric::ublas::vector< array_1d<double, 3 > > Coordinate_New_Node;
689 Coordinate_New_Node.
resize(Position_Node.size());
695 for (
unsigned int i = 0;
i < Position_Node.size();
i++)
698 const int& node_i = Position_Node[
i][0];
699 const int& node_j = Position_Node[
i][1];
700 ModelPart::NodesContainerType::iterator it_node1 = this_model_part.
Nodes().find(node_i);
701 noalias(Coord_Node_1) = it_node1->Coordinates();
702 ModelPart::NodesContainerType::iterator it_node2 = this_model_part.
Nodes().find(node_j);
703 noalias(Coord_Node_2) = it_node2->Coordinates();
706 node_value = it_node1->FastGetSolutionStepValue(variable);
707 neigh_value = it_node2->FastGetSolutionStepValue(variable);
709 diff_node_value = isovalue - node_value;
710 diff_neigh_value = isovalue - neigh_value;
711 diff_neigh_node_value = neigh_value - node_value;
713 vector_distance = Coord_Node_2 - Coord_Node_1;
715 if (fabs(diff_node_value) < tolerance) weight = 0.0;
716 else if (fabs(diff_neigh_value) < tolerance) weight = 1.0;
717 else weight = diff_node_value / diff_neigh_node_value;
719 if (weight > 1.00005)
KRATOS_WATCH(
"**** something's wrong! weight higher than 1! ****");
721 for (
unsigned int index=0; index!=3; ++index)
723 if (Position_Node[
i][0]!=Position_Node[
i][1]) Coordinate_New_Node[
i][index] = Coord_Node_1[index] + vector_distance[index] * weight;
724 else Coordinate_New_Node[
i][index] = Coord_Node_1[index];
727 Node ::Pointer pnode = new_model_part.
CreateNewNode(List_New_Nodes[
i], Coordinate_New_Node[
i][0], Coordinate_New_Node[
i][1], Coordinate_New_Node[
i][2]);
729 pnode->SetBufferSize(this_model_part.
NodesBegin()->GetBufferSize());
731 pnode->GetValue(FATHER_NODES).resize(0);
732 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node1.base() ) );
733 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node2.base() ) );
734 pnode->
GetValue(WEIGHT_FATHER_NODES) = weight;
736 pnode->X0() = (1.0 - weight) * (it_node1->X0()) + weight * it_node2->X0();
737 pnode->Y0() = (1.0 - weight) * (it_node1->Y0()) + weight * it_node2->Y0();
738 pnode->Z0() = (1.0 - weight) * (it_node1->Z0()) + weight * it_node2->Z0();
751 double squared_node_value;
752 double squared_neigh_value;
756 double squared_isovalue;
760 double diff_node_value;
761 double diff_neigh_value;
765 boost::numeric::ublas::vector< array_1d<double, 3 > > Coordinate_New_Node;
766 Coordinate_New_Node.resize(Position_Node.size());
772 for (
unsigned int i = 0;
i < Position_Node.size();
i++)
775 const int& node_i = Position_Node[
i][0];
776 const int& node_j = Position_Node[
i][1];
777 ModelPart::NodesContainerType::iterator it_node1 = this_model_part.
Nodes().find(node_i);
778 noalias(Coord_Node_1) = it_node1->Coordinates();
779 ModelPart::NodesContainerType::iterator it_node2 = this_model_part.
Nodes().find(node_j);
780 noalias(Coord_Node_2) = it_node2->Coordinates();
784 vector_node_value = it_node1->FastGetSolutionStepValue(variable);
785 squared_node_value = (vector_node_value[0] * vector_node_value[0]) + (vector_node_value[1] * vector_node_value[1]) + (vector_node_value[2] * vector_node_value[2]);
786 node_value = sqrt(squared_node_value);
788 vector_neigh_value = it_node2->FastGetSolutionStepValue(variable);
789 squared_neigh_value = (vector_neigh_value[0] * vector_neigh_value[0]) + (vector_neigh_value[1] * vector_neigh_value[1]) + (vector_neigh_value[2] * vector_neigh_value[2]);
790 neigh_value = sqrt(squared_neigh_value);
792 aux_value = (vector_node_value[0] * vector_neigh_value[0]) + (vector_node_value[1] * vector_neigh_value[1]) + (vector_node_value[2] * vector_neigh_value[2]);
794 squared_isovalue = isovalue * isovalue;
796 a = squared_node_value + squared_neigh_value - (2 * aux_value);
797 b = 2 * (aux_value - squared_node_value);
798 c = squared_node_value - squared_isovalue;
800 float tol = 0.000001;
818 diff_node_value = isovalue - node_value;
819 diff_neigh_value = isovalue - neigh_value;
821 vector_distance = Coord_Node_2 - Coord_Node_1;
823 if (fabs(diff_node_value) < tolerance) weight = 0.0;
824 else if (fabs(diff_neigh_value) < tolerance) weight = 1.0;
827 weight1 = (-
b + sqrt((
b *
b) - (4 *
a *
c))) / (2 *
a);
828 weight2 = (-
b - sqrt((
b *
b) - (4 *
a *
c))) / (2 *
a);
829 if (weight1 < 1.0 && weight1 > 0.0) weight = weight1;
830 else if (weight2 < 1.0 && weight2 > 0.0) weight = weight2;
832 if (weight > 1.00005)
KRATOS_WATCH(
"**** something's wrong! weight higher than 1! ****");
834 for (
unsigned int index=0; index!=3; ++index)
836 if (Position_Node[
i][0]!=Position_Node[
i][1]) Coordinate_New_Node[
i][index] = Coord_Node_1[index] + vector_distance[index] * weight;
837 else Coordinate_New_Node[
i][index] = Coord_Node_1[index];
840 Node ::Pointer pnode = new_model_part.
CreateNewNode(List_New_Nodes[
i], Coordinate_New_Node[
i][0], Coordinate_New_Node[
i][1], Coordinate_New_Node[
i][2]);
842 pnode->SetBufferSize(this_model_part.
NodesBegin()->GetBufferSize());
844 pnode->GetValue(FATHER_NODES).resize(0);
845 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node1.base() ) );
846 pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( *it_node2.base() ) );
847 pnode->
GetValue(WEIGHT_FATHER_NODES) = weight;
849 pnode->X0() = (1.0 - weight) * (it_node1->X0()) + weight * it_node2->X0();
850 pnode->Y0() = (1.0 - weight) * (it_node1->Y0()) + weight * it_node2->Y0();
851 pnode->Z0() = (1.0 - weight) * (it_node1->Z0()) + weight * it_node2->Z0();
881 unsigned int temp_int;
882 unsigned int first_element=0;
885 ElementsArrayType::iterator it_begin_old = rElements_old.ptr_begin();
886 ElementsArrayType::iterator it_end_old = rElements_old.ptr_end();
889 ElementsArrayType::iterator it_begin_new = rElements_new.ptr_begin();
890 ElementsArrayType::iterator it_end_new = rElements_new.ptr_end();
892 boost::numeric::ublas::vector< array_1d<double, 3 > > Coordinate_New_Node;
893 Coordinate_New_Node.resize(Position_Node.size());
895 if (first_cutting_surface ==
false)
897 first_element=(it_end_new-it_begin_new);
910 int number_of_triangles = 0;
911 int current_element= 0;
912 unsigned int triangle_nodes= 0;
913 bool new_node = false ;
916 for (
unsigned int k=0;
k!=4; ++
k)
918 TriangleNodesArray[
k] = -1;
922 for (ElementsArrayType::iterator it = it_begin_old; it != it_end_old; ++it)
927 if (Elems_In_Isosurface[current_element-1] == 1 )
930 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
933 for(
unsigned int j = 0;
j < it->GetGeometry().size() ;
j++)
936 int index_i = geom[
i].
Id() - 1;
937 int index_j = geom[
j].
Id() - 1;
938 for (
unsigned int l=0;
l!=3; ++
l)
940 if(TriangleNodesArray[
l]==Coord(index_i, index_j) || Coord(index_i, index_j) <1 ) new_node=
false;
943 if (new_node && index_i<=index_j)
945 TriangleNodesArray[triangle_nodes]=Coord(index_i, index_j) ;
948 if (triangle_nodes ==3)
break;
950 if (triangle_nodes ==3)
break;
953 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
956 node_value[
i] = geom[
i].FastGetSolutionStepValue(variable);
958 Coord_Node[0] = geom[
i].X();
959 Coord_Node[1] = geom[
i].Y();
960 Coord_Node[2] = geom[
i].Z();
964 Coord_Node_1 = Coord_Node;
968 Coord_Node_2 = Coord_Node;
972 Coord_Node_3 = Coord_Node;
976 Coord_Node_4 = Coord_Node;
980 if (node_value[0] >= node_value[1] && node_value[0] >= node_value[2] && node_value[0] >= node_value[3]) vector_max=Coord_Node_1;
981 if (node_value[1] > node_value[0] && node_value[1] > node_value[2] && node_value[1] > node_value[3]) vector_max=Coord_Node_2;
982 if (node_value[2] > node_value[0] && node_value[2] > node_value[1] && node_value[2] > node_value[3]) vector_max=Coord_Node_3;
983 if (node_value[3] > node_value[0] && node_value[3] > node_value[1] && node_value[3] > node_value[2]) vector_max=Coord_Node_4;
985 if (node_value[0] < node_value[1] && node_value[0] < node_value[2] && node_value[0] < node_value[3]) vector_min=Coord_Node_1;
986 if (node_value[1] < node_value[0] && node_value[1] < node_value[2] && node_value[1] < node_value[3]) vector_min=Coord_Node_2;
987 if (node_value[2] < node_value[0] && node_value[2] < node_value[1] && node_value[2] < node_value[3]) vector_min=Coord_Node_3;
988 if (node_value[3] <= node_value[0] && node_value[3] <= node_value[1] && node_value[3] <= node_value[2]) vector_min=Coord_Node_4;
990 vector_normal = vector_max - vector_min;
992 ModelPart::NodesContainerType::iterator new_it_node1 = new_model_part.
Nodes().find(TriangleNodesArray[0]);
993 noalias(temp_vector1) = new_it_node1->Coordinates();
995 ModelPart::NodesContainerType::iterator new_it_node2 = new_model_part.
Nodes().find(TriangleNodesArray[1]);
996 noalias(temp_vector2) = new_it_node2->Coordinates();
998 ModelPart::NodesContainerType::iterator new_it_node3 = new_model_part.
Nodes().find(TriangleNodesArray[2]);
999 noalias(temp_vector3) = new_it_node3->Coordinates();
1001 temp_vector3 -=temp_vector1;
1002 temp_vector2 -=temp_vector1;
1006 if (
inner_prod(temp_vector4,vector_normal)<0.0)
1008 temp_int= TriangleNodesArray[2];
1009 TriangleNodesArray[2] = TriangleNodesArray[1];
1010 TriangleNodesArray[1] = temp_int;
1015 new_model_part.
Nodes()(TriangleNodesArray[0]),
1016 new_model_part.
Nodes()(TriangleNodesArray[1]),
1017 new_model_part.
Nodes()(TriangleNodesArray[2])
1020 Condition::Pointer p_condition = rReferenceCondition.
Create(number_of_triangles+1+first_element, geom, properties);
1021 new_model_part.
Conditions().push_back(p_condition);
1022 ++number_of_triangles;
1038 if (Elems_In_Isosurface[current_element-1] == 2)
1042 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
1045 for(
unsigned int j = 0;
j < it->GetGeometry().size() ;
j++)
1048 int index_i = geom[
i].
Id() - 1;
1049 int index_j = geom[
j].
Id() - 1;
1050 for (
unsigned int l=0;
l!=3; ++
l)
1052 if(TriangleNodesArray[
l]==Coord(index_i, index_j) || Coord(index_i, index_j) < 1 )
1057 if (new_node && index_i<index_j)
1059 TriangleNodesArray[triangle_nodes]=Coord(index_i, index_j) ;
1062 if (triangle_nodes ==4)
break;
1064 if (triangle_nodes ==4)
break;
1074 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
1077 node_value[
i] = geom[
i].FastGetSolutionStepValue(variable);
1079 Coord_Node[0] = geom[
i].X();
1080 Coord_Node[1] = geom[
i].Y();
1081 Coord_Node[2] = geom[
i].Z();
1083 if(
i == 0) Coord_Node_1 = Coord_Node;
1084 if(
i == 1) Coord_Node_2 = Coord_Node;
1085 if(
i == 2) Coord_Node_3 = Coord_Node;
1086 if(
i == 3) Coord_Node_4 = Coord_Node;
1089 if (node_value[0] >= node_value[1] && node_value[0] >= node_value[2] && node_value[0] >= node_value[3]) vector_max=Coord_Node_1;
1090 if (node_value[1] > node_value[0] && node_value[1] > node_value[2] && node_value[1] > node_value[3]) vector_max=Coord_Node_2;
1091 if (node_value[2] > node_value[0] && node_value[2] > node_value[1] && node_value[2] > node_value[3]) vector_max=Coord_Node_3;
1092 if (node_value[3] > node_value[0] && node_value[3] > node_value[1] && node_value[3] > node_value[2]) vector_max=Coord_Node_4;
1094 if (node_value[0] < node_value[1] && node_value[0] < node_value[2] && node_value[0] < node_value[3]) vector_min=Coord_Node_1;
1095 if (node_value[1] < node_value[0] && node_value[1] < node_value[2] && node_value[1] < node_value[3]) vector_min=Coord_Node_2;
1096 if (node_value[2] < node_value[0] && node_value[2] < node_value[1] && node_value[2] < node_value[3]) vector_min=Coord_Node_3;
1097 if (node_value[3] <= node_value[0] && node_value[3] <= node_value[1] && node_value[3] <= node_value[2]) vector_min=Coord_Node_4;
1099 vector_normal = vector_max - vector_min;
1100 ModelPart::NodesContainerType::iterator it_node1 = new_model_part.
Nodes().find(TriangleNodesArray[0]);
1101 noalias(temp_vector1) = it_node1->Coordinates();
1105 for (
int iii=1; iii!=4; ++iii)
1107 it_node1=new_model_part.
Nodes().find(TriangleNodesArray[iii]);
1108 noalias(temp_vector2) = it_node1->Coordinates();
1109 noalias(temp_vector3) = temp_vector2 - temp_vector1;
1131 it_node1=new_model_part.
Nodes().find(TriangleNodesArray[jjj]);
1132 noalias(temp_vector2) = it_node1->Coordinates();
1134 it_node1=new_model_part.
Nodes().find(TriangleNodesArray[kkk]);
1135 noalias(temp_vector3) = it_node1->Coordinates();
1137 noalias(temp_vector2) -=temp_vector1;
1138 noalias(temp_vector3) -=temp_vector1;
1140 dist2=
inner_prod(temp_vector2,temp_vector4);
1141 dist3=
inner_prod(temp_vector3,temp_vector4);
1146 nodes_for_2triang[0] = TriangleNodesArray[0] ;
1147 nodes_for_2triang[1] = TriangleNodesArray[jjj];
1148 nodes_for_2triang[2] = TriangleNodesArray[iii];
1149 nodes_for_2triang[3] = TriangleNodesArray[iii];
1150 nodes_for_2triang[4] = TriangleNodesArray[kkk];
1151 nodes_for_2triang[5] = TriangleNodesArray[0];
1157 for (
int index=0 ; index !=2 ; ++index)
1159 ModelPart::NodesContainerType::iterator new_it_node1 = new_model_part.
Nodes().find(nodes_for_2triang[index*3+0]);
1160 noalias(temp_vector1) = new_it_node1->Coordinates();
1162 ModelPart::NodesContainerType::iterator new_it_node2 = new_model_part.
Nodes().find(nodes_for_2triang[index*3+1]);
1163 noalias(temp_vector2) = new_it_node2->Coordinates();
1165 ModelPart::NodesContainerType::iterator new_it_node3 = new_model_part.
Nodes().find(nodes_for_2triang[index*3+2]);
1166 noalias(temp_vector3) = new_it_node3->Coordinates();
1168 temp_vector3 -=temp_vector1;
1169 temp_vector2 -=temp_vector1;
1172 if (
inner_prod(temp_vector4,vector_normal)<0.0)
1174 temp_int= nodes_for_2triang[index*3+2];
1175 nodes_for_2triang[index*3+2] = nodes_for_2triang[index*3+1];
1176 nodes_for_2triang[index*3+1] = temp_int;
1180 new_model_part.
Nodes()(nodes_for_2triang[index*3+0]),
1181 new_model_part.
Nodes()(nodes_for_2triang[index*3+1]),
1182 new_model_part.
Nodes()(nodes_for_2triang[index*3+2])
1185 Condition::Pointer p_condition = rReferenceCondition.
Create(number_of_triangles+1+first_element, geom, properties);
1187 new_model_part.
Conditions().push_back(p_condition);
1188 ++number_of_triangles;
1225 unsigned int temp_int;
1226 unsigned int first_element=0;
1229 ElementsArrayType::iterator it_begin_old = rElements_old.ptr_begin();
1230 ElementsArrayType::iterator it_end_old = rElements_old.ptr_end();
1233 ElementsArrayType::iterator it_begin_new = rElements_new.ptr_begin();
1234 ElementsArrayType::iterator it_end_new = rElements_new.ptr_end();
1236 boost::numeric::ublas::vector< array_1d<double, 3 > > Coordinate_New_Node;
1237 Coordinate_New_Node.resize(Position_Node.size());
1239 if (first_cutting_surface ==
false)
1241 first_element=(it_end_new-it_begin_new);
1254 int number_of_triangles = 0;
1255 int current_element= 0;
1256 unsigned int triangle_nodes= 0;
1257 bool new_node = false ;
1260 for (
unsigned int k=0;
k!=4; ++
k) TriangleNodesArray[
k] = -1;
1263 for (ElementsArrayType::iterator it = it_begin_old; it != it_end_old; ++it)
1269 if (Elems_In_Isosurface[current_element-1] == 1 )
1272 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
1275 for(
unsigned int j = 0;
j < it->GetGeometry().size() ;
j++)
1278 int index_i = geom[
i].
Id() - 1;
1279 int index_j = geom[
j].
Id() - 1;
1280 for (
unsigned int l=0;
l!=3; ++
l)
1282 if(TriangleNodesArray[
l]==Coord(index_i, index_j) || Coord(index_i, index_j) <1 ) new_node=
false;
1284 if (new_node && index_i<=index_j)
1286 TriangleNodesArray[triangle_nodes]=Coord(index_i, index_j) ;
1289 if (triangle_nodes ==3)
break;
1291 if (triangle_nodes ==3)
break;
1294 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
1297 vector_node_value[
i] = geom[
i].FastGetSolutionStepValue(variable);
1299 node_value[
i] = sqrt((vector_node_value[
i][0] * vector_node_value[
i][0]) + (vector_node_value[
i][1] * vector_node_value[
i][1]) + (vector_node_value[
i][2] * vector_node_value[
i][2]));
1301 Coord_Node[0] = geom[
i].X();
1302 Coord_Node[1] = geom[
i].Y();
1303 Coord_Node[2] = geom[
i].Z();
1307 Coord_Node_1 = Coord_Node;
1311 Coord_Node_2 = Coord_Node;
1315 Coord_Node_3 = Coord_Node;
1319 Coord_Node_4 = Coord_Node;
1323 if (node_value[0] >= node_value[1] && node_value[0] >= node_value[2] && node_value[0] >= node_value[3]) vector_max=Coord_Node_1;
1324 if (node_value[1] > node_value[0] && node_value[1] > node_value[2] && node_value[1] > node_value[3]) vector_max=Coord_Node_2;
1325 if (node_value[2] > node_value[0] && node_value[2] > node_value[1] && node_value[2] > node_value[3]) vector_max=Coord_Node_3;
1326 if (node_value[3] > node_value[0] && node_value[3] > node_value[1] && node_value[3] > node_value[2]) vector_max=Coord_Node_4;
1328 if (node_value[0] < node_value[1] && node_value[0] < node_value[2] && node_value[0] < node_value[3]) vector_min=Coord_Node_1;
1329 if (node_value[1] < node_value[0] && node_value[1] < node_value[2] && node_value[1] < node_value[3]) vector_min=Coord_Node_2;
1330 if (node_value[2] < node_value[0] && node_value[2] < node_value[1] && node_value[2] < node_value[3]) vector_min=Coord_Node_3;
1331 if (node_value[3] <= node_value[0] && node_value[3] <= node_value[1] && node_value[3] <= node_value[2]) vector_min=Coord_Node_4;
1333 vector_normal = vector_max - vector_min;
1335 ModelPart::NodesContainerType::iterator new_it_node1 = new_model_part.
Nodes().find(TriangleNodesArray[0]);
1336 noalias(temp_vector1) = new_it_node1->Coordinates();
1338 ModelPart::NodesContainerType::iterator new_it_node2 = new_model_part.
Nodes().find(TriangleNodesArray[1]);
1339 noalias(temp_vector2) = new_it_node2->Coordinates();
1341 ModelPart::NodesContainerType::iterator new_it_node3 = new_model_part.
Nodes().find(TriangleNodesArray[2]);
1342 noalias(temp_vector3) = new_it_node3->Coordinates();
1344 temp_vector3 -=temp_vector1;
1345 temp_vector2 -=temp_vector1;
1349 if (
inner_prod(temp_vector4,vector_normal)<0.0)
1351 temp_int= TriangleNodesArray[2];
1352 TriangleNodesArray[2] = TriangleNodesArray[1];
1353 TriangleNodesArray[1] = temp_int;
1358 new_model_part.
Nodes()(TriangleNodesArray[0]),
1359 new_model_part.
Nodes()(TriangleNodesArray[1]),
1360 new_model_part.
Nodes()(TriangleNodesArray[2])
1363 Condition::Pointer p_condition = rReferenceCondition.
Create(number_of_triangles+1+first_element, geom, properties);
1364 new_model_part.
Conditions().push_back(p_condition);
1365 ++number_of_triangles;
1381 if (Elems_In_Isosurface[current_element-1] == 2)
1385 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
1388 for(
unsigned int j = 0;
j < it->GetGeometry().size() ;
j++)
1391 int index_i = geom[
i].
Id() - 1;
1392 int index_j = geom[
j].
Id() - 1;
1393 for (
unsigned int l=0;
l!=3; ++
l)
1395 if(TriangleNodesArray[
l]==Coord(index_i, index_j) || Coord(index_i, index_j) < 1 ) new_node=
false;
1397 if (new_node && index_i<index_j)
1399 TriangleNodesArray[triangle_nodes]=Coord(index_i, index_j) ;
1402 if (triangle_nodes ==4)
break;
1404 if (triangle_nodes ==4)
break;
1414 for (
int iii=1; iii!=4; ++iii)
1432 nodes_for_2triang[0] = TriangleNodesArray[0] ;
1433 nodes_for_2triang[1] = TriangleNodesArray[jjj];
1434 nodes_for_2triang[2] = TriangleNodesArray[iii];
1435 nodes_for_2triang[3] = TriangleNodesArray[iii];
1436 nodes_for_2triang[4] = TriangleNodesArray[kkk];
1437 nodes_for_2triang[5] = TriangleNodesArray[0];
1439 for(
unsigned int i = 0;
i < it->GetGeometry().size() ;
i++)
1442 vector_node_value[
i] = geom[
i].FastGetSolutionStepValue(variable);
1444 node_value[
i] = sqrt((vector_node_value[
i][0] * vector_node_value[
i][0]) + (vector_node_value[
i][1] * vector_node_value[
i][1]) + (vector_node_value[
i][2] * vector_node_value[
i][2]));
1446 Coord_Node[0] = geom[
i].X();
1447 Coord_Node[1] = geom[
i].Y();
1448 Coord_Node[2] = geom[
i].Z();
1450 if(
i == 0) Coord_Node_1 = Coord_Node;
1451 if(
i == 1) Coord_Node_2 = Coord_Node;
1452 if(
i == 2) Coord_Node_3 = Coord_Node;
1453 if(
i == 3) Coord_Node_4 = Coord_Node;
1456 if (node_value[0] >= node_value[1] && node_value[0] >= node_value[2] && node_value[0] >= node_value[3]) vector_max=Coord_Node_1;
1457 if (node_value[1] > node_value[0] && node_value[1] > node_value[2] && node_value[1] > node_value[3]) vector_max=Coord_Node_2;
1458 if (node_value[2] > node_value[0] && node_value[2] > node_value[1] && node_value[2] > node_value[3]) vector_max=Coord_Node_3;
1459 if (node_value[3] > node_value[0] && node_value[3] > node_value[1] && node_value[3] > node_value[2]) vector_max=Coord_Node_4;
1461 if (node_value[0] < node_value[1] && node_value[0] < node_value[2] && node_value[0] < node_value[3]) vector_min=Coord_Node_1;
1462 if (node_value[1] < node_value[0] && node_value[1] < node_value[2] && node_value[1] < node_value[3]) vector_min=Coord_Node_2;
1463 if (node_value[2] < node_value[0] && node_value[2] < node_value[1] && node_value[2] < node_value[3]) vector_min=Coord_Node_3;
1464 if (node_value[3] <= node_value[0] && node_value[3] <= node_value[1] && node_value[3] <= node_value[2]) vector_min=Coord_Node_4;
1466 vector_normal = vector_max - vector_min;
1470 for (
int index=0 ; index !=2 ; ++index)
1472 ModelPart::NodesContainerType::iterator new_it_node1 = new_model_part.
Nodes().find(nodes_for_2triang[index*3+0]);
1473 noalias(temp_vector1) = new_it_node1->Coordinates();
1475 ModelPart::NodesContainerType::iterator new_it_node2 = new_model_part.
Nodes().find(nodes_for_2triang[index*3+1]);
1476 noalias(temp_vector2) = new_it_node2->Coordinates();
1478 ModelPart::NodesContainerType::iterator new_it_node3 = new_model_part.
Nodes().find(nodes_for_2triang[index*3+2]);
1479 noalias(temp_vector3) = new_it_node3->Coordinates();
1481 temp_vector3 -=temp_vector1;
1482 temp_vector2 -=temp_vector1;
1485 if (
inner_prod(temp_vector4,vector_normal)<0.0)
1487 temp_int= nodes_for_2triang[index*3+2];
1488 nodes_for_2triang[index*3+2] = nodes_for_2triang[index*3+1];
1489 nodes_for_2triang[index*3+1] = temp_int;
1493 new_model_part.
Nodes()(nodes_for_2triang[index*3+0]),
1494 new_model_part.
Nodes()(nodes_for_2triang[index*3+1]),
1495 new_model_part.
Nodes()(nodes_for_2triang[index*3+2])
1498 Condition::Pointer p_condition = rReferenceCondition.
Create(number_of_triangles+1+first_element, geom, properties);
1500 new_model_part.
Conditions().push_back(p_condition);
1501 ++number_of_triangles;
1533 for (ModelPart::NodesContainerType::iterator it = new_model_part.
NodesBegin(); it != new_model_part.
NodesEnd(); it++)
1535 double* node0_data = it->GetValue(FATHER_NODES)[0].SolutionStepData().Data(0);
1536 double* node1_data = it->GetValue(FATHER_NODES)[1].SolutionStepData().Data(0);
1537 double weight = it->GetValue(WEIGHT_FATHER_NODES);
1538 double* step_data = (it)->SolutionStepData().Data(0);
1541 for(
int j= 0;
j< step_data_size;
j++)
1543 step_data[
j] = (1.0-weight)*node0_data[
j] + weight*node1_data[
j];
1559 new_model_part.
Nodes().clear();
1567 bool first_cutting_surface;
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
CUTTING ISOSURFACE APPLICATION.
Definition: cutting_iso_app.h:53
Node PointType
Definition: cutting_iso_app.h:64
Node ::Pointer PointPointerType
Definition: cutting_iso_app.h:65
void Create_List_Of_New_Nodes_Mod(ModelPart &this_model_part, ModelPart &new_model_part, compressed_matrix< int > &Coord, boost::numeric::ublas::vector< int > &List_New_Nodes, boost::numeric::ublas::vector< array_1d< int, 2 > > &Position_Node)
************************************************************************************************
Definition: cutting_iso_app.h:610
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: cutting_iso_app.h:60
void AddSkinConditions(ModelPart &mr_model_part, ModelPart &mr_new_model_part, int number)
ADDSKINCONDITIONS: THIS FUNCTION ADDS TO THE NEW MODEL PART THE DATA OF THE CONDITIONS BELONGING TO T...
Definition: cutting_iso_app.h:226
ModelPart::NodesContainerType NodesArrayType
Definition: cutting_iso_app.h:58
void FirstLoop(ModelPart &this_model_part, compressed_matrix< int > &Coord, Variable< double > &variable, double isovalue, int number_of_triangles, vector< int > &Elems_In_Isosurface, float tolerance)
************************************************************************************************
Definition: cutting_iso_app.h:367
void CSR_Row_Matrix_Mod(ModelPart &this_model_part, compressed_matrix< int > &Coord)
LIST OF SUBROUTINES.
Definition: cutting_iso_app.h:331
Cutting_Isosurface_Application()=default
Default constructor.
boost::numeric::ublas::vector< Vector_Order_Tensor > Node_Vector_Order_Tensor
Definition: cutting_iso_app.h:63
void Calculate_Coordinate_And_Insert_New_Nodes_Mod(ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 2 > > &Position_Node, const boost::numeric::ublas::vector< int > &List_New_Nodes, Variable< double > &variable, double isovalue, float tolerance)
************************************************************************************************
Definition: cutting_iso_app.h:676
ModelPart::ElementsContainerType ElementsArrayType
Definition: cutting_iso_app.h:59
void AddModelPartElements(ModelPart &mr_model_part, ModelPart &mr_new_model_part, int number)
ADDMODELPARTELEMENTS: THIS FUNCTION ADDS TO THE NEW MODEL PART THE DATA BELONGING TO THE OLD MODEL PA...
Definition: cutting_iso_app.h:136
boost::numeric::ublas::vector< Matrix > Matrix_Order_Tensor
Definition: cutting_iso_app.h:61
void DeleteCutData(ModelPart &new_model_part)
DELETECUTDATA: THIS FUNCTION DELETES THE MESH FROM THE PREVIOUS TIME STEP.
Definition: cutting_iso_app.h:1556
std::vector< PointType::Pointer > PointVector
Definition: cutting_iso_app.h:66
void GenerateElements(ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 4 > > &Position_Node, vector< int > Elems_In_Isosurface, compressed_matrix< int > &Coord, Variable< double > &variable, int surface_number)
************************************************************************************************
Definition: cutting_iso_app.h:861
void Calculate_Coordinate_And_Insert_New_Nodes_Mod(ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 2 > > &Position_Node, const boost::numeric::ublas::vector< int > &List_New_Nodes, Variable< array_1d< double, 3 > > &variable, double isovalue, float tolerance)
Definition: cutting_iso_app.h:743
virtual ~Cutting_Isosurface_Application()=default
Destructor.
void GenerateElements(ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 4 > > &Position_Node, vector< int > Elems_In_Isosurface, compressed_matrix< int > &Coord, Variable< array_1d< double, 3 > > &variable, int surface_number)
Definition: cutting_iso_app.h:1207
boost::numeric::ublas::vector< Vector > Vector_Order_Tensor
Definition: cutting_iso_app.h:62
void FirstLoop(ModelPart &this_model_part, compressed_matrix< int > &Coord, Variable< array_1d< double, 3 > > &variable, double isovalue, int number_of_triangles, vector< int > &Elems_In_Isosurface, float tolerance)
Definition: cutting_iso_app.h:461
void GenerateVariableCut(ModelPart &mr_model_part, ModelPart &mr_new_model_part, Variable< TDataType > &variable, double isovalue, int isosurface_number, float tolerance)
This function Creates cutting isosurfaces by creating nodes and conditions (to define the conectiviti...
Definition: cutting_iso_app.h:92
void UpdateCutData(ModelPart &new_model_part, ModelPart &old_model_part)
UPDATECUTDATA: THIS FUNCTION UPDATES THE DATA OF THE NEW MODEL PART READING FROM THE DATA OF THE FATH...
Definition: cutting_iso_app.h:1527
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
Geometry base class.
Definition: geometry.h:71
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
iterator begin()
Definition: global_pointers_vector.h:221
iterator end()
Definition: global_pointers_vector.h:229
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
static T CrossProduct(const T &a, const T &b)
Performs the vector product of the two input vectors a,b.
Definition: math_utils.h:762
PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
Definition: mesh.h:394
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
NodeType::Pointer CreateNewNode(int Id, double x, double y, double z, VariablesList::Pointer pNewVariablesList, IndexType ThisIndex=0)
Definition: model_part.cpp:270
SizeType GetNodalSolutionStepDataSize()
Definition: model_part.h:571
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
void AddNodalSolutionStepVariable(VariableData const &ThisVariable)
Definition: model_part.h:532
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
VariablesList & GetNodalSolutionStepVariablesList()
Definition: model_part.h:549
This class defines the node.
Definition: node.h:65
A four node tetrahedra geometry with linear shape functions.
Definition: tetrahedra_3d_4.h:59
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
BOOST_UBLAS_INLINE void resize(size_type array_size, bool preserve=true)
Definition: array_1d.h:242
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
active
Definition: generate_frictionless_components_mortar_condition.py:175
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
int tol
Definition: hinsberg_optimization.py:138
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
int counter
Definition: script_THERMAL_CORRECT.py:218
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17