102 for (
long i=0; i<
nNodes; i++)
107 for (
long i=0; i<
nElems; i++)
153 if (this->
nLC == -77)
173 else if (
coll == 0)
md = 3;
201 bool twd = this->
md == 2;
203 for (
long i=0; i<
nNodes; i++) {
214 bool twd = this->
md == 2;
216 for (
long i=0; i<
nNodes; i++) {
232 for (
long i=0; i<
nNodes; i++)
241 for (
long i=0; i<
nElems; i++)
248 for (
long i=0; i<
nNodes; i++)
251 for (
long i=0; i<
nElems; i++) {
265 ;
if ( n[0] && n[1] && n[2]) this->
set_coll(0);
266 else if (!n[0] && n[1] && n[2]) this->
set_coll(1);
267 else if ( n[0] && !n[1] && n[2]) this->
set_coll(2);
268 else if ( n[0] && n[1] && !n[2]) this->
set_coll(3);
277 if (
coll == 1)
delta[0] = 0.0;
else delta[0] = (p2[0] - p1[0]) / n[0];
278 if (
coll == 2)
delta[1] = 0.0;
else delta[1] = (p2[1] - p1[1]) / n[1];
279 if (
coll == 3)
delta[2] = 0.0;
else delta[2] = (p2[2] - p1[2]) / n[2];
287 for (k=0; k<n[2]+1; k++)
288 for (j=0; j<n[1]+1; j++)
289 for (i=0; i<n[0]+1; i++) {
306 Elems[i]->set_type(et);
311 for (i=0; i<n[0]; i++)
312 for (j=0; j<n[1]; j++)
313 for (k=0; k<n[2]; k++) {
314 Elems[l]->
nodes[0] = i + j *(n[0]+1) + k *(n[0]+1)*(n[1]+1) ;
315 Elems[l]->
nodes[1] = i+1 + j *(n[0]+1) + k *(n[0]+1)*(n[1]+1) ;
316 Elems[l]->
nodes[2] = i+1 + (j+1)*(n[0]+1) + k *(n[0]+1)*(n[1]+1) ;
317 Elems[l]->
nodes[3] = i + (j+1)*(n[0]+1) + k *(n[0]+1)*(n[1]+1) ;
319 Elems[l]->
nodes[4] = i + j *(n[0]+1) + (k+1)*(n[0]+1)*(n[1]+1) ;
320 Elems[l]->
nodes[5] = i+1 + j *(n[0]+1) + (k+1)*(n[0]+1)*(n[1]+1) ;
321 Elems[l]->
nodes[6] = i+1 + (j+1)*(n[0]+1) + (k+1)*(n[0]+1)*(n[1]+1) ;
322 Elems[l]->
nodes[7] = i + (j+1)*(n[0]+1) + (k+1)*(n[0]+1)*(n[1]+1) ;
326 else if (
coll == 3) {
327 for (i=0; i<n[0]; i++)
328 for (j=0; j<n[1]; j++) {
343 if (
_STRCMP(s,
"2D" ) == 0)
return 3;
344 else if (
_STRCMP(s,
"3D" ) == 0)
return 0;
345 else _errorr2 (
"Invalid structure of the given VTK file, the key word %s at the second line is not supported", s);
358 if (!add)
_errorr(
"mesh data already readed");
361 if (add)
_errorr(
"mesh data not readed");
367 if (pid == -1 && lc == -1 && add ==
false)
369 else if (pid != -1 && lc != -1 && add ==
false)
371 else if (pid != -1 && lc != -1 && add ==
true)
381 char *filename =
new char[255];
382 strcpy(filename, vtkMeshFile);
390 bool lgc = stream->
isFile();
392 if (lgc) WORD =
new char[255];
447 _errorr(
"No AppendedData section");
449 if (
_STRCMP(parent->
Value(),
"AppendedData") != 0)
_errorr (
"name of xelement is not \"AppendedData\"");
452 if ( parent->
Value()[0] !=
'_' )
_errorr(
"There is no character \'_\' at the start of section AppendedData");
455 if (
_STRCMP(parent->
Value(),
"Input_Type") != 0)
_errorr(
"name of xelement is not Input_Type");
470 xnel = stream->
tixel();
477 bool status =
true, prnt;
479 long i, j, nn, noel, cno, offset, auxl;
481 const char *data=NULL, *offs=NULL, *typs, *str;
491 if (fgets (LINE, lLINE, stream->
file()) == NULL)
break;
504 if (
_STRCMP(WORD,
"Points") == 0) {
524 while (noel) { noel--;
531 while (noel) { noel--;
549 else if (
_STRCMP(WORD,
"CELLS") == 0) {
559 data =
XP_giveDAtext (stream->
tixel(), 1,
false,
"ascii",
"Int32",
"connectivity", NULL);
567 if (!lgc) offset = 0;
569 for (i=0; i<noel; i++) {
571 if (lgc) { fscanf (stream->
file(),
"%ld",&nn); cno = cno - nn - 1; }
572 else { nn = offset; status +=
SP_scan_number (offs, offset); nn = offset - nn; }
582 if (nn == 8) et = 12;
590 if (lgc) status += ( fscanf (stream->
file(),
"%ld",
Elems[i]->
nodes+j) == 1 );
599 fgets (LINE, lLINE, stream->
file()); str=LINE;
604 for (i=0; i<noel; i++) {
605 if (lgc) status += ( fscanf (stream->
file(),
"%ld", &auxl) == 1);
613 else { data = NULL; offs = NULL; }
622 _errorr2(
"Invalid structure of the given VTK file, the key word %s is not supported", WORD);
627 else if (
_STRCMP(WORD,
"POINT_DATA") == 0 ||
_STRCMP(WORD,
"PointData") == 0) {
632 else { prnt =
true; }
637 else if (
_STRCMP(WORD,
"CELL_DATA") == 0 ||
_STRCMP(WORD,
"CellData") == 0) {
642 else { prnt =
true; }
647 else if (
_STRCMP(WORD,
"SCALARS") == 0 ||
_STRCMP(WORD,
"VECTORS") == 0 ||
_STRCMP(WORD,
"TENSORS") == 0 ||
_STRCMP(WORD,
"DataArray") == 0 ||
_STRCMP(WORD,
"FIELD") == 0) {
664 else if (
_STRCMP(WORD,
"strain_planestrain") == 0) {
668 for (j=0; j<
nElems; j++) {
673 if (auxl != 3)
errol;
675 if (auxl !=
P[pid]->nstrain_one()) {
676 if(auxl == 3 &&
P[pid]->nstrain_one()==6) {
684 else if (
_STRCMP(WORD,
"stress_planestrain") == 0) {
688 for (j=0; j<
nElems; j++) {
691 if (auxl !=
P[pid]->nstrain_one()) {
692 if(auxl == 3 &&
P[pid]->nstrain_one()==6) {
701 _errorr2 (
"Invalid name of SCALARS/DataArray for CELL_DATA/PointData \"%s\"", WORD);
705 else if (ed ==
'p') {
706 if (
_STRCMP(WORD,
"uknw_displacement") == 0) {
711 if (auxl !=
P[pid]->ndisplc_one()) {
712 if (auxl != 3 &&
P[pid]->ndisplc_one() != 2)
720 if (thzero) auxl = 2;
721 for (j=0; j<
nNodes; j++) {
731 else if (
_STRCMP(WORD,
"uknw_rotation") == 0) {
732 if (lgc)
_errorr(
"have to skip values");
736 _errorr2 (
"Invalid name of SCALARS/DataArray for POINT_DATA/PointData \"%s\"", WORD);
745 else if (
_STRCMP(WORD,
"") == 0) {;}
746 else _errorr2 (
"Invalid structure of the given VTK file, unexpected key word \"%s\"", WORD);
748 if (lgc) {
if (cno)
_errorr2 (
"cno(%ld) is not zero", cno); }
750 if (data && data[0] !=
'\0')
_errorr2(
"CellData of name \"%s\" has too many numbers", WORD);
751 if (offs && offs[0] !=
'\0')
_errorr(
"error");
755 if (lgc)
delete [] WORD;
756 if (status ==
false)
_errorr(
"error");
769 if (!this->
is_unset())
_errorr(
"Mesh in the function give_unitSphereMesh_3d is not empty/unset");
771 _errorr1 (
"Number of segments must be between 3 and 20!");
783 double phi = ((90.0 / n) *
PI) / 180.0;
784 for (
long i = 1, j = i - 1; i < this->
nNodes; i++, j++) {
794 int startNode = 1, node = startNode;
795 for (
long i = 0; i < this->
nElems; i++) {
799 this->
Elems[i]->
nodes[2] = (i == (this->nElems - 1)) ? startNode : node;
810 if (!this->
is_unset())
_errorr(
"Mesh in the function give_unitSphereMesh_3d is not empty/unset");
812 _errorr1 (
"Number of segments must be between 3 and 20!");
819 int nNodesOnLayer = (n * 4);
820 int nLayersOfNodes = (n * 2 - 1);
831 double *phi =
new double[2*n];
834 double ph = ((90.0 / n) *
PI) / 180.0;
835 for (
long i = 0; i < 2*n; i++)
840 double sum =
PI/2.0 * a[1]/a[0];
844 phi[0] = phi[0] * 0.5 *
PI / sum;
847 for (
long i = 1; i < n; i++) {
851 }
while (fabs(sum - 0.5 *
PI) > 0.01*
PI);
853 for (
long i = 0; i < n; i++) phi[n+i] = phi[i];
854 for (
long i = 0; i < n; i++) phi[n-1-i] = phi[n+i];
860 double theta = ((90.0 / n) *
PI) / 180.0;
863 for (
long i = 0; i < nLayersOfNodes; i++) {
865 for (
long j = 0; j < nNodesOnLayer; j++) {
866 this->
Nodes[nodeID]->
coords.
y = sin (PHI) * cos (theta * j);
867 this->
Nodes[nodeID]->
coords.
z = sin (PHI) * sin (theta * j);
876 int nElemsInTopOrBottomLayers = n * 4;
877 int nElemsInMiddleLayer = n * 2 * 4;
878 int nMiddleLayers = (n - 1) * 2;
880 this->
set_and_alloc_nElems (nElemsInTopOrBottomLayers * 2 + nElemsInMiddleLayer * nMiddleLayers);
888 for (
long i = 0; i < nElemsInTopOrBottomLayers; i++) {
892 this->
Elems[elemID]->
nodes[2] = (i == nElemsInTopOrBottomLayers - 1) ? startNode : nodeID;
898 int nextLayerNodeID, nextLayerStartNode;
899 for (
long i = 0; i < nMiddleLayers; i++) {
900 startNode = nNodesOnLayer * i + 2;
902 nextLayerStartNode = startNode + nNodesOnLayer;
903 nextLayerNodeID = nextLayerStartNode;
904 for (
long j = 0; j < nElemsInMiddleLayer; j += 2) {
908 this->
Elems[elemID]->
nodes[1] = nextLayerNodeID;
915 this->
Elems[elemID]->
nodes[1] = nextLayerNodeID++;
916 this->
Elems[elemID]->
nodes[2] = nextLayerNodeID;
923 this->
Elems[elemID]->
nodes[1] = nextLayerNodeID++;
924 this->
Elems[elemID]->
nodes[2] = (j == (nElemsInMiddleLayer - 2)) ? nextLayerStartNode : nextLayerNodeID;
930 this->
Elems[elemID]->
nodes[1] = (j == (nElemsInMiddleLayer - 2)) ? nextLayerStartNode : nextLayerNodeID;
931 this->
Elems[elemID]->
nodes[2] = (j == (nElemsInMiddleLayer - 2)) ? startNode : nodeID;
939 startNode = this->
nNodes - 1 - nNodesOnLayer;
941 for (
long i = 0; i < nNodesOnLayer; i++) {
945 this->
Elems[elemID]->
nodes[2] = (i == nNodesOnLayer - 1) ? startNode : nodeID;
958 if (nlc == 0) nlc = this->
nLC;
963 for (
int i=lc; i<lc+nlc; i++)
975 char auxs[20001]; auxs[20000] =
'\0';
982 char *filename =
new char[255];
983 sprintf (filename,
"%s.%02d.vtk", rsltFileName, lc);
990 if (twodim) sprintf (type,
"2Drec");
991 else sprintf (type,
"3Drec");
999 for (i=0; i<
nNodes; i++) {
1000 sprintf (auxs,
"%15.8e %15.8e %15.8e",
Nodes[i]->coords[0],
Nodes[i]->coords[1],
Nodes[i]->coords[2]);
1002 if (lgc) fprintf (stream->
file(),
"%s\n", auxs);
1009 for (i=0; i<
nElems; i++) auxl +=
Elems[i]->nnodes;
1011 fprintf (stream->
file(),
"CELLS %ld %ld\n",
nElems, auxl);
1012 for (i=0; i<
nElems; i++) {
1017 fprintf (stream->
file(),
"\n");
1020 fprintf (stream->
file(),
"CELL_TYPES %ld\n",
nElems);
1055 if (
no_dspl_rf &&
no_dspl_rf[pid] &&
no_dspl_rf[pid][lc]) { da =
print_VTK_data_head (stream,
"Displacemet",
'v',
'f', 0);
for (i=0; i<this->
nNodes; i++) {
print_values_Vector (auxs, this->
Nodes[i]->displc[pid][lc], twodim, 5);
print_auxs (lgc, stream, da, auxs); } }
1056 if (
no_strn_rf &&
no_strn_rf[pid] &&
no_strn_rf[pid][lc]) { da =
print_VTK_data_head (stream,
"Strain",
't',
'f', 0);
for (i=0; i<this->
nNodes; i++) {
print_values_Tensor (auxs, this->
Nodes[i]->strain[pid][lc], twodim, 5);
print_auxs (lgc, stream, da, auxs); } }
1057 if (
no_strs_rf &&
no_strs_rf[pid] &&
no_strs_rf[pid][lc]) { da =
print_VTK_data_head (stream,
"Stress",
't',
'f', 0);
for (i=0; i<this->
nNodes; i++) {
print_values_Tensor (auxs, this->
Nodes[i]->stress[pid][lc], twodim, 5);
print_auxs (lgc, stream, da, auxs); } }
1063 if (
el_dspl_rf &&
el_dspl_rf[pid] &&
el_dspl_rf[pid][lc]) { da =
print_VTK_data_head (stream,
"Displacemet",
'v',
'f', 0);
for (i=0; i<this->
nElems; i++) {
print_values_Vector (auxs, this->
Elems[i]->displc[pid][lc], twodim, 5);
print_auxs (lgc, stream, da, auxs); } }
1064 if (
el_strn_rf &&
el_strn_rf[pid] &&
el_strn_rf[pid][lc]) { da =
print_VTK_data_head (stream,
"Strain",
't',
'f', 0);
for (i=0; i<this->
nElems; i++) {
print_values_Tensor (auxs, this->
Elems[i]->strain[pid][lc], twodim, 5);
print_auxs (lgc, stream, da, auxs); } }
1065 if (
el_strs_rf &&
el_strs_rf[pid] &&
el_strs_rf[pid][lc]) { da =
print_VTK_data_head (stream,
"Stress",
't',
'f', 0);
for (i=0; i<this->
nElems; i++) {
print_values_Tensor (auxs, this->
Elems[i]->stress[pid][lc], twodim, 5);
print_auxs (lgc, stream, da, auxs); } }
1068 if (
Elems[0]->error &&
Elems[0]->error[pid]) { auxl = 1; da =
print_VTK_data_head (stream,
"Error_elem",
's',
'f', auxl);
for (i=0; i<this->
nElems; i++) {
print_values_Scalar (auxs, this->
Elems[i]->error[pid]+lc, auxl, 5);
print_auxs (lgc, stream, da, auxs); } }
1081 if (nlc == 0)
_errorr(
"nlc == 0");
1087 for (
int i=lc; i<lc+nlc; i++) {
1088 if (displc_flag) {
if (
no_dspl_rf[pid][i] ==
false)
no_dspl_rf[pid][i] =
true;
else _errorr(
"Mesh: displacement at nodes already computed for given load case"); }
1089 if (strain_flag) {
if (
no_strn_rf[pid][i] ==
false)
no_strn_rf[pid][i] =
true;
else _errorr(
"Mesh: strain at nodes already computed for given load case"); }
1090 if (stress_flag) {
if (
no_strs_rf[pid][i] ==
false)
no_strs_rf[pid][i] =
true;
else _errorr(
"Mesh: stress at nodes already computed for given load case"); }
1097 if (nlc == 0)
_errorr(
"nlc == 0");
1103 for (
int i=lc; i<lc+nlc; i++) {
1104 if (displc_flag) {
if (
el_dspl_rf[pid][i] ==
false)
el_dspl_rf[pid][i] =
true;
else _errorr(
"Mesh: displacement at elems already computed for given load case"); }
1105 if (strain_flag) {
if (
el_strn_rf[pid][i] ==
false)
el_strn_rf[pid][i] =
true;
else _errorr(
"Mesh: strain at elems already computed for given load case"); }
1106 if (stress_flag) {
if (
el_strs_rf[pid][i] ==
false)
el_strs_rf[pid][i] =
true;
else _errorr(
"Mesh: stress at elems already computed for given load case"); }
1114 if (prob == NULL)
errol;
1120 for (
int i=0; i<
nNodes; i++)
1121 Nodes[i]->allocate_fields(pid);
1124 double **displc, **strain, **stress;
1126 for (
int i=0; i<
nNodes; i++) {
1129 displc = displc_flag ?
Nodes[i]->
displc[pid]+lc : NULL;
1130 strain = strain_flag ?
Nodes[i]->
strain[pid]+lc : NULL;
1131 stress = stress_flag ?
Nodes[i]->
stress[pid]+lc : NULL;
1141 if (prob == NULL)
errol;
1147 for (
int i=0; i<
nElems; i++)
1148 Elems[i]->allocate_fields(pid);
1150 for (
int i=0; i<
nElems; i++)
1151 Elems[i]->compute_centroids();
1153 double **displc, **strain, **stress;
1155 for (
int i=0; i<
nElems; i++) {
1156 displc = displc_flag ?
Elems[i]->
displc[pid]+lc : NULL;
1157 strain = strain_flag ?
Elems[i]->
strain[pid]+lc : NULL;
1158 stress = stress_flag ?
Elems[i]->
stress[pid]+lc : NULL;
1170 switch (this->
mtA) {
1176 for (
long i=0; i<
nElems; i++)
1177 vol += this->
Elems[i]->give_volume();
1179 default:
_errorr(
"Unknown mesh type");
1182 ((
Mesh*)
this)->volume = vol;
1192 switch (this->
mtA) {
1195 default:
_errorr(
"Unknown mesh type");
1241 if (p == NULL)
errol;
1255 else if ((this->
coll == 3 && this->
P[pid]->give_dimension() == 3)) {
1272 _errorr2(
"strain and stress for lc %ld is not computed", lc+1);
1276 for (
long i=0; i<
nElems; i++)
1277 E +=
Elems[i]->give_energy(pid, lc);
1287 double strain11[3], stress11[3];
1288 double strain22[3], stress22[3];
1290 double vol, Eei,Eei2, Ee, Eai, Ea, Err_i;
1293 for (
long i=0; i<this->
nElems; i++) {
1325 Err_i = 100 * sqrt(Eei / Eai);
1330 if (Eai < 0.0)
errol;
1331 if (Eei/Eai < -1.0
e-2)
_errorr2(
"Eei = %e < 0.0", Eei/Eai);
1336 if (Eei2 < 0.0)
errol;
1348 return 100 * sqrt(Ee / Ea);
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
XMLText * NewText(const char *text)
Create a new Text associated with this Document.
double give_curvature(double x, double a, double b)
MatrixRecord * give_matrix(void) const
void print_geometry_file_vtk(const char *rsltFileName, int pid, int lc, int nLC)
Print output file with mesh geometry with results to vtk file.
Class eshelbySoluUniformField.
void generate_regular_mesh(const double *p1, const double *p2, const long *n)
Generate regular mesh geometry of rectangular cuboid shape compound of rectangular cuboid shape eleme...
void shift_id(long snn, long sne)
int give_dimension(void) const
double giveTTproduct_1is2x2to3and2x2to3_SS(const double *T1, const double *T2)
Function gives scalar left-right product of tensor and tensor.
file of various types and symbolic constant definitions
const double * give_globHomog_Stress(int lc)
const double * give_globHomog_Strain(int lc)
void generate_regularSphereMesh_2d(int n, const double *a)
Function generates uniform mesh on an unit circle.
void allocate_fields(int pid)
bool FP_skip_line(FILE *stream, int n)
move file descriptor to the start of the n-th new line //[former read_line]
double volume
Volume/Area.
void local2global(const double *origin, const double *TInv)
Local to global transformation of all nodes.
void print_values_Scalar(char *auxs, const double *values, long len, int precision)
len = pocet scalar cisel
double *** strain
computed fields - strain in TVRN_THEORETICAL_FEEP notation
void XP_check_expected_attribute(const XMLNode *xelem, const char *name, const char *value)
long * nodes
Element nodes.
virtual XMLComment * ToComment()
Safely cast to a Comment, or null.
#define SP_scan_expected_word_exit(_1, _2, _3, _4)
Namespace MatrixOperations.
int check_lc_nlc(int lc, int nlc) const
const XMLElement * XP_give_unique_expected_elem(const XMLNode *xelem, const char *name, bool uniq)
Class mNode contains and handles all mesh node data.
XMLDocument * tix_doc(void)
Mesh(long i, const Problems *p)
Constructor.
void generate_regularSphereMesh_3d(int n, const double *a)
Function generates uniform mesh on an unit sphere.
#define SP_scan_expected_number_exit(_1, _2, _3)
void print_values_Tensor(char *auxs, const double *values, bool twodim, int precision)
dim == dimenze vstupnich dat - 2d ano nebo ne; values musi byt v notaci STRN_THEORETICAL_FEEP ...
long nNodes
Number of nodes.
void CopyVector(const double *src, double *dest, long n)
Function copy given number of components from vector, 'a' to vector 'b'.
double giveVTVproduct_1is3and3x3to5and3(const double *T, const double *vect)
Function gives scalar left-right product of tensor and vector - 'result = vect^T * T * vect'...
const XMLNode * FirstChild() const
Get the first child node, or null if none exists.
virtual int give_nLC(void) const =0
Give number of load cases, e.i. number of load cases, i.e. number of Remote_strain fields...
long SP_scan_word(const char *&src, char *dest)
... word; return value is length of the word
The element is a container class.
void open(Stream_type t, const char *rw, const char *&fn, XMLNode *node=NULL)
*** SET ***
#define SP_scan_expected_word2_exit(_1, _2, _3, _4, _5)
Class mElement, mesh element.
double *** displc
computed fields - displacement
void beRotatedBy2d(const double *r)
Receiver will be rotated by 2d matrix 'rot'. this = rot . this.
void give_stress(double *stress, int pid, int lc) const
void beRotatedBy(const double *r)
Receiver will be rotated by matrix 'rot'. this = rot . this.
mNode ** Nodes
1d array of pointers to Node.
PFCmode
Algorithm type of a point fields calculation.
void AddScalarToVector(long s, long *v, long n)
Function add given number of components from vector 'a' to vector 'b'.
bool is_unset(void)
Returns true, if the receiver is unset, only constructor was called.
void give_strain(double *strain, int pid, int lc) const
Notation used in the Brdecko's book or Jan Zeman's PhD thesis (generally used CTU's notation)...
int np
number of pointers to problems
FILE * file(void)
*** GET ***
long region
-2 - not set, -1 - matrix, <0;nIncl) id of inclusion
bool ST_scan_number(Stream *src, int &dest)
*** *** *** *** TINYXML FCE *** *** *** ***
MeshTypeRead
Type of mesh.
void scan_DATA_field_head(Stream *stream, Stream *strm, const char *str, char type, int nexc, char format, const char *name)
scan_DATA_field_head
double *** stress
computed fields - stress in TVRN_THEORETICAL_FEEP notation
void print_VTK_FINISH(Stream *stream)
int nLC
number of load cases
virtual ~Mesh()
Destructor.
void print_VTK_head(FILE *stream, const char *type)
void compute_node_fields(char flag, bool displc_flag, bool strain_flag, bool stress_flag, int pid, int lc, int nLC, PFCmode pfcMode)
void read_geometry_file_vtk(const char *vtkMeshFile, int pid, int lc, bool add)
Read input file with mesh geometry from vtk file.
long nElems
Number of elements.
double give_homog_energy(int lc, int pid=0)
int npa
number of allocated pointers
void copy_to(double *dest) const
bool SP_scan_number(const char *&src, int &dest)
... number of type int/long/double
void print_auxs(bool lgc, Stream *stream, XMLElement *da, const char *auxs)
XMLNode is a base class for every object that is in the XML Document Object Model (DOM)...
double give_error(int pid1, int pid2, int lc)
MeshType mtA
type of mesh, structured grid or unstructured
void SubtractVector(const double *a, double *b, long n)
Function subtracts given number of components vector 'a' from vector 'b'; b -= a. ...
const char * Value() const
The meaning of 'value' changes for the specific type.
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.
long id
identification number
double *** strain
computed fields - strain
void compute_element_fields(char flag, bool displc_flag, bool strain_flag, bool stress_flag, int pid, int lc, int nLC, PFCmode pfcMode)
predpokladame trojuhelnikove nebo tetrahedron prvky, tj. na elementu budeme drzet jednu hodnotu ...
bool scan_xyz(FILE *stream)
const char * GetText() const
Convenience function for easy access to the text inside an element.
void set_and_alloc_nElems(long ne)
Set nElems and allocate array Elems.
bool equal_dimensions(int pid) const
Returns true when mesh and problem dimensions are same.
void set_node_rslt_flags(bool displc_flag, bool strain_flag, bool stress_flag, int pid, int lc, int nLC)
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 set_and_alloc_nNodes(long nn)
Set nNodes and allocate array Nodes.
bool ** el_dspl_rf
pid x nlc
void print_VTK_init_cell_data(Stream *stream, long n)
void print_VTK_init_point_data(Stream *stream, long n)
double *** displc
computed fields - displacement
void giveReducedStiffMatrix(double *C, int pid) const
int file_type_s2e(const char *s)
void print_VTK_START(Stream *stream, const char *filename)
Print head of vtk file.
XMLElement * print_VTK_nodes_head(Stream *stream, long n)
int give_twodim(void) const
bool ** Allocate1Dbp(long d1)
Function allocates ('new' command) a 1d array of bool* pointers set to NULL.
double *** stress
computed fields - stress
long give_type(void) const
void DeleteArray2D(bool **array, long d1)
Function deletes a 2D 'bool' array of dimension d1 x ??, allocated by new.
bool * Allocate1Dbz(long d1)
Function allocates ('new' command) a 1d array of bool set to zero.
const char * XP_giveDAtext(const XMLNode *xelem, int n, bool last, const char *format, const char *type, const char *name, int *noc)
void DeleteChild(XMLNode *node)
Delete a child of this node.
void set_elem_rslt_flags(bool displc_flag, bool strain_flag, bool stress_flag, int pid, int lc, int nLC)
const Problems ** P
set of pointers to solved problems
void save_error(double val, int pid, int lc)
#define FP_scan_expected_word_exit(_1, _2, _3, _4)
void print_values_Vector(char *auxs, const double *values, bool twodim, int precision)
dim == dimenze vstupnich dat - 2d ano nebo ne
double give_total_energy(int pid, int lc)
bool geom_is_readed(void)
Elem3D * add(const Elem3D *p)
Class Mesh contains and handles all mesh data.
bool ST_scan_array(Stream *src, int n, int *dest)
scan/copy array of numbers from src to dest, src pointer is shifted over the field ...
int FP_scan_word(FILE *src, char *dest)
... word; return value is length of the word
double give_VectorVectorProduct(const double *v1, const double *v2, long n)
Operations with 1d arrays of various length.
bool SP_skip_word(const char *&src, int n)
... word and space before
int add_problem(const Problems *p)
long nnodes
Number of nodes at elements.
long giveFieldsOfPoint(double **displc, double **strain, double **stress, const double *coords, char ptFlag, int rs, int nrs, PFCmode pfcMode=PFCM_OPTIMIZED, long reqIncl=-3, STRNotation tn=STRN_THEORETICAL_ROW) const
Function gives the analytical solution of the perturbation or total fields (displacements, strains and stresses) of a point for given set of remote strains.
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
mElement ** Elems
1d array of pointers to Element.
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
const XMLNode * NextSibling() const
Get the next (right) sibling node of this node.
double give_regular_element_volume(void) const
void scale(const double *s)
Scale all nodes coordinates by vector s.
Class mElement contains and handles all mesh element data.
double give_total_volume(void) const
virtual bool is_converted_to_equivalent(void) const =0
Give type of ...
XMLElement * print_VTK_data_head(Stream *stream, const char *name, char type, char format, int slen)
void allocate_fields(int pid)