23 std::stringstream node, connectivity, type, material, index, referenceIndex;
26 file <<
"# vtk DataFile Version 3.0" << std::endl;
27 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
28 file <<
"ASCII" << std::endl << std::endl;
30 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
33 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
35 for (int64_t el = 0; el < nelements; el++) {
37 if (cel == NULL || cel->
Reference() == NULL) {
49 size += (1 + elNnodes);
50 connectivity << elNnodes;
52 for (
int t = 0; t < elNnodes; t++) {
53 for (
int c = 0; c < 3; c++) {
60 connectivity <<
" " << actualNode;
62 connectivity << std::endl;
65 type << elType << std::endl;
67 if (matColor ==
true) {
70 material << elType << std::endl;
72 index << cel->
Index() << std::endl;
73 referenceIndex << gel->
Index() << std::endl;
79 file << actualNode <<
" float" << std::endl << node.str();
81 file <<
"CELLS " << nVALIDelements <<
" ";
83 file << size << std::endl;
84 file << connectivity.str() << std::endl;
86 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
87 file << type.str() << std::endl;
89 file <<
"CELL_DATA " <<
" " << nVALIDelements << std::endl;
90 file <<
"FIELD FieldData 3 " << std::endl;
91 if (matColor ==
true) {
92 file <<
"material 1 " << nVALIDelements <<
" int " << std::endl;
94 file <<
"ElementType 1 " << nVALIDelements <<
" int " << std::endl;
96 file << material.str();
98 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
101 file <<
"geoElIndex 1 " << nVALIDelements <<
" int" << std::endl;
102 file << referenceIndex.str();
115 std::stringstream node, connectivity, type, material, index, referenceIndex;
118 file <<
"# vtk DataFile Version 3.0" << std::endl;
119 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
120 file <<
"ASCII" << std::endl << std::endl;
122 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
125 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
127 for (int64_t el = 0; el < nelements; el++) {
129 if (gel == NULL || gel->
Reference() == NULL) {
136 size += (1 + elNnodes);
137 connectivity << elNnodes;
139 for (
int t = 0; t < elNnodes; t++) {
140 for (
int c = 0; c < 3; c++) {
142 node << coord <<
" ";
147 connectivity <<
" " << actualNode;
149 connectivity << std::endl;
152 type << elType << std::endl;
154 if (matColor ==
true) {
157 material << elType << std::endl;
159 index << cel->
Index() << std::endl;
160 referenceIndex << gel->
Index() << std::endl;
166 file << actualNode <<
" float" << std::endl << node.str();
168 file <<
"CELLS " << nVALIDelements <<
" ";
170 file << size << std::endl;
171 file << connectivity.str() << std::endl;
173 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
174 file << type.str() << std::endl;
176 file <<
"CELL_DATA " <<
" " << nVALIDelements << std::endl;
177 file <<
"FIELD FieldData 3 " << std::endl;
178 if (matColor ==
true) {
179 file <<
"material 1 " << nVALIDelements <<
" int " << std::endl;
181 file <<
"ElementType 1 " << nVALIDelements <<
" int " << std::endl;
183 file << material.str();
185 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
188 file <<
"geoElIndex 1 " << nVALIDelements <<
" int" << std::endl;
189 file << referenceIndex.str();
202 std::stringstream node, connectivity, type, material, index;
205 file <<
"# vtk DataFile Version 3.0" << std::endl;
206 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
207 file <<
"ASCII" << std::endl << std::endl;
209 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
212 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
214 for (int64_t el = 0; el < nelements; el++) {
227 size += (1 + elNnodes);
228 connectivity << elNnodes;
230 for (
int t = 0; t < elNnodes; t++) {
231 for (
int c = 0; c < 3; c++) {
233 node << coord <<
" ";
238 connectivity <<
" " << actualNode;
240 connectivity << std::endl;
243 type << elType << std::endl;
245 if (matColor ==
true) {
248 index << gel->
Index() << std::endl;
253 file << actualNode <<
" float" << std::endl << node.str();
255 file <<
"CELLS " << nVALIDelements <<
" ";
257 file << size << std::endl;
258 file << connectivity.str() << std::endl;
260 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
261 file << type.str() << std::endl;
263 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
264 file <<
"FIELD FieldData " << (matColor ?
"2" :
"1") << std::endl;
265 if (matColor ==
true) {
266 file <<
"material 1 " << nVALIDelements <<
" int" << std::endl;
267 file << material.str();
269 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
280 std::cout <<
"Wrong vector size of elements data!" << std::endl;
281 std::cout <<
"See " << __PRETTY_FUNCTION__ << std::endl;
286 std::stringstream node, connectivity, type, material, index;
289 file <<
"# vtk DataFile Version 3.0" << std::endl;
290 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
291 file <<
"ASCII" << std::endl << std::endl;
293 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
296 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
299 for (int64_t el = 0; el < nelements; el++) {
305 if (elData[el] == -999) {
312 size += (1 + elNnodes);
313 connectivity << elNnodes;
315 for (
int t = 0; t < elNnodes; t++) {
316 for (
int c = 0; c < 3; c++) {
318 node << coord <<
" ";
323 connectivity <<
" " << actualNode;
325 connectivity << std::endl;
328 type << elType << std::endl;
330 material << elData[el] << std::endl;
331 index << gel->
Index() << std::endl;
337 file << actualNode <<
" float" << std::endl << node.str();
339 file <<
"CELLS " << nVALIDelements <<
" ";
341 file << size << std::endl;
342 file << connectivity.str() << std::endl;
344 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
345 file << type.str() << std::endl;
347 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
348 file <<
"FIELD FieldData 2" << std::endl;
350 file <<
"Substructure 1 " << nVALIDelements <<
" int" << std::endl;
351 file << material.str();
353 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
364 std::cout <<
"Wrong vector size of elements data!" << std::endl;
365 std::cout <<
"See " << __PRETTY_FUNCTION__ << std::endl;
370 std::stringstream node, connectivity, type, material, index;
373 file <<
"# vtk DataFile Version 3.0" << std::endl;
374 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
375 file <<
"ASCII" << std::endl << std::endl;
377 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
380 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
383 for (int64_t el = 0; el < nelements; el++) {
389 if (elData[el] == -999.) {
396 size += (1 + elNnodes);
397 connectivity << elNnodes;
399 for (
int t = 0; t < elNnodes; t++) {
400 for (
int c = 0; c < 3; c++) {
402 node << coord <<
" ";
407 connectivity <<
" " << actualNode;
409 connectivity << std::endl;
412 type << elType << std::endl;
414 material << elData[el] << std::endl;
416 index << gel->
Index() << std::endl;
422 file << actualNode <<
" float" << std::endl << node.str();
424 file <<
"CELLS " << nVALIDelements <<
" ";
426 file << size << std::endl;
427 file << connectivity.str() << std::endl;
429 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
430 file << type.str() << std::endl;
432 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
433 file <<
"FIELD FieldData 2" << std::endl;
435 file <<
"Substructure 1 " << nVALIDelements <<
" float" << std::endl;
436 file << material.str();
438 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
451 std::stringstream node, connectivity, type, material, index, referenceIndex;
454 file <<
"# vtk DataFile Version 3.0" << std::endl;
455 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
456 file <<
"ASCII" << std::endl << std::endl;
458 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
461 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
463 for (int64_t el = 0; el < nelements; el++) {
474 if (elData[el] == -999.) {
481 size += (1 + elNnodes);
482 connectivity << elNnodes;
484 for (
int t = 0; t < elNnodes; t++) {
485 for (
int c = 0; c < 3; c++) {
487 node << coord <<
" ";
492 connectivity <<
" " << actualNode;
494 connectivity << std::endl;
497 type << elType << std::endl;
499 material << elData[el] << std::endl;
501 index << cel->
Index() << std::endl;
502 referenceIndex << gel->
Index() << std::endl;
508 file << actualNode <<
" float" << std::endl << node.str();
510 file <<
"CELLS " << nVALIDelements <<
" ";
512 file << size << std::endl;
513 file << connectivity.str() << std::endl;
515 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
516 file << type.str() << std::endl;
518 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
519 file <<
"FIELD FieldData 3" << std::endl;
521 file << dataName <<
" 1 " << nVALIDelements <<
" float" << std::endl;
523 file << material.str();
525 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
528 file <<
"geoElIndex 1 " << nVALIDelements <<
" int" << std::endl;
529 file << referenceIndex.str();
537 std::ofstream file(filename);
544 std::cout <<
"Wrong vector size of elements data!" << std::endl;
545 std::cout <<
"See " << __PRETTY_FUNCTION__ << std::endl;
550 std::stringstream connectivity, type, material, index;
553 file <<
"# vtk DataFile Version 3.0" << std::endl;
554 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
555 file <<
"ASCII" << std::endl << std::endl;
557 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
561 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
562 int64_t counternodes = gmesh->
NNodes();
565 for (el = 0; el < nelements; el++) {
571 if (elData[el] == -999) {
578 size += (1 + elNnodes);
579 connectivity << elNnodes;
581 for (t = 0; t < elNnodes; t++) {
586 connectivity <<
" " << actualNode;
588 connectivity << std::endl;
591 type << elType << std::endl;
593 material << elData[el] << std::endl;
595 index << gel->
Index() << std::endl;
601 file << counternodes <<
" float" << std::endl;
602 for (t = 0; t < counternodes; t++) {
604 for (c = 0; c < 3; c++) {
605 double coord = node->
Coord(c);
606 file << coord <<
" ";
611 file << std::endl <<
"CELLS " << nVALIDelements <<
" ";
613 file << size << std::endl;
614 file << connectivity.str() << std::endl;
616 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
617 file << type.str() << std::endl;
619 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
620 file <<
"FIELD FieldData 2" << std::endl;
622 file <<
"Substructure 1 " << nVALIDelements <<
" int" << std::endl;
624 file << material.str();
626 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
635 std::ofstream file(filename);
642 std::cout <<
"Wrong vector size of elements data!" << std::endl;
643 std::cout <<
"See " << __PRETTY_FUNCTION__ << std::endl;
648 std::stringstream connectivity, type, datael, index;
651 file <<
"# vtk DataFile Version 3.0" << std::endl;
652 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
653 file <<
"ASCII" << std::endl << std::endl;
655 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
659 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
660 int64_t counternodes = gmesh->
NNodes();
663 for (el = 0; el < nelements; el++) {
669 if (elData[el] == -999) {
676 size += (1 + elNnodes);
677 connectivity << elNnodes;
679 for (t = 0; t < elNnodes; t++) {
684 connectivity <<
" " << actualNode;
686 connectivity << std::endl;
689 type << elType << std::endl;
691 datael << elData[el] << std::endl;
692 index << gel->
Index() << std::endl;
698 file << counternodes <<
" float" << std::endl;
699 for (t = 0; t < counternodes; t++) {
701 for (c = 0; c < 3; c++) {
702 double coord = node->
Coord(c);
703 file << coord <<
" ";
708 file << std::endl <<
"CELLS " << nVALIDelements <<
" ";
710 file << size << std::endl;
711 file << connectivity.str() << std::endl;
713 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
714 file << type.str() << std::endl;
716 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
717 file <<
"FIELD FieldData 2" << std::endl;
719 file <<
"Substructure 1 " << nVALIDelements <<
" float" << std::endl;
720 file << datael.str();
722 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
730 std::ofstream file(filename);
736 if (gmesh->
NElements() != elData.NElements()) {
737 std::cout <<
"Wrong vector size of elements data!" << std::endl;
738 std::cout <<
"See " << __PRETTY_FUNCTION__ << std::endl;
742 int64_t ndatas = elData[0].NElements();
748 std::stringstream connectivity, type, index;
749 std::stringstream *datael =
new std::stringstream[ndatas];
752 file <<
"# vtk DataFile Version 3.0" << std::endl;
753 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
754 file <<
"ASCII" << std::endl << std::endl;
756 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
759 int64_t dat, t, c, el;
760 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
761 int64_t counternodes = gmesh->
NNodes();
764 for (el = 0; el < nelements; el++) {
770 if (elData[el][0] < 0.) {
777 size += (1 + elNnodes);
778 connectivity << elNnodes;
780 for (t = 0; t < elNnodes; t++) {
785 connectivity <<
" " << actualNode;
787 connectivity << std::endl;
790 type << elType << std::endl;
791 index << gel->
Index() << std::endl;
793 for (dat = 0; dat < ndatas; dat++)
794 *(datael + dat) << elData[el][dat] << std::endl;
800 file << counternodes <<
" float" << std::endl;
801 for (t = 0; t < counternodes; t++) {
803 for (c = 0; c < 3; c++) {
804 double coord = node->
Coord(c);
805 file << coord <<
" ";
810 file << std::endl <<
"CELLS " << nVALIDelements <<
" ";
812 file << size << std::endl;
813 file << connectivity.str() << std::endl;
815 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
816 file << type.str() << std::endl;
818 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
819 file <<
"FIELD FieldData " << ndatas + 1 << std::endl;
821 for (dat = 0; dat < ndatas; dat++) {
822 file <<
"Substructure" << dat + 1 <<
" 1 " << nVALIDelements <<
" float" << std::endl;
823 file << datael[dat].str();
827 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
838 std::ofstream file(filename);
847 std::stringstream connectivity, type, material, index;
850 file <<
"# vtk DataFile Version 3.0" << std::endl;
851 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
852 file <<
"ASCII" << std::endl << std::endl;
854 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
858 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
859 int64_t counternodes = gmesh->
NNodes();
865 for (el = 0; el < nelements; el++) {
880 size += (1 + elNnodes);
881 connectivity << elNnodes;
883 for (t = 0; t < elNnodes; t++) {
888 connectivity <<
" " << actualNode;
890 connectivity << std::endl;
893 type << elType << std::endl;
901 index << gel->
Index() << std::endl;
907 file << counternodes <<
" float" << std::endl;
908 for (t = 0; t < counternodes; t++) {
910 for (c = 0; c < 3; c++) {
911 double coord = node->
Coord(c);
912 file << coord <<
" ";
917 file << std::endl <<
"CELLS " << nVALIDelements <<
" ";
919 file << size << std::endl;
920 file << connectivity.str() << std::endl;
922 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
923 file << type.str() << std::endl;
925 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
926 file <<
"FIELD FieldData 2" << std::endl;
928 file <<
"Substructure 1 " << nVALIDelements <<
" double" << std::endl;
930 file << material.str();
932 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
945 std::stringstream node, connectivity, type, material, index;
948 file <<
"# vtk DataFile Version 3.0" << std::endl;
949 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
950 file <<
"ASCII" << std::endl << std::endl;
952 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
955 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
957 for (int64_t el = 0; el < nelements; el++) {
967 bool matFound =
false;
968 for (
int s = 0; s < gel->
NSides(); s++) {
972 while (thisSide != neighSide) {
973 if (neighSide.Element()->MaterialId() == neighMaterial) {
990 size += (1 + elNnodes);
991 connectivity << elNnodes;
993 for (
int t = 0; t < elNnodes; t++) {
994 for (
int c = 0; c < 3; c++) {
996 node << coord <<
" ";
1001 connectivity <<
" " << actualNode;
1003 connectivity << std::endl;
1006 type << elType << std::endl;
1008 if (matColor ==
true) {
1011 material << elType << std::endl;
1013 index << gel->
Index() << std::endl;
1018 file << actualNode <<
" float" << std::endl << node.str();
1020 file <<
"CELLS " << nVALIDelements <<
" ";
1022 file << size << std::endl;
1023 file << connectivity.str() << std::endl;
1025 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
1028 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
1029 file <<
"FIELD FieldData 2" << std::endl;
1030 if (matColor ==
true) {
1031 file <<
"material 1 " << nVALIDelements <<
" int" << std::endl;
1033 file <<
"ElementType 1 " << nVALIDelements <<
" int" << std::endl;
1035 file << material.str();
1037 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
1038 file << index.str();
1046 std::set<int> myMaterial;
1047 myMaterial.insert(elMat);
1048 myMaterial.insert(surrMat);
1055 int nsides = gel->
NSides();
1056 for (
int s = 0; s < nsides; s++) {
1060 while (thisSide != neighSide) {
1062 if (thisSide.
IsAncestor(neighSide) ==
false) {
1076 std::stringstream node, connectivity, type, material;
1079 file <<
"# vtk DataFile Version 3.0" << std::endl;
1080 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
1081 file <<
"ASCII" << std::endl << std::endl;
1083 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
1086 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
1088 for (int64_t el = 0; el < nelements; el++) {
1089 if (elIndex.find(el) == elIndex.end()) {
1104 size += (1 + elNnodes);
1105 connectivity << elNnodes;
1107 for (
int t = 0; t < elNnodes; t++) {
1108 for (
int c = 0; c < 3; c++) {
1110 node << coord <<
" ";
1115 connectivity <<
" " << actualNode;
1117 connectivity << std::endl;
1120 type << elType << std::endl;
1122 material << el << std::endl;
1128 file << actualNode <<
" float" << std::endl << node.str();
1130 file <<
"CELLS " << nVALIDelements <<
" ";
1132 file << size << std::endl;
1133 file << connectivity.str() << std::endl;
1135 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
1136 file << type.str() << std::endl;
1138 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
1139 file <<
"FIELD FieldData 1" << std::endl;
1141 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
1143 file << material.str();
1151 int64_t nnodes = gel->
NNodes();
1152 for (int64_t nd = 0; nd < nnodes; nd++) {
1156 int64_t elIndex = 0;
1166 for (
int s = 0; s < nSons; s++) {
1180 std::stringstream node, connectivity, type, material, index;
1183 file <<
"# vtk DataFile Version 3.0" << std::endl;
1184 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
1185 file <<
"ASCII" << std::endl << std::endl;
1187 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
1190 int64_t actualNode = -1, size = 0, nVALIDelements = 0;
1192 for (int64_t el = 0; el < nelements; el++) {
1202 bool found = !(myMaterial.find(mat) == myMaterial.end());
1210 size += (1 + elNnodes);
1211 connectivity << elNnodes;
1213 for (
int t = 0; t < elNnodes; t++) {
1214 for (
int c = 0; c < 3; c++) {
1216 node << coord <<
" ";
1221 connectivity <<
" " << actualNode;
1223 connectivity << std::endl;
1226 type << elType << std::endl;
1228 if (matColor ==
true) {
1231 material << elType << std::endl;
1233 index << gel->
Index() << std::endl;
1238 file << actualNode <<
" float" << std::endl << node.str();
1240 file <<
"CELLS " << nVALIDelements <<
" ";
1242 file << size << std::endl;
1243 file << connectivity.str() << std::endl;
1245 file <<
"CELL_TYPES " << nVALIDelements << std::endl;
1248 file <<
"CELL_DATA" <<
" " << nVALIDelements << std::endl;
1249 file <<
"FIELD FieldData 2" << std::endl;
1250 if (matColor ==
true) {
1251 file <<
"material 1 " << nVALIDelements <<
" int" << std::endl;
1253 file <<
"ElementType 1 " << nVALIDelements <<
" int" << std::endl;
1255 file << material.str();
1257 file <<
"elIndex 1 " << nVALIDelements <<
" int" << std::endl;
1258 file << index.str();
1310 std::cout <<
"Element type not found on " << __PRETTY_FUNCTION__ << std::endl;
1316 std::cout <<
"Element type not found on " << __PRETTY_FUNCTION__ << std::endl;
1317 std::cout <<
"MIGHT BE CURVED ELEMENT (quadratic or quarter point)" << std::endl;
1327 file <<
"# vtk DataFile Version 3.0" << std::endl;
1328 file <<
"TPZGeoMesh VTK Visualization" << std::endl;
1329 file <<
"ASCII" << std::endl << std::endl;
1331 file <<
"DATASET UNSTRUCTURED_GRID" << std::endl;
1333 std::stringstream points;
1334 int64_t numpoints = 0;
1335 std::stringstream celldata;
1336 std::stringstream fielddata;
1339 for (int64_t iel = 0; iel < nel; iel++) {
1349 int nsides = gel->
NSides();
1350 for (
int side = 0; side < nsides; side++) {
1355 if (dimensions.find(sidedim) == dimensions.end()) {
1362 points << coord << std::endl;
1363 celldata <<
"1 " << numpoints << std::endl;
1366 int corder = c.
Order();
1367 fielddata << corder << std::endl;
1371 file << numpoints <<
" float" << std::endl << points.str();
1373 file <<
"CELLS " << numpoints <<
" ";
1375 file << 2 * numpoints << std::endl;
1376 file << celldata.str() << std::endl;
1378 file <<
"CELL_TYPES " << numpoints << std::endl;
1379 for (int64_t i = 0; i < numpoints; i++) {
1380 file << pointtype << std::endl;
1383 file <<
"CELL_DATA" <<
" " << numpoints << std::endl;
1384 file <<
"FIELD FieldData 1" << std::endl;
1385 file <<
"porder 1 " << numpoints <<
" int" << std::endl;
1386 file << fielddata.str();
int64_t NElements() const
Number of computational elements allocated.
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Implements a vector class which allows to use external storage provided by the user. Utility.
int MaterialId() const
Returns the material index of the element.
static void PrintGMeshVTKmy_material(TPZGeoMesh *gmesh, std::ofstream &file, std::set< int > myMaterial, bool matColor=true)
Based on a given geomesh, just the elements that have the given material id will be exported to an VT...
REAL Coord(int i) const
Returns i-th coordinate of the current node.
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
int64_t NElements() const
Number of elements of the mesh.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
int64_t NElements() const
Access method to query the number of elements of the vector.
TPZGeoElSide Neighbour() const
TPZGeoMesh * Mesh() const
Returns the mesh to which the element belongs.
virtual int NSides() const =0
Returns the number of connectivities of the element.
virtual int64_t NodeIndex(int i) const =0
Returns the index of the ith node the index is the location of the node in the nodevector of the mesh...
virtual int SideDimension(int side) const =0
Return the dimension of side.
void LoadReferences()
Map this grid in the geometric grid.
virtual void CenterPoint(int side, TPZVec< REAL > &masscent) const =0
It returns the coordinates from the center of the side of the element in the element coordinate space...
virtual TPZGeoEl * SubElement(int is) const =0
Returns a pointer to the subelement is.
unsigned char Order() const
Access function to return the order associated with the connect.
static void PrintPOrderPoints(TPZCompMesh &cmesh, std::set< int > dimensions, std::ofstream &outfile)
Implements a generic geometric element which is refined according to a generic refinement pattern...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
static void PrintCMeshVTK(TPZCompMesh *cmesh, std::ofstream &file, bool matColor=true)
Generate an output of all geometric elements that have a computational counterpart to VTK...
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
#define DebugStop()
Returns a message to user put a breakpoint in.
int64_t NNodes() const
Number of nodes of the mesh.
virtual TPZConnect & MidSideConnect(int is) const
Returns a reference to the connect in the middle of the side.
int MElementType_NNodes(MElementType elType)
constant which defines the type of HDiv approximation space
virtual MElementType Type() const =0
Returns the element type acording to pzeltype.h.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
int64_t Index() const
Returns element index of the mesh fELementVec list.
static void PrintGMeshVTK(TPZGeoMesh *gmesh, std::ofstream &file, bool matColor=true)
Default constructor for graphical mesh with VTK format.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
virtual int NNodes() const =0
Returns the number of nodes of the element.
virtual bool IsLinearMapping() const
TPZGeoEl * Element() const
virtual int Dimension() const =0
Returns the dimension of the element.
static void PrintGMeshVTKneighbourhood(TPZGeoMesh *gmesh, int64_t elIndex, std::ofstream &file)
Print the elements that surround a givel geoel.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
static void PrintGMeshVTKneighbour_material(TPZGeoMesh *gmesh, std::ofstream &file, int neighMaterial, bool matColor=false)
Based on a given geomesh, just the elements that have an neighbour with a given material id will be e...
Implements a geometric node in the pz environment. Geometry.
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
virtual int NSideConnects(int iside) const override=0
Returns the number of dof nodes along side iside.
This class implements a geometric mesh for the pz environment. Geometry.
MElementType
Define the element types.
Implements computational mesh. Computational Mesh.
bool IsAncestor(TPZGeoElSide other)
Checks whether other is an ancestor of this.
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
void SetMaterialId(int id)
Sets the material index of the element.
static void SetMaterialVTK(TPZGeoEl *gel, int mat)
int64_t NElements() const
Returns the number of elements of the vector.
Defines the interface of a computational element. Computational Element.
Contains the TPZVTKGeoMesh class which implements the graphical mesh to VTK environment to geometric ...
virtual int NSubElements() const =0
Returns the number of subelements of the element independent of the fact whether the element has alr...
Implements computational element based on an interpolation space. Computational Element.
static int GetVTK_ElType(TPZGeoEl *gel)
Get type of the geometric element.
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.