33 Pjnts.initialize(0,10);
34 Edges.initialize(0,10);
35 Faces.initialize(0,10);
36 Elems.initialize(0,10);
48 Pjnts.delete_objects();
49 Edges.delete_objects();
50 Faces.delete_objects();
51 Elems.delete_objects();
64 for (i=0; i<
Elems(); i++) Elems[i]->set_mprop(1);
91 for (i=0; i<
Pjnts(); i++)
if ( !Pjnts[i] && Pjnts[i]->
give_ID() != i )
_errorr3 (
"Node %ld is on position %ld, it is forbidden", Pjnts[i]->
give_ID(), i);
92 for (i=0; i<
Edges(); i++)
if ( !Edges[i] || Edges[i]->
give_ID() != i )
_errorr3 (
"Edge %ld is on position %ld, it is forbidden", Edges[i]->
give_ID(), i);
93 for (i=0; i<
Faces(); i++)
if ( !Faces[i] && Faces[i]->
give_ID() != i )
_errorr3 (
"Face %ld is on position %ld, it is forbidden", Faces[i]->
give_ID(), i);
94 for (i=0; i<
Elems(); i++)
if ( !Elems[i] && Elems[i]->
give_ID() != i )
_errorr3 (
"Elem %ld is on position %ld, it is forbidden", Elems[i]->
give_ID(), i);
99 for (i=0; i<
Elems(); i++)
100 for (j=0; j<Elems[i]->give_nno(); j++)
101 if (Elems[i]->give_point(j) == NULL)
102 _errorr3 (
"The %d-th node on element %d is not set", j, i);
119 for (
long i=0; i<
Pjnts(); i++)
120 if (Pjnts[i]->has_mproperty (prp)) {
121 if (unique && p)
_errorr2(
"node with property %d is not unique", prp);
139 for (
long i=0; i<list(); i++)
140 if (list[i]->give_delete_flag())
141 list.delete_object(i);
178 for (i=0; i<
Elems(); i++)
179 if ( Elems[i]->give_delete_flag() )
180 Elems[i]->connectivity_removing ();
220 for (
long i=0; i<
Elems(); i++)
245 case 0:
_errorr2 (
"give_VTKcelltype is not implemented on element %ld", i);
246 default:
_errorr (
"unsuported VTK cell type");
285 for (
long i=0; i<
Elems(); i++)
299 for (
long i=0; i<
Elems(); i++)
313 coo =
Pjnts[indx]->give_coords();
315 for (
long j=0; j<3; j++)
323 coo =
Pjnts[0]->give_coords();
327 for (i=1; i<
Pjnts(); i++) {
328 coo = Pjnts[i]->give_coords();
343 ((
Mesh *)
this)->boubox_assembling();
351 if (dynamic_cast<const Point *>(comp)) {
354 else if (dynamic_cast<const Cell *> (comp)) {
357 if (dynamic_cast<const Element *> (comp)) {
370 for (
long i=0; i<
Elems(); i++)
379 return Elems[i]->give_VTKPDtopology();
389 const Mesh *m =
dynamic_cast<const Mesh *
>(
this);
402 long cBeam,cTriangle,cQuads,cPolygon,cTetra,cBrick;
403 ; cBeam=cTriangle=cQuads=cPolygon=cTetra=cBrick = 0;
407 switch (
Elems[i]->give_cellGeom()) {
414 default:
_errorr2 (
"Unknown element geom type (element number %d)", i+1);
427 double lav, cs, LAV[3], VOL[2];
428 cs = LAV[0] = LAV[1] = LAV[2] = VOL[0] = VOL[1] = 0.0;
431 for (i=0; i<Ne; i++) {
432 dim =
Elems[i]->give_dimension();
433 lav =
Elems[i]->give_lav();
437 if (dim == 1 && (cs =
Elems[i]->give_elemAttribs()->give_cs()->give_area()) <= 0.0) novol =
true;
438 else if (dim == 2 && (cs =
Elems[i]->give_elemAttribs()->give_cs()->give_thickness()) <= 0.0) novol =
true;
441 if (dim == 1) { LAV[0] += lav; VOL[0] += cs*lav; }
442 else if (dim == 2) { LAV[1] += lav; VOL[1] += cs*lav; }
446 VOL[0] = VOL[1] = 0.0;
448 if (LAV[0] > 0.0) fprintf (stdout,
" Suma of lengths/volumes: %6g / %6g\n", LAV[0], VOL[0]);
449 if (LAV[1] > 0.0) fprintf (stdout,
" Suma of areas /volumes: %6g / %6g\n", LAV[1], VOL[1]);
450 if (LAV[2] > 0.0) fprintf (stdout,
" Suma of volumes/volumes: %6g / %6g\n", LAV[2], LAV[2]);
460 FILE*
scan_DATA_head (FILE *stream,
const char *str,
const char *expnumtype,
int *noc,
const char *descript)
463 char auxs[255], LINE[1023];
464 sprintf (auxs,
"Error in section %s", descript);
468 if (*noc && *noc != n)
_errorr3 (
"in SCALAR, number of components is not \"%d\" but %d", *noc, n);
470 fgets (LINE, 1023, stream); str=LINE;
479 if ( dataL && !dataD) {
if (stream->
isFile()) sprintf(flint,
"int");
else sprintf(flint,
"Int32"); }
480 else if (!dataL && dataD) {
if (stream->
isFile()) sprintf(flint,
"float");
else sprintf(flint,
"Float32"); }
488 if (nexc && nexc != n)
_errorr4 (
"in DataArray %s, number of components is not \"%d\" but %d", name, nexc, n);
502 return (
Point*)(
new Vertex (
this, gid, coo, attribs_alloc));
507 return (
Point*)(
new Node (
this, gid, coo, attribs_alloc) );
514 if (lid == -1) lid = gid;
519 else return new Line (gid, oid, geom);
break;
527 else return new Beam (gid, oid, geom, attribs_alloc, dom, lid);
break;
530 case CG_Hexahedron:
return new Brick (gid, oid, geom, attribs_alloc, dom, lid);
break;
541 char *file =
new char[255];
545 stream->open(
STRM_void,
"r", (
const char*&)file);
551 this->
read_VTK (
'-', stream,
true, sparse);
563 bool lgc = stream->
isFile();
567 bool status =
true, parent;
569 long i, j, id, nn, auxl, noel, cno, offset, nSprsItms=0;
572 const char *data=NULL, *offs=NULL, *typs, *str;
573 char LINE[1023], *WORD=NULL;
581 Lvctr *sparse = NULL;
587 if (lgc) WORD =
new char[255];
588 else xnel = stream->
tixel();
591 if (sparse && !addata)
errol;
599 if (fgets (LINE, lLINE, stream->
file()) == NULL)
break;
612 if (strcasecmp(WORD,
"Points") == 0) {
625 Pjnts.reallocup(noel);
628 while (noel) { noel--;
630 else status += coord.
scan_xyz(data);
635 else if (strcmp(WORD,
"Vertices") == 0 || strcmp(WORD,
"Verts") == 0) {
638 if (!noel)
continue;
else _errorr(
"error v");
643 else if (strcasecmp(WORD,
"CELLS") == 0) {
644 if (DATASET !=
'U')
errol;
654 data =
XP_giveDAtext (stream->
tixel(), 1,
false,
"ascii",
"Int32",
"connectivity", NULL);
659 Elems.reallocup(noel);
664 fgets (LINE, lLINE, stream->
file()); str=LINE;
669 while (noel) { noel--;
670 if (lgc) fscanf (stream->
file(),
"%ld",&auxl);
678 default:
_errorr3 (
"Unknown %ld-th CELL_TYPE: %ld",
Elems()+1, auxl);
682 rewind (stream->
file());
687 for (i=0; i<
Elems(); i++) {
689 if (lgc) { fscanf (stream->
file(),
"%ld",&nn); cno = cno - nn - 1; }
690 else { nn = offset; status +=
SP_scan_number (offs, offset); nn = offset - nn; }
693 if (nn != Elems[i]->give_nno())
694 _errorr4 (
"The number of element(%ld) nodes %ld is not equal to %ld, wrong array offsets", i, auxl, nn);
696 for (j=0; j<nn; j++) {
697 if (lgc) fscanf (stream->
file(),
"%ld", &auxl);
699 Elems[i]->set_point(j, auxl);
707 else if (strcasecmp(WORD,
"LINES") == 0 || strcasecmp(WORD,
"POLYGONS" ) == 0 || strcasecmp(WORD,
"POLYS") == 0) {
708 if (DATASET !=
'P')
errol;
721 data =
XP_giveDAtext (stream->
tixel(), 1,
false,
"ascii",
"Int32",
"connectivity", NULL);
728 while (noel) { (noel)--;
730 if (lgc) fscanf (stream->
file(),
"%ld", &nn);
731 else { nn = offset; status +=
SP_scan_number (offs, offset); nn = offset - nn; }
732 if (WORD[0] ==
'L') {
735 else _errorr2 (
"Unsupported number of nodes on element \"%ld\"",
Elems()+1);
737 if (WORD[0] ==
'P') {
740 else _errorr2 (
"Unsupported number of nodes on element \"%ld\"",
Elems()+1);
743 for (j=0; j<nn; j++) {
744 if (lgc) fscanf (stream->
file(),
"%ld", &auxl);
751 if (lgc) cno = cno - nn - 1;
755 else if (strcmp(WORD,
"Strips") == 0) {
758 if (!noel)
continue;
else _errorr(
"error s");
763 else if (strcmp(WORD,
"POINT_DATA") == 0 || strcmp(WORD,
"PointData") == 0) {
771 if (!sparse) nSprsItms =
Pjnts();
776 else if (strcmp(WORD,
"CELL_DATA") == 0 || strcmp(WORD,
"CellData") == 0) {
784 if (!sparse) nSprsItms =
Elems();
789 else if (strcmp(WORD,
"SCALARS") == 0 || strcmp(WORD,
"DataArray") == 0) {
798 if (strcmp(WORD,
"IDS_Prescribed_Values" ) == 0) {
scan_DATA_field (stream, str, 0, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
Node*)
Pjnts[
id])->give_pointAttribs()->set_nDOFs_BC(dataL.
give_ccols(), dataL.
give_ptr2val(i,0)); } }
799 else if (strcmp(WORD,
"ID_SET_IDS_Prescribed_Values") == 0) {
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0)) ((
Node*)
Pjnts[id])->give_pointAttribs()->set_dofbc_with_ID( dataL(i,0)-1 ); } }
800 else if (strcmp(WORD,
"ID_Boundary_Condition" ) == 0) {
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0)) ((
Node*)
Pjnts[id])->give_pointAttribs()->add_load ( dataL(i,0)-1) ; } }
801 else if (strcmp(WORD,
"Full_Hinge" ) == 0) {
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
Node*)
Pjnts[
id])->give_pointAttribs()->set_hinge ( dataL(i,0) ) ; } }
802 else if (strcmp(WORD,
"ada_refined_derivatives" ) == 0) {
scan_DATA_field (stream, str, 0, nSprsItms, NULL, &dataD, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
Node*)
Pjnts[
id])->set_resultN (dataD.
give_ccols(), dataD.
give_ptr2val(i,0), 0,
RTN_ada_refder); } ((
Mesh*)
this)->set_RTN(
RTN_ada_refder,
true); }
803 else if (strcmp(WORD,
"Property" ) == 0) {
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0)) ((
Node*)
Pjnts[id])->set_mprop ( dataL(i,0) ) ; } }
804 else _errorr2 (
"Invalid name of SCALARS/DataArray for POINT_DATA/PointData \"%s\"", WORD);
809 if (strcmp(WORD,
"Virtual" ) == 0) {
if (!mdl)
errol;
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
GelemAttribs*)
Elems[
id]->give_elemAttribs())->set_virtual ( dataL (i,0) ) ; } }
810 else if (strcmp(WORD,
"Property" ) == 0) {
elemprop =
true;
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0))
Elems[
id]->set_mprop ( dataL (i,0) ) ; } }
811 else if (strcmp(WORD,
"IDS_Prescribed_Values" ) == 0) {
if (!mdl)
errol;
scan_DATA_field (stream, str, 0, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
GelemAttribs*)
Elems[
id]->give_elemAttribs())->set_nDOFs_BC (dataL.
give_ccols(), dataL.
give_ptr2val(i,0) ) ; } }
812 else if (strcmp(WORD,
"ID_SET_IDS_Prescribed_Values") == 0) {
if (!mdl)
errol;
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0)) ((
GelemAttribs*)
Elems[id]->give_elemAttribs())->set_dofbc_with_ID( dataL (i,0)-1) ; } }
813 else if (strcmp(WORD,
"ID_Cross-Section" ) == 0) {
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0))
Elems[
id]->give_elemAttribs() ->set_cs ( dataL (i,0)-1) ; } }
814 else if (strcmp(WORD,
"ID_Material" ) == 0) {
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0))
Elems[
id]->give_elemAttribs() ->set_mat ( dataL (i,0)-1) ; } }
815 else if (strncmp(WORD,
"ID_Boundary_Condition", 21 ) == 0) {
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0))
Elems[
id] ->set_load ( dataL (i,0)-1) ; } }
816 else if (strcmp(WORD,
"symStiffMtrxOfMat" ) == 0) {
scan_DATA_field (stream, str, 0, nSprsItms, NULL, &dataD, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
GelemAttribs*)
Elems[
id]->give_elemAttribs())->set_MatStiffMtrx(dataD.
give_ccols(), dataD.
give_ptr2val(i,0) ) ; } }
817 else if (strcmp(WORD,
"LCS_xy_vector" ) == 0) {
scan_DATA_field (stream, str, 3, nSprsItms, NULL, &dataD, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
Elems[id]->give_elemAttribs() ->set_lcs (
LCSd_xy,
LCSt_Vector, dataD.
give_ptr2val(i,0) ) ; } }
818 else if (strcmp(WORD,
"LCS_xz_vector" ) == 0) {
scan_DATA_field (stream, str, 3, nSprsItms, NULL, &dataD, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
Elems[id]->give_elemAttribs() ->set_lcs (
LCSd_xz,
LCSt_Vector, dataD.
give_ptr2val(i,0) ) ; } }
819 else if (strcmp(WORD,
"MeshGen_elemSize" ) == 0) {
if (!mdl)
errol;
scan_DATA_field (stream, str, 1, nSprsItms, NULL, &dataD, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataD(i,0) > 0.0) ((
Gelement*)
Elems[
id] )->set_elemSize ( dataD (i,0) ) ; } }
820 else if (strcmp(WORD,
"MeshGen_elemCount" ) == 0) {
if (!mdl)
errol;
scan_DATA_field (stream, str, 1, nSprsItms, &dataL, NULL, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i);
if (dataL(i,0) > 0) ((
Gelement*)
Elems[id] )->set_elemCount ( dataL (i,0) ) ; } }
821 else if (strcmp(WORD,
"ada_error_pct_l" ) == 0) {
scan_DATA_field (stream, str, 0, nSprsItms, NULL, &dataD, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
FElement*)
Elems[
id] )->set_result ( dataD (i,0), 0,
RTE_ada_error_pct_l); } ((
Mesh*)
this)->set_RTE(
RTE_ada_error_pct_l,
true); }
822 else if (strcmp(WORD,
"ada_refsizel_relative" ) == 0) {
scan_DATA_field (stream, str, 0, nSprsItms, NULL, &dataD, sparse, WORD);
for (i=0; i<nSprsItms; i++) {
id = (sparse ? (*sparse)[i] : i); ((
FElement*)
Elems[
id] )->set_result ( dataD (i,0), 0,
RTE_ada_h_new); } ((
Mesh*)
this)->set_RTE(
RTE_ada_h_new,
true); }
823 else _errorr2 (
"Invalid name of SCALARS/DataArray in CELL_DATA/CellData of the given VTK XML file, \"%s\"", WORD);
827 else if (strcmp(WORD,
"") == 0) {;}
828 else _errorr2 (
"Invalid structure of the given VTK file, unexpected key word \"%s\"", WORD);
830 if (lgc) {
if (cno)
_errorr2 (
"cno(%ld) is not zero", cno); }
832 if (data && data[0] !=
'\0')
_errorr2(
"CellData of name \"%s\" has too many numbers", WORD);
833 if (offs && offs[0] !=
'\0')
_errorr(
"error");
837 if (
Pjnts() == 0)
_errorr (
"Invalid data in the given VTK file, number of points is zero");
838 if (
Elems() == 0)
_errorr (
"Invalid data in the given VTK file, number of cells is zero");
840 if (lgc)
delete [] WORD;
841 if (sparseflag)
delete sparse;
842 if (status ==
false)
_errorr(
"error");
867 long i, j, mind, numsuperelem;
868 double dist, distance, *distances;
869 const Point *node = NULL;
874 for (i=0; i<
Pjnts(); i++) {
875 dist = point->
dist2_to(Pjnts[i]->give_coords());
876 if (dist < distance && Pjnts[i]->is_on_3d_element()) {
885 distances =
new double [numsuperelem];
888 for (i=0; i<numsuperelem; i++) {
895 for (i=0; i<numsuperelem; i++) {
898 for (j=1; j<numsuperelem; j++)
899 if (distances[mind] > distances[j]) mind = j;
901 distances[mind] = 1.0e100;
906 if ( ((
FElement*)elem)->is_point_on (point, comp, nc) ) {
947 FILE *in =
_openFilePN(
"r",
"PolyLine", path, filename);
951 long i, j, id, nv, ne, prop;
954 fscanf (in,
"%ld", &ne);
959 for (i=0; i<ne; i++) {
960 fscanf (in,
"%ld", &
id);
id--;
if (i !=
id)
_errorr(
"mismatch in polyline file");
961 fscanf (in,
"%ld", &nv);
962 fscanf (in,
"%ld", &prop);
964 pl =
new PolyLine(
id,
id,
this, nv);
968 for (j=0; j<nv; j++) {
997 return (strncmp(
name, chn, strlen(
name)) == 0 ? strlen(
name) : 0);
1005 char filename[255] =
"";
1007 long auxl, id, i, nno;
1010 PoinT coords, *auxP;
1019 case 10: quart = 4; propsp =
false;
break;
1020 case 20: quart = 2; propsp =
false;
break;
1021 case 21: quart = 2; propsp =
true;
break;
1022 case 40: quart = 1; propsp =
false;
break;
1023 default:
_errorr(
"\"-P_melnik x\" missing");
1028 for (
int f=0; f<7; f++) {
1029 if (f == 0) {
if (1 ) sprintf (filename,
"this.model.1_dolni_krajni_L_");
else continue; }
1030 if (f == 1) {
if (1 && quart > 1) sprintf (filename,
"this.model.1_dolni_krajni_P_");
else continue; }
1031 if (f == 2) {
if (1 ) sprintf (filename,
"this.model.2_dolni_stredni_");
else continue; }
1032 if (f == 3) {
if (1 ) sprintf (filename,
"this.model.3_horni_konzol_L_");
else continue; }
1033 if (f == 4) {
if (1 && quart > 1) sprintf (filename,
"this.model.3_horni_konzol_P_");
else continue; }
1034 if (f == 5) {
if (1 ) sprintf (filename,
"this.model.4_horni_zmonol_L_");
else continue; }
1035 if (f == 6) {
if (1 && quart > 1) sprintf (filename,
"this.model.4_horni_zmonol_P_");
else continue; }
1038 in =
_openFilePNS(
"r",
"Melnik file",
"", filename,
"P.txt");
1043 if (fscanf (in,
"%d", &prd->
id) == EOF)
break;
1045 fscanf (in,
"%d", &prd->
nl);
1046 fscanf (in,
"%d", &prd->
nk);
1049 fscanf (in,
"%lf", &auxd);
1057 if ((c = fgetc(in)) ==
'\n')
break;
1061 for (i=0; i<prd->
points()-1; i++) {
1062 prd->
points[i]->scan_y(in);
1063 prd->
points[i]->y *= -1.0;
1066 if (fgetc(in) !=
'\n')
errol;
1075 for (
int kz=0; kz<2; kz++) {
1076 if (kz==0) in =
_openFilePNS(
"r",
"Melnik file",
"", filename,
"K.txt");
1077 else if (quart < 4)
continue;
else in =
_openFilePNS(
"r",
"Melnik file",
"", filename,
"Z.txt");
1082 c = fscanf (in,
"%ld", &auxl); auxl--;
1084 if (
id == -1) {
if (auxl != 0)
errol; }
1085 else if (auxl == 0 || c == EOF) {
1087 for (i=0; i<prdi(); i++)
1088 if (prdi[i]->is_my_ch(name) > auxl) {
1101 if (nno != prd->
points()-1 && !(f==2 && quart==1) )
1102 _errorr6(
"f=%ld kz=%d %s %ld != %ld", f, kz, name, nno, prd->
points()-1);
1104 if ( (auxd > 0.1 || auxd < -0.1) && !(f==2 && quart==1) )
1107 if (f==1 || f==4 || f==6) {
1108 if (quart==1)
errol;
1109 for (i=0; i<nno; i++) {
1117 for (i=0; i<nno; i++) {
1128 if (c == EOF) { pl = NULL;
break; }
1134 if (
id == 0) right = 0;
1139 if (quart==1 && coords.
x > 146.0) {
1159 if (fgetc(in) !=
'\n')
errol;
1168 for (i=0; i<prdi(); i++)
1169 if (prdi[i]->nk != 0)
1170 _warningg4(
"f=%ld predp skup %ld, %d != 0", f, i, prdi[i]->nk);
1172 prdi.delete_objects();
1237 for (
long i=0; i<
Elems(); i++) {
1239 pol =
dynamic_cast<const PolyLine *
>(Elems[i]);
1259 double sec = clock();
1272 for (i=0; i<
Pjnts(); i++) Pjnts[i]->print_row(out, fff); fprintf (out,
"\n");
1273 for (i=0; i<
Edges(); i++) Edges[i]->print_row(out, fff); fprintf (out,
"\n");
1274 for (i=0; i<
Faces(); i++) Faces[i]->print_row(out, fff); fprintf (out,
"\n");
1275 for (i=0; i<
Elems(); i++) Elems[i]->print_row(out, fff);
1319 else _errorr (
"Wrong number of domains");
1333 memset(
RTN, 0,
cRTN*
sizeof(
bool));
1334 memset(
RTE, 0,
cRTE*
sizeof(
bool));
1350 Lata.delete_objects();
1351 Data.delete_objects();
1364 for (
long i=0; i<ne; i++) {
1366 if (quad == NULL)
continue;
1369 tr1 =
new Triangle(quad,
true, fds);
1370 tr2 =
new Triangle(quad,
false, fds);
1381 Elems.assign(i, tr1);
1385 fprintf (stdout,
"\n Divided quadrangles %ld\n",
Elems() - ne);
1408 ((
Mesh*)
this)->connectivity_assembling ();
1421 for (i=0; i<Ne; i++) {
1422 q =
Elems[i]->give_quality();
1424 if (q < 0.0 ) { Q[0]++; Qi[i] = 7; }
1425 else if (q < 0.01) { Q[1]++; Qi[i] = 6; }
1426 else if (q < 0.2 ) { Q[2]++; Qi[i] = 5; }
1427 else if (q < 0.4 ) { Q[3]++; Qi[i] = 4; }
1428 else if (q < 0.6 ) { Q[4]++; Qi[i] = 3; }
1429 else if (q < 0.8 ) { Q[5]++; Qi[i] = 2; }
1430 else if (q < 1.0 ) { Q[6]++; Qi[i] = 1; }
1431 else _errorr2 (
"Quality %e > 1.0", q);
1436 for (i=0; i<7; i++) sum += Q[i];
1437 if (sum != Ne)
_errorr (
"sum != Ne");
1441 fprintf (stdout,
"\n Element quality, %ld%% of %ld\n", (100*(Ne-Q[0]))/Ne, Ne);
1444 fprintf (stdout,
" %5ld (%3ld%%) [1] fine (0.8 - 1.0)\n", Q[6], (100*Q[6])/Ne);
1445 fprintf (stdout,
" %5ld (%3ld%%) [2] good (0.6 - 0.8)\n", Q[5], (100*Q[5])/Ne);
1446 fprintf (stdout,
" %5ld (%3ld%%) [3] low (0.4 - 0.6)\n", Q[4], (100*Q[4])/Ne);
1447 fprintf (stdout,
" %5ld (%3ld%%) [4] wrong (0.2 - 0.4)\n", Q[3], (100*Q[3])/Ne);
1448 fprintf (stdout,
" %5ld (%3ld%%) [5] ugly (0.01- 0.2)\n", Q[2], (100*Q[2])/Ne);
1449 fprintf (stdout,
" %5ld (%3ld%%) [6] non-acceptable (0.0 -0.01)\n", Q[1], (100*Q[1])/Ne);
1450 fprintf (stdout,
" %5ld (%3ld%%) [7] -- ( < 0.0)\n", Q[0], (100*Q[0])/Ne);
1472 for (i=0; i<
Elems(); i++) {
1473 if (Elems[i]->give_elemAttribs()->give_mat() == NULL || Elems[i]->give_elemAttribs()->give_mat()->give_type() !=
MAT_RIGID)
continue;
1477 if (Elems[i]->give_nno() != 2)
_errorr(
"RigidBody material is not at beam element with 2 nodes");
1481 _errorr(
"Element with rigid body mat. is not same length as master");
1483 const Node *n1 =
dynamic_cast<const Node *
> (Elems[i]->give_point(0));
1484 const Node *n2 =
dynamic_cast<const Node *
> (Elems[i]->give_point(1));
1492 Elems[i]->connectivity_removing();
1493 Elems.delete_object(i); nd++;
1523 FILE *in =
_openFilePN(
"r",
"Mesh", path, filename);
1537 Pjnts.reallocup(nl);
1538 Elems.reallocup(nl);
1545 while ((c = getc(in)) != EOF) {
1546 if (c==
'\n')
continue;
1551 ;
if ( getc(in) !=
',')
_errorr3 (
"There is no separation char ',' nn=%ld, nel=%ld",
Pjnts(),
Elems());
1552 fscanf (in,
"%ld",&
id);
if ( getc(in) !=
',')
_errorr3 (
"There is no separation char ',' nn=%ld, nel=%ld",
Pjnts(),
Elems());
1553 coord.
scan_x(in);
if ( getc(in) !=
',')
_errorr3 (
"There is no separation char ',' nn=%ld, nel=%ld",
Pjnts(),
Elems());
1554 coord.
scan_y(in);
if ( getc(in) !=
',')
_errorr3 (
"There is no separation char ',' nn=%ld, nel=%ld",
Pjnts(),
Elems());
1564 for (i=0; i<elem->
give_nno(); i++) {
1565 if ( getc(in) !=
',')
_errorr3 (
"There is no separation char ',' nn=%ld, nel=%ld",
Pjnts(),
Elems());
1566 fscanf (in,
"%ld", &
id);
1589 FILE *in =
_openFilePN(
"r",
"Mesh", path, filename);
1598 fscanf (in,
"%ld", &n);
1600 for (i=0; i<n; i++) {
1612 fscanf (in,
"%ld", &n);
1614 for (i=0; i<n; i++) {
1626 if (EOF != fscanf (in,
"%ld", &auxl))
errol;
1641 long i, id, lid, deg, auxl, domid, trash, el[7], cND, outspec, nno;
1656 char domsuff[8] =
"";
1657 if (
Parallel) sprintf (domsuff,
".%ld",domid);
1658 in =
_openFilePNS (
"r",
"Mesh", path, filename, domsuff);
1666 fscanf (in,
"%d", &t3dout);
if (t3dout!=3 && t3dout!=7)
_errorr(
"error in t3d mesh file");
1667 fscanf (in,
"%ld %ld %ld", °, &auxl, &outspec);
if (outspec!=8 && outspec!=264)
_errorr(
"error in t3d mesh file");
1668 if (
Parallel) { fscanf (in,
"%ld",&auxl);
if (auxl!=domid+1)
_errorr(
"error in t3d mesh file"); }
1673 fscanf (in,
"%ld", &cND);
1674 if (domid==0)
Pjnts.resizeup(cND);
1675 else if (
Pjnts() != cND)
_errorr (
"error in t3d mesh file");
1678 for (i=0; i<7; i++) {
1679 if (i<t3dout) fscanf (in,
"%ld", el+i);
1681 if (i) el[i] += el[i-1];
1683 if (domid==0)
Elems.resizeup(el[6]);
1684 else if (
Elems() != el[6])
_errorr (
"error in t3d mesh file");
1689 for (i=0;i<7;i++) { fscanf (in,
"%ld",el+i);
NumElems[domid] += el[i];
if (i) el[i] += el[i-1]; }
1694 for (i=0; i<cND; i++) {
1695 if (!
Parallel) { fscanf (in,
"%ld", &
id); lid = id; }
1696 else { fscanf (in,
"%ld %ld %ld", &lid, &
id, &trash); }
1698 if (
id<0) { auxb =
true;
id = -
id-1;}
1699 else { auxb =
false;
id =
id-1;}
1716 Pjnts.assign(
id, newnode);
1723 Pjnts.assign(
id, newnode);
1729 if (deg != 1)
errol;
1731 for (i=0; i<el[6]; i++) {
1732 if (i < el[0]) { nno = 2; cg =
CG_Line; }
1733 else if (i < el[1]) { nno = 3; cg =
CG_Triangle; }
1736 else if (i < el[4]) { nno = 6; cg =
CG_Wedge; }
1737 else if (i < el[5]) { nno = 5; cg =
CG_Pyramid; }
1750 if (EOF != fscanf (in,
"%ld", &auxl))
errol;
1774 for (i=0; i<
Pjnts(); i++) {
1777 Pjnts.assign(i,
new Node(masterex,
'n'));
1778 Pjnts[i]->reset_Geom(
this);
1779 Pjnts[i]->reset_property(0, i+1);
1795 for (j=0; j<masterel->
give_nno()-1; j++) {
1797 ((
FElement*)elem)->attributes_allocation(a);
1834 Pjnts.reallocup(nn);
1835 for (i=0; i<nn; i++) {
1843 else _errorr2(
"Unknown OOFEM node type %s", WORD);
1851 Elems.reallocup(ne);
1852 for (i=0; i<ne; i++) {
1885 Pjnts.reallocup(nn);
1886 for (i=0; i<nn; i++) {
1893 else _errorr(
"Unknown SIFEL node");
1901 for (i=0; i<nn; i++) {
1902 fscanf (stream,
"%ld", &
id);
id--;
1910 Elems.reallocup(ne);
1911 for (i=0; i<ne; i++) {
1936 fscanf (stream,
"%ld", &aux);
1938 _errorr3 (
"Invalid structure of the given UNV file: actual != expected -- %ld != %ld", aux, expctd);
1944 FILE *in =
_openFilePN(
"r",
"Mesh", path, filename);
1947 long auxl, nn, te, id, j, domid;
1957 Pjnts.reallocup(auxl);
1958 Elems.reallocup(auxl);
1966 fscanf (in,
"%ld", &auxl);
1967 if (auxl == -1)
break;
1968 if (auxl !=
id+1)
_errorr (
"Invalid structure of the given UNV file");
1986 fscanf (in,
"%ld", &auxl);
1987 if (auxl == -1)
break;
1990 fscanf (in,
"%ld %ld %ld %ld %ld", &te, &auxl, &auxl, &auxl, &nn);
1992 case 21: elem =
new Beam (
id,
id,
this,
true, domid,
id); fscanf (in,
"%ld %ld %ld", &auxl, &auxl, &auxl);
break;
1993 case 91: elem =
new Triangle (
id,
id,
this,
true, domid,
id);
break;
1994 default:
_errorr3 (
"Unknown %ld-th \"fe descriptor id\": %ld",
id+1, te);
1999 for (j=0; j<nn; j++) { fscanf (in,
"%ld", &auxl); elem->
set_node(j, auxl-1); }
2006 if (EOF != fscanf (in,
"%ld", &auxl))
errol;
2027 if (file == NULL)
errol;
2032 default:
_errorr2 (
"Unsuppoted type of output file from structural analysis package, type %ld", file->
give_ff());
2053 while (answer == 0) {
2067 if (fseek(stream, -pos, SEEK_END) != 0)
_errorr (
"There is no complete data of one time step in OOFEM output file");
2080 fscanf (stream,
"%ld", &answer);
2082 if (c ==
'\n')
continue;
2094 while (answer == 0) {
2095 if (fseek(stream, -pos, SEEK_END) != 0)
_errorr (
"There is no complete data of one time step in SIFEL output file");
2106 fscanf (stream,
"%ld", &answer);
2113 default:
_errorr2(
"Unknown problem type %d", (
int)pt);
2154 fscanf (in,
"%lf", &auxd);
2155 ((
Problem*)
Pd)->set_OOFEM_ver((
int)(auxd*10));
2163 fscanf (in,
"%lf", &auxd);
2218 bool nonlin =
false;
2224 if (name == NULL)
errol;
2242 if (fgetc(in) ==
'*') {
2246 fscanf (in,
"%ld", &auxl);
2247 skip = (s == auxl) ?
true :
false;
2253 if (s==-1)
_errorr(
"Invalid structure of SIFEL output file");
2256 if (LINE[strlen(LINE)-1] !=
':')
_errorr(
"Invalid structure of SIFEL output file");
2265 else _errorr2(
"Unsuported section in SIFEL output file, \"%s\"", LINE);
2349 for (i=0; i<
Elems(); i++) {
2350 if (! Elems[i]->give_elemAttribs()->give_HNmstr())
continue;
2352 for (j=0; j<
Pjnts(); j++) {
2353 if (! Elems[i]->is_point_on (Pjnts[j]->give_coords(), comp, &nc) )
continue;
2377 for (i=list()-1; i>=0; i--)
2378 if ( list[i] && list[i]->invisible_duplicated(t) ) {
2379 list.delete_object(i);
2427 for (i=0; i<Ne; i++)
2428 circum +=
Elems[i]->give_circum();
2435 for (i=0; i<Nn; i++)
2440 long *Cduplicity, **duplicity;
2442 Cduplicity =
new long[Nn/2];
2443 duplicity =
new long*[Nn/2];
for (i=0; i<Nn/2; i++) duplicity[i] = NULL;
2449 for (i=0; i<nd; i++) {
2451 for (j=0; j<Cduplicity[i]; j++)
2453 _errorr (
"The duplicated node %ld is not pure node, is hanging node or what");
2456 for (j=1; j<Cduplicity[i]; j++)
2457 Nodes(duplicity[i][j]) -> setup_duplicity_master(
Nodes(duplicity[i][0]) );
2479 long *cnisd =
new long[Nn];
2487 for (i=0; i<Nn; i++) {
2488 if (level &&
Pjnts[i]->give_subdom() != -2)
continue;
2501 if (--level) level = 1;
2510 if (nn == Nn)
break;
2527 for (i=0; i<
Pjnts(); i++)
2528 if ( Pjnts[i]->give_subdom() != leave ) {
2702 if (dynamic_cast<Lvctr *>(data)) aux =
new Lvctr((
Lvctr *)data);
2703 if (dynamic_cast<Dvctr *>(data)) aux =
new Dvctr((
Dvctr *)data);
2705 for (
long i=0; i<
Elems(); i++)
2709 default:
_errorr (
"unsuported VTK cell type");
2721 Pjnts[id]->give_attributes()->add_load(bc);
2726 if (prop < 1)
errol;
2728 for (
long i=0; i<
Pjnts(); i++)
2729 if (Pjnts[i]->give_mpropertyORzero() == prop)
2730 Pjnts[i]->give_attributes()->add_load(bc);
2738 for (
long i=0; i<
Pjnts(); i++)
2739 if (Pjnts[i]->is_identical_to (norm, coords))
2740 Pjnts[i]->give_attributes()->add_load(bc);
2746 Elems[id]->give_attributes()->add_load(bc);
2751 for (
long i=0; i<
Elems(); i++)
2752 if (Elems[i]->give_mpropertyORzero() == prop)
2753 Elems[i]->give_attributes()->add_load(bc);
2759 if (indx == -1) {
if (
Elems[
id]->give_ned() == 1) indx = 0;
else _errorr(
"ConstantEdgeLoad at element with more than 1 edge"); }
2760 ((
Edge*)
Elems[
id]->give_edge(indx))->give_attributes()->add_load(bc);
2765 for (
long i=0; i<
Elems(); i++)
2766 if (Elems[i]->give_mpropertyORzero() == prop) {
2767 if (Elems[i]->give_ned() != 1)
_errorr(
"ConstantEdgeLoad at element with more than 1 edge");
2768 ((
Edge*)Elems[i]->give_edge(0))->give_attributes()->add_load(bc);
2775 if (indx == -1) {
if (
Elems[
id]->give_nfa() == 1) indx = 0;
else _errorr(
"ConstantFaceLoad at element with more than 1 face"); }
2776 ((
Face*)
Elems[
id]->give_face(indx))->give_attributes()->add_load(bc);
2781 for (
long i=0; i<
Elems(); i++)
2782 if (Elems[i]->give_mpropertyORzero() == prop) {
2783 if (Elems[i]->give_nfa() != 1)
_errorr(
"ConstantFaceLoad at element with more than 1 face");
2784 ((
Face*)Elems[i]->give_face(0))->give_attributes()->add_load(bc);
2790 for (
long i=0; i<
Faces(); i++)
2791 if (Faces[i]->give_mpropertyORzero() == prop)
2792 Faces[i]->give_attributes()->add_load(bc);
2800 answer =
Elems[0]->give_elemAttribs()->give_dpn();
2802 for (
long i=1; i<
Elems() ; i++) {
2803 aux = Elems[i]->give_elemAttribs()->give_dpn();
2806 _errorr (
"mismatch in DOFsPerNode");
2886 for (
long i=0; i<
Pjnts(); i++)
2896 for (
long i=0; i<
Pjnts(); i++)
2901 fprintf (stream,
"\n%ld\n", n);
2905 for (
long i=0; i<
Pjnts(); i++)
2913 for (
long i=0; i<
Elems(); i++)
2923 for (
long i=0; i<
Pjnts(); i++)
2927 fprintf (stream,
"%ld\n", n);
2931 for (
long i=0; i<
Pjnts(); i++)
2940 for (
long i=0; i<(*bcs)(); i++) {
2941 switch ((*bcs)[i]->give_loctype()) {
2949 for (j=0; j<
Elems(); j++) {
2951 for (k=0; k<(*bbc)(); k++)
2952 if ((*bbc)[k] == (*bcs)[i])
2958 fprintf (stream,
"ACEL");
2959 for (j=0; j<(*bcs)[i]->give_ncomp(); j++)
2960 fprintf (stream,
", %.6g", 9.81 * (*bcs)[i]->give_component(j));
2962 fprintf (stream,
"\n\n");
2964 default:
_errorr2(
"Unknown boundary condition type %d", (*bcs)[i]->give_loctype());
2974 fprintf (stream,
"\n %s %5ld %s ", name,
id+1, name2);
2975 for (
long i=0; i<list(); i++)
2976 fprintf (stream,
" %ld", list[i]->give_ID()+1);
2984 fprintf (conout,
"\n\n\n\n");
2985 fprintf (conout,
" N N OOOO DDDDD EEEEE SSSS \n");
2986 fprintf (conout,
" NN N O O D D E S S \n");
2987 fprintf (conout,
" N N N O O D D EEE SS \n");
2988 fprintf (conout,
" N N N O O D D EEE SS \n");
2989 fprintf (conout,
" N NN O O D D E S S \n");
2990 fprintf (conout,
" N N OOOO DDDDD EEEEE SSSS \n");
2996 fprintf (conout,
"\n\n\n");
2997 fprintf (conout,
" EEEEE DDDDD GGGG EEEEE SSSS \n");
2998 fprintf (conout,
" E D D G G E S S \n");
2999 fprintf (conout,
" EEE D D G EEE SS \n");
3000 fprintf (conout,
" EEE D D G GGG EEE SS \n");
3001 fprintf (conout,
" E D D G G E S S \n");
3002 fprintf (conout,
" EEEEE DDDDD GGGG EEEEE SSSS \n");
3004 fprintf (conout,
"\n\n NODES ON EDGE \n " );
for (i=0;i<
Edges();i++)
TF_GPA_print_list (conout,
"edge",
"nodes", *Edges[i]->give_points(), i);
3005 fprintf (conout,
"\n\n FACES SUPERIOR TO EDGE \n " );
for (i=0;i<
Edges();i++)
TF_GPA_print_list (conout,
"edge",
"superior faces ", *Edges[i]->give_superfaces(), i);
3006 fprintf (conout,
"\n\n ELEMENTS SUPERIOR TO EDGE \n ");
for (i=0;i<
Edges();i++)
TF_GPA_print_list (conout,
"edge",
"superior elements ", *Edges[i]->give_superelems(), i);
3009 fprintf (conout,
"\n\n\n");
3010 fprintf (conout,
" FFFFF AAAA CCCC EEEEE SSSS \n");
3011 fprintf (conout,
" F A A C C E S S \n");
3012 fprintf (conout,
" FFF A A C EEE SS \n");
3013 fprintf (conout,
" FFF AAAAAA C EEE SS \n");
3014 fprintf (conout,
" F A A C C E S S \n");
3015 fprintf (conout,
" F A A CCCC EEEEE SSSS \n");
3017 fprintf (conout,
"\n\n NODES ON FACE \n " );
for (i=0;i<
Faces();i++)
TF_GPA_print_list (conout,
"face",
"nodes", *Faces[i]->give_points(), i);
3018 fprintf (conout,
"\n\n EDGES ON FACE \n " );
for (i=0;i<
Faces();i++)
TF_GPA_print_list (conout,
"face",
"edges", *Faces[i]->give_edges(), i);
3019 fprintf (conout,
"\n\n ELEMENTS SUPERIOR TO FACE \n ");
for (i=0;i<
Faces();i++)
TF_GPA_print_list (conout,
"face",
"superior elements ", *Faces[i]->give_superelems(), i);
3022 fprintf (conout,
"\n\n\n");
3023 fprintf (conout,
" EEEEE L EEEEE M M EEEEE N N TTTTTT SSSS \n");
3024 fprintf (conout,
" E L E MM MM E NN N TT S S \n");
3025 fprintf (conout,
" EEE L EEE M MM M EEE N N N TT SS \n");
3026 fprintf (conout,
" EEE L EEE M M EEE N N N TT SS \n");
3027 fprintf (conout,
" E L E M M E N NN TT S S \n");
3028 fprintf (conout,
" EEEEE LLLLL EEEEE M M EEEEE N N TT SSSS \n");
3030 fprintf (conout,
"\n\n NODES ON ELEMENT \n ");
for (i=0;i<
Elems();i++)
TF_GPA_print_list (conout,
"element",
"nodes", *Elems[i]->give_points(), i);
3031 fprintf (conout,
"\n\n EDGES ON ELEMENT \n ");
for (i=0;i<
Elems();i++)
TF_GPA_print_list (conout,
"element",
"edges", *Elems[i]->give_edges(), i);
3032 fprintf (conout,
"\n\n FACES ON ELEMENT \n ");
for (i=0;i<
Elems();i++)
TF_GPA_print_list (conout,
"element",
"faces", *Elems[i]->give_faces(), i);
3045 if (
Lata.give_size() >= newsize)
return;
3047 long oldsize =
Lata.give_size();
3048 Lata.resize(newsize);
3050 for (; oldsize<newsize; oldsize++)
3057 if (
Lata[0]->give_size() != newsize) {
3058 long i =
Lata.give_size();
3060 Lata[i]->resize_ignore_vals(newsize);
3066 if (
Data.give_size() >= newsize)
return;
3068 long oldsize =
Data.give_size();
3069 Data.resize(newsize);
3071 for (; oldsize<newsize; oldsize++)
3078 if (
Data[0]->give_size() != newsize) {
3079 long i =
Data.give_size();
3081 Data[i]->resize_ignore_vals(newsize);
3090 char *file =
new char[1023];
3104 else _errorr (
"unsuported DataSet");
3111 else sprintf(auxs,
"%s",
"UnstructuredGrid");
3135 fprintf (stream,
"# vtk DataFile Version 3.0\n");
3136 fprintf (stream,
"VTK file written by MIDAS\n");
3137 fprintf (stream,
"ASCII\n");
3139 else if (ds ==
VTKDS_unstruct) fprintf (stream,
"DATASET UNSTRUCTURED_GRID\n");
3140 else _errorr (
"unsuported dataset");
3150 fprintf (stream->
file(),
"POINTS %ld float\n",
Pjnts());
3164 for (
long i=0; i<
Pjnts(); i++) {
3165 Pjnts[i]->print_row_VTX (auxs);
3167 if (stream->
isFile()) fprintf (stream->
file(),
"%s\n",auxs);
3180 fprintf (stream->
file(),
"LINES %ld %ld\n", cl, cl*3);
3181 for (
long i=0; i<
Elems(); i++)
3182 if (
VTKPD_LINE == Elems[i]->give_VTKPDtopology())
3183 Elems[i]->print_row_VTK (stream->
file());
3188 for (
long i=0; i<
Elems(); i++)
3190 nnumbs += Elems[i]->give_nno();
3191 fprintf (stream->
file(),
"POLYGONS %ld %ld\n", cp, cp + nnumbs);
3192 for (
long i=0; i<
Elems(); i++)
3194 Elems[i]->print_row_VTK (stream->
file());
3218 long offl=0, offp=0;
3219 for (
long i=0; i<
Elems(); i++) {
3220 Elems[i]->print_row_VTX (auxs);
3222 switch (Elems[i]->give_VTKPDtopology()) {
3226 _errorr (
"unsuported VTKPDtopology");
3233 _errorr (
"The output to legacy VTK for UNSTRUCTURED dataset is not implemented, use VTU please");
3254 for (
long i=0; i<
Elems(); i++) {
3262 _errorr (
"unsuported dataset");
3284 fprintf (stream->
file(),
"POINT_DATA %ld\n", n);
3292 fprintf (stream->
file(),
"CELL_DATA %ld\n", n);
3306 if ((*data)[0]->give_arrayTypedef() ==
ATlong ) I =
true;
3307 else if ((*data)[0]->give_arrayTypedef() ==
ATdouble) I =
false;
3312 if (I) {
if (stream->
isFile()) sprintf(tn,
"int");
else sprintf(tn,
"Int32"); }
3313 else {
if (stream->
isFile()) sprintf(tn,
"float");
else sprintf(tn,
"Float32"); }
3315 long len = (*data)[0]->give_size();
3318 if (type ==
's') { fprintf (stream->
file(),
"SCALARS %s %s %ld\n", name, tn, len); fprintf (stream->
file(),
"LOOKUP_TABLE default\n"); }
3319 else if (type ==
'v') fprintf (stream->
file(),
"VECTORS %s %s\n", name, tn);
3320 else if (type ==
't') fprintf (stream->
file(),
"TENSORS %s %s\n", name, tn);
3328 if (type ==
's') da->
SetAttribute(
"NumberOfComponents", (
int)len);
3329 if (type ==
'v') da->
SetAttribute(
"NumberOfComponents",
"3");
3330 if (type ==
't') da->
SetAttribute(
"NumberOfComponents",
"9");
3334 double zero, relzero;
3335 if (r2z) { zero = 1.e-14; relzero = 1.e-5; }
3336 else { zero = 0.0; relzero = 1.e-5; }
3339 if (type ==
's') auxs =
new char[ (*data)[0] ->length_printed (prec)];
3340 else if (type ==
'v') auxs =
new char[((
Xvctr*)(*data)[0])->length_printed_vector(prec)];
3341 else auxs =
new char[((
Xvctr*)(*data)[0])->length_printed_tensor(prec)];
3343 for (
long i=0; i<n; i++) {
3344 if (type ==
's') (*data)[i] ->print (auxs, prec, zero);
3345 else if (type ==
'v') ((
Xvctr*)(*data)[i])->print_vector (auxs, prec, zero,
true);
3346 else ((
Xvctr*)(*data)[i])->print_symtensor (auxs, prec, ((
Xvctr*)(*data)[i])->give_zero(zero, relzero),
true);
3348 if (stream->
isFile()) fprintf (stream->
file(),
"%s\n",auxs);
3416 default:
_errorr(
"File format for output of results is not specified ");
3455 FILE *out =
_openFilePNS (
"w",
"JKTK mesh", this->
give_Pd()->give_OUT_Path(), this->
give_Pd()->give_OUT_moFILE()->give_name(),
".jktk.top");
3459 fprintf (out,
"%ld\n",
Pjnts());
3463 fprintf (out,
"\n%ld\n",
Elems());
3471 for (n=i=0; i<
Pjnts(); i++)
3476 FILE *out =
_openFilePNS (
"w",
"JKTK mesh", this->
give_Pd()->give_OUT_Path(), this->
give_Pd()->give_OUT_moFILE()->give_name(),
".jktk.hn");
3478 fprintf (out,
"%ld\n", n);
3480 for (i=0; i<
Pjnts(); i++)
3482 fprintf (out,
"%ld", Pjnts[i]->
give_ID()+1);
3483 Pjnts[i]->give_pointAttribs()->print_row(out,
FFF_JKTK, 0);
3484 fprintf (out,
"\n");
3497 if (data1 == NULL && data2 == NULL)
errol;
3499 FILE *in =
_openFilePN(
"w",
"Dat file", NULL, file);
3508 if (zeroline) fprintf (in,
"%9.6e %9.6e\n", 0.0, 0.0);
3511 if (data1 == NULL)
for (i=0; i<n; i++) fprintf (in,
"%9.6e %9.6e\n", (
double)i+1, (*data2)[i]);
3512 else if (data2 == NULL)
for (i=0; i<n; i++) fprintf (in,
"%9.6e %9.6e\n", (*data1)[i], (
double)i+1);
3513 else for (i=0; i<n; i++) fprintf (in,
"%9.6e %9.6e\n", (*data1)[i], (*data2)[i]);
3532 for (
long i=0; i<
Pjnts(); i++)
3533 if (Pjnts[i]->
give_ID() != Pjnts[i]->give_origID())
errol;
3542 case FFF_VTP: xml =
true; ds =
VTKDS_polydata;
if (ds != this->
giveVTKDS())
_errorr (
"The output to xml VTK for POLYDATA dataset is not supported for this mesh (probably because of brick elements), use VTU please");
break;
3544 default:
_errorr(
"File format for output of results is not specified ");
3559 long NnNe = (Nn>Ne ? Nn : Ne);
3583 for (i=0; i<Ne; i++)
3587 bool plasticityMaterial =
false;
3588 for (i=0; i<Ne; i++)
3589 if (
FElems(i)->give_elemAttribs()->give_mat() &&
FElems(i)->give_elemAttribs()->give_mat()->isOOFEMplast()) {
3590 plasticityMaterial =
true;
3594 Dvctr *yielding=NULL;
3601 if (step!=1000 && step!=rslts_nsteps-1) {
3609 if (step%dstep!=0)
continue;
3612 steps[numsteps] = step+1;
3617 if (rslts_nsteps == 1) sprintf (suff,
".rslts");
3618 else sprintf (suff,
".rslts.%03ld", step+1);
3634 for (i=0; i<Nn; i++)
Data[i]->deshift(); }
3639 for (i=0; i<Nn; i++)
Data[i]->deshift(); }
3648 for (i=0; i<Nn; i++)
3663 for (
long regid=0; regid<this->
nRegions; regid++) {
3686 for (regid=0; regid<this->
nRegions; regid++) {
3688 for (i=0; i<Nn; i++) {
3690 Data[i][0][0] =
Data[i][0][1] = 0.0;
3691 if (auxD == NULL)
Data[i][0][2] = 0.0;
3692 else Data[i][0][2] = auxD[0][6];
3695 sprintf (label,
"othr_ada_refder_%02ld", regid);
3750 for (i=0; i<Ne; i++)
Data[i]->shift(-6); }
3754 for (i=0; i<Ne; i++)
Data[i]->shift(-6); }
3783 for (i=0; i<Ne; i++)
if ( (*
Lata[i])[0] )
break;
3784 if (i==Ne) (*yielding)[numsteps] = 0;
3785 else (*yielding)[numsteps] = 1;
3836 if (rslts_nsteps > 1) {
3838 if (plasticityMaterial) {
3839 print_dat_file (
"this.dat.yielding.dat", numsteps, &steps, yielding,
true);
3850 Dvctr displ(rslts_nsteps);
3899 long NnNe = (Nn>Ne ? Nn : Ne);
3919 for (i=0; i<Nn; i++)
Lata[i]->deshift();
3952 #ifdef __MEER_MODULE
3957 MEER_interface *ada =
new MEER_interface;
3960 ada->local_initialize(
this);
3967 const double* errori_l = ada->give_error_at_elements_local();
3968 const double* errori_g = ada->give_error_at_elements_global();
3969 const double* h_old_elem = ada->give_h_old_at_elems();
3970 const double* h_new_elem = ada->give_h_new_at_elems();
3971 Dvctr*** rnvals = ada->give_refined_node_values_2();
3974 const double* eia = ada->give_abs_error_at_elements();
3976 long i, j, istep = 0;
3991 for (i=0; i<ne; i++) {
4004 Dvctr h_old_node(nn);
4005 Dvctr h_new_node(nn);
4006 double sizei, size, hold, hnew;
4009 for (i=0; i<nn; i++) {
4012 if (supelems[0]()) {
4014 size = hold = hnew = 0;
4015 for (j=0; j<supelems[0](); j++) {
4016 sizei = supelems[0][j]->give_lav();
4019 hold += sizei * h_old_elem[supelems[0][j]->give_ID()];
4020 hnew += sizei * h_new_elem[supelems[0][j]->give_ID()];
4023 h_old_node[i] = hold / size;
4024 h_new_node[i] = hnew / size;
4034 h_old_node[i] = h_new_node[i] = 0.0;
4048 for (j=0; j<nn; j++) {
4050 rnvals[i][j] = NULL;
4055 m = ada->give_rotmat_at_node(j);
4064 for (i=0; i<nn; i++) {
4071 GPA<const FElement> Beams(0,ne), Triangles(0,ne), Quads(0,ne), Tetras(0,ne), Bricks(0,ne);
4073 for (i=0; i<ne; i++)
4074 switch (
Elems[i]->give_cellGeom()) {
4080 default:
_errorr2 (
"Unknown element geom type (element number %d)", i+1);
4085 fprintf(bgm,
"7 1\n");
4086 fprintf(bgm,
"%ld %ld %ld %ld %ld %d %d %ld\n",
Pjnts(), Beams(), Triangles(), Quads(), Tetras(), 0, 0, Bricks());
4089 for (i=0; i<nn; i++)
4090 fprintf(bgm,
"%ld %e %e %e %e\n", i+1,
Pjnts[i]->give_coord(0),
Pjnts[i]->give_coord(1),
Pjnts[i]->give_coord(2), h_new_node[i]);
4096 for (i=0; i<Triangles(); i++) {
4097 fprintf(bgm,
"%ld", i+1);
4098 for (j=0; j<3; j++) fprintf(bgm,
" %ld", Triangles[i]->give_node(j)->
give_ID()+1);
4104 for (i=0; i<Quads(); i++) {
4105 fprintf(bgm,
"%ld", i+1);
4106 for (j=0; j<4; j++) fprintf(bgm,
" %ld", Quads[i]->give_node(j)->
give_ID()+1);
4112 if (Tetras())
errol;
4113 if (Bricks())
errol;
4124 _errorr(
"MEER is not linked.");
4128 #ifdef __MEER_MODULE
4129 void Mesh :: regions_init (
void)
4134 for (
long i=0; i<
Elems(); i++)
4147 double cs, vol = 0.0;
4148 for (i=0; i<
Elems(); i++) {
4149 switch (Elems[i]->give_dimension()) {
4150 case 1:
if ((cs = Elems[i]->give_elemAttribs()->give_cs()->give_area()) <= 0.0)
errol;
break;
4151 case 2: cs = Elems[i]->give_elemAttribs()->give_cs()->give_thickness();
if (cs < 0.0) cs = 0.0;
break;
4152 case 3: cs = 1.0;
break;
4156 vol += cs * Elems[i]->give_lav();
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
XMLText * NewText(const char *text)
Create a new Text associated with this Document.
const Face * give_Face(long i) const
void set_delete_flag(bool val)
void print_VTK_elems(Stream *stream, VTKdataset ds) const
bool FP_skip_to_line_starting_with(FILE *stream, const char *string, bool cs)
move file descriptor to the line starting with string, exactly behind the string
void set_master_component(long prop, const Model *model, int parenttype)
void letoff_aa(void)
let off atributes arrays
DOFsPerNode give_DOFsPerNode(void)
FElement * FElems(long i) const
virtual ~Mesh(void)
DESTRUCTOR.
bool connectivity_is_assembled(void) const
#define _warningg4(_1, _2, _3, _4)
void assign_NodeLoad_by_point_ID(const BoundaryCond *bc, long id)
BC assign assign nodal load to the point by/via ...
Point * allocate_point(long gid, const PoinT *coo, char attribs_alloc='n')
bool give_PDBO(ProbDescBoolOpt pdbo) const
void set_Master_model(const Model *M)
void print_VTK_FINISH(Stream *stream)
void print_VTK_head(FILE *stream, VTKdataset ds)
long * give_ptr2val(long r=0, long c=0)
void TF_GPA_delete_damned(T &list)
DELETE components marked by flag "delete".
void set_RTN(ResultTypesAtNode rt, bool val)
int FP_scan_word(FILE *src, char *dest)
... word; return value is length of the word
double dist2_to(const PoinT *p) const
void add_domain(long gid, const char *&str, femFileFormat fff, bool shared, long dom, long li)
initialize shared node on next domain
void scan_DATA_field(Stream *stream, const char *str, int nexc, long m, Lmtrx *dataL, Dmtrx *dataD, Lvctr *sprs, const char *name)
void set_dofbc(const char *str, femFileFormat ff=FFF_Void)
long nRegions
ADAPTIVITY == adaptivity in MIDAS.
double give_error(void) const
const GPA< const Edge > * give_superedges(void) const
bool scan_z(FILE *stream)
PAGroup give_analgroup(void) const
#define _errorr6(_1, _2, _3, _4, _5, _6)
virtual void read_output_SIFEL(FILE *stream, long step, ResultTypesAtElem rt)
const Array * give_results(long step, ResultTypesAtElem rt) const
PolyLine * generate_mesh_RFbyHN(Mesh *pm, GPA< const Node > &hnodes) const
void mesh_quality(void) const
compute mesh quality
void add_point(const Point *val)
void sort_polydata(Xvctr *data) const
sort polydata data
virtual void initialize(void)
initiate/sets data
long give_parent_prop(void) const
void wdg_another_Elem(Element *comp, long nid)
const GPA< BoundaryCond > * give_BCs(void) const
long give_domain(void) const
VTKdataset giveVTKDS(void)
other
void assign_BodyLoad_by_elem_ID(const BoundaryCond *bc, long id)
assign body load to the element by/via ...
void add_another_Element(FElement *elem, long dom)
adds elem to the end of array Elements
void make_invisible(Point *master, bool duplcheck)
long give_nsteps(void) const
void TF_GPA_add_another(GPA< T > &list, T *comp, const Geometry *mg)
adds component to the end of list of Components
void scan_expect_num(FILE *stream, long expctd)
cte SRDC's I-DEAS UNV soubory
const FiLe * give_IN_file_bgm(void) const
void set_FETS(const FiniteElementTypeSet *val)
long SP_scan_word(const char *&src, char *dest)
... word; return value is length of the word
AdaptivityParameters * give_adpa(void) const
long FP_number_of_lines(FILE *stream, bool rwd)
count number of lines in file
FILE * file(void)
*** GET ***
void print_VTK(femFileFormat format, const char *suff)
VTK file with no data.
void resize_Lata(long newsize)
print VTK file divided to severel functions
#define SP_scan_expected_word_exit(_1, _2, _3, _4)
const Edge * give_superedge(long i) const
virtual void finitialize(void)
finalize prepropcessing
void print_VTK_body(Stream *stream, VTKdataset ds) const
void assign_NodeLoad_by_point_prop(const BoundaryCond *bc, long prop)
void assign_NodeLoad_by_point_coords(const BoundaryCond *bc, const PoinT *coords)
bool only_1d_elements(void) const
only 1d elements
virtual void checkConsistency(void) const
Checks data consistency.
void print_VTK_init_point_data(Stream *stream, long n)
const Face * give_face(long i) const
long give_Nels(void) const
const Element * give_superelem(long i) const
long FP_scan_line_skip_emptyORcommented(FILE *stream, char *dest)
*** *** *** SCANNING *** *** *** scanning == scan ...
bool is_supported(void) const
long give_rslts_nsteps(void) const
int give_dimension(void) const
return type of element geometry, is identical with class derived from FElement
Interface to library T3D.
void TF_GPA_cleanup_duplicity(const StdoutDriver *sodriver, T &list, const char *name, char t, bool shake)
clean up duplicity components
#define SP_scan_expected_number_exit(_1, _2, _3)
const Dvctr * give_resultsE_dv(long regid, long step, ResultTypesAtElem rt) const
void TF_GPA_reidoid(GPA< T > &list)
reset ids ascending
virtual Point * allocate_point(long gid, const PoinT *coo, char attribs_alloc='n')=0
const GPA< const BoundaryCond > * give_loads(void) const
const PoinT * give_boubox_diff(void) const
void print_info_message(SODenum flag, const char *format,...) const
*** *** *** *** CLASS MESHGEOMETRY *** *** *** ***
void print_block_elems(FILE *stream, femFileFormat fff, int did)
print input file for solver - block with elements
bool SP_skip_word(const char *&src, int n)
... word and space before
void read_output_SIFEL(void)
read native output file of SIFEL
void TF_GPA_print_list(FILE *stream, const char *name, const char *name2, T &list, long id)
virtual long give_size(void) const
const char * XP_giveDAtext(const XMLNode *xelem, int n, bool last, const char *format, const char *type, const char *name, int *noc)
void kill_damned_elems(void)
KILL ELEMENTS marked by flag "delete" ; KILL = invisible + delete.
void assign_EdgeLoad_by_elem_ID(const BoundaryCond *bc, long id, int indx=-1)
assign edge load to the edge by/via ...
void assemble_full_constrained(Lvctr *aa) const
unknows in transport, N=ndofs
The element is a container class.
void assign_FaceLoad_by_face_prop(const BoundaryCond *bc, long prop)
#define SP_scan_expected_word2_exit(_1, _2, _3, _4, _5)
virtual void read_input(const char *&str, femFileFormat fff)
double give_CSusage_elast_rel(void)
#define _openFilePN(_1, _2, _3, _4)
void add_another_Pjnt(Point *comp)
void print_VTK_data_body(Stream *stream, long n, const char *name, const GPA< Array1d > *data, char type, bool r2z=false)
void print_info_message_core(SODenum flag, ETCLR color=ETC_DEFAULT, const char *buffer=NULL) const
void set_node(long i, long nid)
ATRIBUTES.
void RIGIDmatToRAN(void)
rigid material to RAN
void assign_BodyLoad_by_elem_prop(const BoundaryCond *bc, long prop)
int CellGeometry_e2i_VTK(CellGeometry cg)
const char * give_path(void) const
virtual ~Geometry(void)
DESTRUCTOR.
int give_CSusage_elast_bool(void)
long give_Neds(void) const
void find_slaves(void)
cte VLNA soubory, zatim omezene
void connectivity_assembling(bool re=false)
Function assembles connectivity between element and its nodes, edges and faces (which are allocated i...
bool give_elemprop(void) const
void connectivity_removing(void)
Function removes connectivity between element and its components == nodes, edges and faces...
void read_mesh_T3d(char *path, const char *filename)
kompletni T3d mesh file
bool VTKCT_is_assembled(void) const
Mesh * give_Mesh(long i) const
long give_numsuperedge(void) const
void print_characteristics_to_VTK(bool mft=true)
bool scan_x(FILE *stream)
void print_dat_file(const char *file, long n, const Dvctr *data1, const Dvctr *data2, bool zeroline)
print data for xmgrace
void SetAttribute(const char *name, const char *value)
Sets the named attribute to value.
Geometry(long gid, const Problem *p, MMprocessing proc)
CONSTRUCTOR.
A Document binds together all the functionality.
void redefine(FILE *stream)
Classes Cell, Facedge, Edge, Face, Element, Gelement, PolyLine, Line, PolygonMdl, FElement...
void give_displcmnt_in_all_steps(Dvctr *data, int indx) const
void resize_ignore_vals(long r, long c)
print yourself
void replace_Pjnt_by(Point *Pold, Point *Pnew)
invisible and delete old, set ID and assign new, of new
void print_block_nodal_load(FILE *stream, femFileFormat fff, int did)
print input file for solver - block with nodal load
XMLElement * NewElement(const char *name)
Create a new Element associated with this Document.
const char * give_OUT_Path(void) const
const FiLe * give_IN_file_results(void) const
MMprocessing give_gp(void) const
void initialize_domli(bool shared, long dom, long li)
void TF_GPA_wdg_another(GPA< T > &list, T *comp, const Geometry *mg, long nid)
const char * give_base(void) const
long give_cMesh(void) const
virtual void set_model_prop(long val, const Model *model, bool flag=false)
void resize_Data_members(long newsize)
PAType give_analloctype(void) const
const Point * give_point(long i) const
void set_RTE(ResultTypesAtElem rt, bool val)
const Problem * give_Pd(void) const
void resize_Lata_members(long newsize)
void boubox_assembling(long indx=-1)
virtual classID give_classid() const
Returns classID - class identification.
void print_geom_info(void) const
print info about geometry of mesh
int give_melnik(void) const
void join_geom(Geometry *geom)
void read_mesh_ANSYS(char *path, const char *filename)
zatim to cte jen primitivni batch file pro ANSYS kterej obsahuje jen coordinaty of nodes a trojuhelni...
void assign_attributes(PointAttribs *na)
virtual ~Model(void)
DESTRUCTOR.
void read_input(const char *&str, femFileFormat fff)
*** READ ***
PointAttribs * give_pointAttribs(void)
bool find_parent_subdom(long sdid, long *nn, long *level)
const char * give_name(void) const
virtual classID give_classid() const
Returns classID - class identification.
void print_bc(FILE *stream, femFileFormat fff) const
long give_cCS(void) const
void transform_to_mesh(void)
void print_info_message_colour(SODenum flag, ETCLR colour, const char *format,...) const
const Problem * Pd
Pointer to owner = parent problem.
const char * Value() const
The meaning of 'value' changes for the specific type.
Model(long gid, const Problem *p, MMprocessing mmp)
CONSTRUCTOR.
const Mesh * Msh(void) const
XMLDocument * tix_doc(void)
void read_model_MELNIK(void)
const char * Attribute(const char *name, const char *value=0) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
void connectivity_assembling(void)
Function computes connectivity of mesh.
PointAttribs * release_attributes(void)
slouzi k premene Node na RAN nebo HN
bool ST_scan_number(Stream *src, int &dest)
*** *** *** *** TINYXML FCE *** *** *** ***
void add_another_Edge(Edge *comp)
const Dscal * give_resultsN_ds(long step, ResultTypesAtNode rt) const
long give_Nfas(void) const
special one time format for bridge in Melnik
void read_model_polylines(const char *path, const char *filename)
nput file with polylines first line: #1 - number of polylines first line of polyline: #1 #2 #3 #4...
bool FP_skip_line(FILE *stream, int n)
move file descriptor to the start of the n-th new line //[former read_line]
long give_Npts(void) const
void set_point(long i, const PoinT *p)
void add_resultE(Dvctr *rslt, long regid, long step, ResultTypesAtElem rt)
const Point * give_Pjnt_with_prop(long prp, bool unique) const
long FP_scan_line(FILE *stream, char *dest)
scan/copy line == string without ' ' from stream
void print_info_time_green_ok(SODenum flag, double sec) const
Geometry * give_primary_geometry(void) const
void print_supported_BC_to_line(FILE *stream, femFileFormat fff) const
virtual void checkConsistency(void) const
Checks data consistency.
Interface to library OOFEM.
const Edge * give_Edge(long i) const
const FiLe * give_OUT_moFILE(void) const
void read_output_OOFEM(FILE *stream, long step, ResultTypesAtNode rt)
void open(Stream_type t, const char *rw, const char *&fn, XMLNode *node=NULL)
*** SET ***
double give_aver_elem_circ(void) const
ElemAttribs * give_elemAttribs(void)
bool scan_xyz(FILE *stream)
void find_subdomains(void)
subdomain
XMLError QueryLongAttribute(const char *name, long *value) const
Given an attribute name, QueryIntAttribute() returns XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the co...
void generate_mesh_primary(void)
void aver_elem_circ_assembling(long indx=-1)
FacedgeAttribs * give_facedgeAttribs(void)
void resize_ignore_vals(long r, long c)
void read_VTK(char DATASET, Stream *stream, bool addata=false, bool sparse=false)
CORE read of VTK file.
Lvctr * resize_ignore_vals(long newsize)
resize, ignore values
const FiLe * give_P_mesherbinary(void) const
void connectivity_allocation(void)
Function allocates arrays necessary for connectivity assembling.
void print_control(FILE *conout) const
Function prints contol data.
GPA - Generic Pointer Array, template class manages 1d array of pointers to objects of type T...
bool scan_y(FILE *stream)
virtual void print_row(FILE *stream, femFileFormat fff, bool endline=true, long did=0) const
print node row output for solver
const Face * give_superface(long i) const
void geom_stats_assembling(const GeometryComponent *comp)
femFileFormat give_ff(void) const
void resize(long newsize)
reallocate receiver to the new size
const char * give_name_or_null(void) const
void assign_cellpoints(void)
void print_VTK_nodes(Stream *stream) const
void read_mesh_UNV(char *path, const char *filename)
adaptivity, element characteristic size, actual
SStype
type of stress/strain state of element; especially results depends on this variable => described at M...
#define _errorr3(_1, _2, _3)
const Gelement * give_mdl_masterel(void) const
const StdoutDriver * sodriver(void) const
adaptivity, refined derivatives
bool give_fulldata(void) const
const char * give_IN_Path(void) const
SStype give_sst(void) const
void set_point(long i, const Point *val)
ATRIBUTES.
void resize_Data(long newsize)
long give_regid(void) const
void print_info(void) const
long give_numsuperface(void) const
bool FP_skip_expected_string(FILE *src, const char *expctd, bool cs)
... word and compare with expected one
void FETSet_si2set(const char *str, int val, Solver sol, PAGroup pg, FiniteElementTypeSet *set)
Node * Nodes(long i) const
bool FP_skip_space(FILE *stream)
... space
virtual void cpat(long i, const Xvctr *p, long j)=0
void read_structural_analysis_output(void)
read output file from structural analysis package
long give_nstepsOut(FILE *stream, femFileFormat ff, PAType pt, const Problem *Pd)
void check_duplicity_nodes(void)
set up duplicity nodes
void print_block_gravity_load_ANSYS(FILE *stream) const
print input file for solver - block with gravity load
bool FP_skip_behind_line_starting_with(FILE *stream, const char *string, bool cs)
move file descriptor to the start of the new line after the one starting with string ...
MeshGenerator give_P_mesher(void) const
void mesh_generate_T3d(const Problem *pd, const char *solver, const char *options_string)
const Dscal * give_results_ds(long step, ResultTypesAtElem rt) const
void read_mesh_SIFEL(FILE *stream)
read native input file to SIFEL
long give_OUT_printStep(void) const
virtual void read_output_OOFEM(FILE *stream, long step)
double * give_ptr2val(long r=0, long c=0)
void setup_full_alloc_DOFvals_at(Dvctr *d, ResultTypesAtNode rt, long step) const
bool give_3Delement_with_point_inside(const PoinT *coords, const GeometryComponent *&comp, PoinT *nc) const
Function finds location of point indide of which 3d element is.
long VTKCTcl
ELEMENT STATS // VTK cells types - count elements of type:
double give_IN_meshGen_elemSize(void) const
bool is_loaded(void) const
const char * give_output_file(void) const
void assign_EdgeLoad_by_elem_prop(const BoundaryCond *bc, long prop)
void print_block_supported_dofs(FILE *stream, femFileFormat fff, int did)
print input file for solver - block with supported nodes
void set_resultE(const Dmtrx *rslt, long regid, long step, ResultTypesAtElem rt)
const Element * give_Elem(long i) const
void give_vtk_polydata_counts(long &cl, long &cp) const
get/compute count of VTK polydata elements
bool SP_scan_number(const char *&src, int &dest)
... number of type int/long/double
long give_numsuperelem(void) const
void read_output_SIFEL(FILE *stream, long step, ResultTypesAtNode rt)
*** *** *** *** CLASS COMPONENT *** *** *** ***
tato struktura by mela obsahovat vsechny potrebne informace pro urceni konkretni implementace konecne...
void set_error(double val)
bool give_nodeprop(void) const
virtual void print_row(FILE *stream, femFileFormat fff, bool endline=true, long did=0) const
print element row output for OOFEM
void find_duplicitys(long &nd, long *Cduplicity, long **duplicity)
return duplicity squads = 2 or more points with same coordinates nd ...
long give_nno(void) const
void set_mprop(long val)
*** SET ***
virtual XMLNode * ShallowClone(XMLDocument *document) const
Make a copy of this node, but not its children.
Point * allocate_point(long gid, const PoinT *coo, char attribs_alloc='n')
bool only_vtk_polydata(void) const
all elements is polydata compatible
#define _warningg5(_1, _2, _3, _4, _5)
const XMLNode * LastChild() const
Get the last child node, or null if none exists.
void set_result(long s, double *rslt, long step, ResultTypesAtElem rt)
#define _errorr4(_1, _2, _3, _4)
bool connectivity_assembled
when any function changes geometry there are two types of "set" functions a) stat is not activated =>...
void read_mesh_equal_to_model(void)
make mesh equal to model - no remeshing process
void delete_subdomains_except(long leave)
delete all subdomains except "leave"
void print_block_nodes(FILE *stream, femFileFormat fff, int did)
PRINTING OF FILES.
void read_addata_VTK(const char *filename, bool sparse)
XMLDeclaration * NewDeclaration(const char *text=0)
Create a new Declaration associated with this Document.
void set_resultN(long s, const double *rslt, long step, ResultTypesAtNode rt)
const Node * give_Node(long i) const
#define FP_scan_expected_word_exit(_1, _2, _3, _4)
void print_VTK_START(Stream *stream, const Mesh *mg, const char *name, VTKdataset ds)
T * add(T *val)
add (assign) new pointer to the end; enlarge the receiver if too small
double give_lav(void) const
Solver rslts_solver
RESULTS == structural analysis output data.
bool is_first_diag_short(void)
if the first diagonal is shorter then the second
Class Geometry, Model and Mesh.
virtual double give_ssstate(Dvctr *data, SStype SST, RVType rvtype, char type, long step, const Node *node=NULL)=0
give stress-strain state
void cleanup_duplicities(void)
clean up duplicities (nodes,lines)
void read_mesh_OOFEM(FILE *stream, long nn, long ne)
read native input file to OOFEM
#define _openFilePNS(_1, _2, _3, _4, _5)
void add_another_Elem(Element *comp)
void read_output_OOFEM(void)
read native output file of OOFEM
void adaptivity(void)
ADAPTIVITY.
const GPA< const Element > * give_superelems(void) const
long give_parent_id(void) const
void assign_FaceLoad_by_elem_prop(const BoundaryCond *bc, long prop)
Mesh(long gid, const Problem *p, long numdom, MMprocessing mmp)
CONSTRUCTOR.
void anyBeamElem_assembling(long indx=-1)
void generate_mesh_RFbyHN(void)
double give_required_error(void) const
const FiLe * give_IN_file_results_addataVTK(void) const
long give_lid_id(long dom) const
vraci lid of node, pro non-Parallel vraci id
PAType give_analtype(void) const
void print_JKTK(femFileFormat format, const char *suff)
print geometry to JKTK format file
long give_mpropertyORzero(void) const
PoinT * copy(const PoinT *p)
void deallocateCheck(ArgType *p, bool check=true)
*** *** *** *** DEALLOCATE TEMPLATES *** *** *** ***
void print_results(void)
TADY BUDOU VSECHNY INFORMACE O VYSLEDCICH ZE SOLVERU.
long give_ccols(void) const
adaptivity, element characteristic size, new
void TF_GPA_shake_down_reidoid(GPA< T > &list)
clear out NULL components
void VTKCT_assembling(long indx=-1)
sum counts of VTK cell types
VTKPDtopology
VTK type of cell topology for POLYDATA.
T * wedge(long i, T *val)
void read_mesh_JKTK(char *path, const char *filename)
JKTK file format.
virtual void initialize(void)
initiate/sets data
XMLNode * InsertEndChild(XMLNode *addThis)
Add a child node as the last (right) child.
const XMLNode * NextSibling() const
Get the next (right) sibling node of this node.
const Point * give_Pjnt(long i) const
void print_VTK_init_cell_data(Stream *stream, long n)
virtual classID give_classid() const
Returns classID - class identification.
double give_CSusage_elast(void)
FILE * scan_DATA_head(FILE *stream, const char *str, const char *expnumtype, int *noc, const char *descript)
const PoinT * give_coords(void) const
CellGeometry CellGeometry_i2e_JKTK(int val)
Element * allocate_element(bool mdl, CellGeometry eg, long gid, long oid, Geometry *geom, int np=0, bool attribs_alloc=true, long dom=0, long lid=-1)
Elem3D * sub(const Elem3D *p)
long give_anyBeamElem(void) const
int give_nDOFs(void) const
void add_another_Face(Face *comp)
double give_coord(int i) const
void assign_FaceLoad_by_elem_ID(const BoundaryCond *bc, long id, int indx=-1)
assign face load to the face by/via ...
bool FP_scan_expected_word(FILE *src, const char *expctd, bool cs)
... word and compare with expected one
bool FP_skip_comment(FILE *stream)
*** *** *** *** FILE PROCESSING *** *** *** *** general rules for file processing: ...
VTKPDtopology give_VTKPDtopology_of_elem(long i) const
double volume_core(void) const
print volume to extra file