75 void createNodes(
double a,
double b,
double c,
double da,
double db,
double dc,
double **&points,
int &n);
82 void print_graf (
const char *vtkGeomFile,
const char *path,
const char *suff,
int lc,
char axe,
int comp,
double coordMin,
double coordMax,
double coordDelta,
char pt_flag,
double dshift,
DiffTypes dt,
Bod * b = NULL,
bool odd =
false);
86 Bod*
read_ansys_strain_stress_plot (
const char *path,
int lc,
char axe,
int comp,
double coordMin,
double coordMax,
bool strn,
bool half=
false,
bool bod=
false);
87 void read_ansys_displ_plot (
const char *path,
int lc,
char axe,
int comp,
double coordMin,
double coordMax);
90 void eqiv_gener_1x2dI_3d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double y,
double E,
double nu,
double a1,
double a2,
double ea,
DiffTypes dt);
91 void eqiv_gener_1x2dI_2d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double y,
double E,
double nu,
double a1,
double a2,
double ea,
DiffTypes dt);
92 void eqiv_gener_2x2dI_2d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode=0);
93 void eqiv_gener_2x2dI_3d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode=0);
94 void eqiv_gener_gx2dI_2d (
const char *vtkAmndFile,
int gx,
int gy,
double dx,
double dy,
double Em,
double num,
const double *rs,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode);
95 void eqiv_gener_gx2dI_3d (
const char *vtkAmndFile,
int gx,
int gy,
double dx,
double dy,
double Em,
double num,
const double *rs,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode);
97 void eqiv_gener_1x3dI (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double y,
double z,
double E,
double nu,
98 double a1,
double a2,
double a3,
double ea1,
double ea2,
double ea3,
DiffTypes dt);
136 FILE *file1 = fopen(name1,
"r");
137 FILE *file2 = fopen(name2,
"r");
144 c = fgetc(file1); ungetc(c,file1);
145 if (c ==
'\n' || c == EOF)
break;
147 fscanf (file1,
"%lf", &v1);
148 fscanf (file2,
"%lf", &v2);
151 fscanf (file1,
"%lf", &v1);
152 fscanf (file2,
"%lf", &v2);
153 if (!
areSame(1
e-9, 0.01, v1, v2)) {
154 printf (
"%lf %lf \n", v1, v2);
155 printf (
"cd .. ; xmgrace -param /home/termit/.config/grace/link.par %s %s ; cd -\n", name1, name2);
164 if (bre==
false && n<20)
203 char vtkAmndFile2d [] =
"x2d_1I/amnd.2d.vtk";
204 char vtkAmndFile3d [] =
"x2d_1I/amnd.3d.vtk";
213 int nlc = 3;
if (nlc !=1 && nlc != 3)
errol;
214 int ncomp = 3;
if (ncomp<1 || ncomp>3)
errol;
216 double rs2 [] = { 1.0, 0.0, 0.0, 0.0 };
217 double rs3 [] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
227 if(m2d)
eqiv_gener_1x2dI_2d (vtkAmndFile2d, 1.0, 0.2, nlc == 1 ? rs2 : NULL, 0.0, 0.0, 10.0, 0.4, 1.0, 0.5, angle,
DT_NUMERICAL);
228 if(m3d)
eqiv_gener_1x2dI_3d (vtkAmndFile3d, 1.0, 0.2, nlc == 1 ? rs3 : NULL, 0.0, 0.0, 10.0, 0.4, 1.0, 0.5, angle,
DT_NUMERICAL);
232 for (
int i=0; i<nlc; i++) {
234 for (
int j=0; j<ncomp; j++) {
236 for (
int k=0; k<2; k++) {
237 if (xy[k] ==
'-')
continue;
245 if (pert) {
print_graf(vtkAmndFile2d,
"x2d_1I/",
".2d.pert", i, xy[k], j, -20.0, 20.0, 0.01,
'p', 0,
DT_NUMERICAL, b); }
246 if (totl) {
print_graf(vtkAmndFile2d,
"x2d_1I/",
".2d" , i, xy[k], j, -20.0, 20.0, 0.01,
't', 0,
DT_NUMERICAL, b); }
248 if (pert) {
print_graf(vtkAmndFile3d,
"x2d_1I/",
".3d.pert", i==2 ? 3 : i, xy[k], j==2 ? 3 : j, -20.0, 20.0, 0.01,
'p', 0,
DT_ANALITICAL, b); }
249 if (totl) {
print_graf(vtkAmndFile3d,
"x2d_1I/",
".3d" , i==2 ? 3 : i, xy[k], j==2 ? 3 : j, -20.0, 20.0, 0.01,
't', 0,
DT_ANALITICAL, b); }
273 FILE *file = fopen(name,
"r");
274 fscanf (file,
"%lf", &dx);
284 char vtkAmndFile2d [] =
"x2d_2I/amnd.2d.vtk";
285 char vtkAmndFile3d [] =
"x2d_2I/amnd.3d.vtk";
292 int nlc = 1;
if (nlc !=1 && nlc != 1)
errol;
293 int ncomp = 3;
if (ncomp<1 || ncomp>3)
errol;
297 double Em = 1.0, num = 0.2;
298 double Ei = 10.0, nui = 0.3;
299 double rs2 [] = { 1.0, 0.0, 0.0, 0.0 };
300 double rs3 [] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
307 bool mode[] = {
false,
false, 1,
false, 0, 0,
false,
false };
int cm = 8;
313 mode[0] = mode[2] = mode[4] = mode[5] =
true;
314 mode[1] = mode[3] = mode[6] = mode[7] =
false;
321 for (
int m=0; m<cm; m++) {
322 if (! mode[m])
continue;
325 if(m2d)
eqiv_gener_2x2dI_2d (vtkAmndFile2d, Em, num, rs2, dx, Ei, nui, 1.0, 0.5,
DT_NUMERICAL , m);
326 if(m3d)
eqiv_gener_2x2dI_3d (vtkAmndFile3d, Em, num, rs3, dx, Ei, nui, 1.0, 0.5,
DT_ANALITICAL, m);
334 if(m2d) { sprintf (suff,
".%02d.2d", m);
print_graf(vtkAmndFile2d,
"x2d_2I/", suff, 0,
'X', 0, -20.0, 20.0, 0.01,
't', 0,
DT_NUMERICAL , b); }
335 if(m3d) { sprintf (suff,
".%02d.3d", m);
print_graf(vtkAmndFile3d,
"x2d_2I/", suff, 0,
'X', 0, -20.0, 20.0, 0.01,
't', 0,
DT_ANALITICAL, b); }
337 delete [] b; b = NULL;
371 char vtkAmndFile2d [] =
"x2d_grid/amnd.2d.vtk";
372 char vtkAmndFile3d [] =
"x2d_grid/amnd.3d.vtk";
379 int nlc = 1;
if (nlc !=1 && nlc != 1)
errol;
380 int ncomp = 3;
if (ncomp<0 || ncomp>3)
errol;
386 double Em = 1.0, num = 0.2;
387 double Ei = 10.0, nui = 0.3;
388 double rs2 [] = { 1.0, 0.0, 0.0, 0.0 };
389 double rs3 [] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
397 bool mode[] = {
false,
false,
true,
false,
false,
false,
false,
false };
int cm = 8;
402 for (
int m=0; m<cm; m++) {
403 if (! mode[m])
continue;
406 if(m2d)
eqiv_gener_gx2dI_2d (vtkAmndFile2d, 1+2*nx, 1+2*ny, 2*dx, 2*dx, Em, num, nlc == 1 ? rs2 : NULL, Ei, nui, 1.0, 1.0,
DT_NUMERICAL , m);
407 if(m3d)
eqiv_gener_gx2dI_3d (vtkAmndFile3d, 1+2*nx, 1+2*ny, 2*dx, 2*dx, Em, num, nlc == 1 ? rs3 : NULL, Ei, nui, 1.0, 1.0,
DT_ANALITICAL, m);
409 for (
int i=0; i<nlc; i++) {
424 for (
int j=0; j<ncomp; j++) {
426 for (
int k=0; k<2; k++) {
427 if (xy[k] ==
'-')
continue;
435 if(m2d) { sprintf (suff,
".%02d.2d", m);
print_graf(vtkAmndFile2d,
"x2d_grid/", suff, i, xy[k], j, -20.0, 20.0, 0.01,
't', 0,
DT_NUMERICAL , b,
true); }
436 if(m3d) { sprintf (suff,
".%02d.3d", m);
print_graf(vtkAmndFile3d,
"x2d_grid/", suff, i==2 ? 3 : i, xy[k], j==2 ? 3 : j, -20.0, 20.0, 0.01,
't', 0,
DT_ANALITICAL, b,
true); }
470 double coords[] = { 5.0, 2.0, 0.0};
476 const double p1[] = {-4,-3,-3};
477 const double p2[] = { 5, 4, 3};
478 const long nn[] = {100,100,100};
495 char vtkAmndFile [] =
"print/amnd2d.vtk";
496 char vtkMeshFileF [] =
"print/meshF.2d.vtk";
499 double rs2 [] = { 1.0, 0.0, 0.0, 0.0 };
500 eqiv_gener_1x2dI_2d (vtkAmndFile, 1.0, 0.2, rs2, 0.0, 0.0, 10.0, 0.4, 1.0, 0.5, 0.0,
DT_NUMERICAL);
512 char vtkAmndFile [] =
"print/amnd.vtk";
513 char vtkMeshFileF [] =
"print/meshF.vtk";
514 char vtkMeshFileX [] =
"print/meshX.vtk";
516 double rs [] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
519 eqiv_gener_1x3dI (vtkAmndFile, 1.0, 0.4, rs, -2.0, 0.0, 0.0, 5.0, 0.4, 4.0, 0.9, 0.8, 0.0, 0.0, 0.0,
DT_NUMERICAL);
544 char vtkAmndFile2d [] =
"clanek/grid.amnd.2d.vtk";
550 eqiv_gener_gx2dI_2d (vtkAmndFile2d, 1+2*n, 1+2*n, 2*dx, 2*dx, 1.0, 0.2, NULL, 10.0, 0.3, 1.0, 1.0,
DT_NUMERICAL , 5);
556 double p1[3]; p1[0] = -dx; p1[1] = -dx; p1[2] = 0.0;
557 double p2[3]; p2[0] = dx; p2[1] = dx; p2[2] = 0.0;
571 long nn[3]; nn[0] = nn[1] = 80; nn[2] = 0;
585 FILE *file = fopen(
"clanek/grid.2d.txt",
"w");
595 p->
matrix_giveFullStiffMatrix(sm); fprintf (file,
"%s:\t\t",
"Matrix" );
for (
int i=0; i<9; i++) fprintf (file,
" %15.8lf", sm[i]); fprintf (file,
"\n");
600 fprintf (file,
"Fraction volume: %6.2lf\n", 100*fv);
619 char vtkAmndFile [] =
"hrana_inkluze/amnd.vtk";
621 double rs [] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
624 eqiv_gener_1x3dI (vtkAmndFile, 1.0, 0.4, rs, -2.0, 0.0, 0.0, 5.0, 0.4, 1.0, 0.9, 0.8, 0.0, 0.0, 0.0,
DT_NUMERICAL);
625 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.ellipsoid.numer.3d", 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_NUMERICAL);
626 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.ellipsoid.anal.3d" , 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_ANALITICAL);
629 eqiv_gener_1x3dI (vtkAmndFile, 1.0, 0.4, rs, -2.0, 0.0, 0.0, 5.0, 0.4, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0,
DT_NUMERICAL);
630 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.sphere.numer.3d", 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_NUMERICAL);
631 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.sphere.anal.3d" , 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_ANALITICAL);
634 eqiv_gener_1x3dI (vtkAmndFile, 1.0, 0.4, rs, -2.0, 0.0, 0.0, 5.0, 0.4, 1.0, 1.0, 0.9, 0.0, 0.0, 0.0,
DT_NUMERICAL);
635 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.oblatesph.numer.3d", 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_NUMERICAL);
636 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.oblatesph.anal.3d" , 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_ANALITICAL);
639 eqiv_gener_1x3dI (vtkAmndFile, 1.0, 0.4, rs, -2.0, 0.0, 0.0, 5.0, 0.4, 1.0, 0.9, 0.9, 0.0, 0.0, 0.0,
DT_NUMERICAL);
640 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.prolatesph.numer.3d", 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_NUMERICAL);
641 print_graf(vtkAmndFile,
"hrana_inkluze/",
".1I.prolatesph.anal.3d" , 0,
'x', 0, -3.12, -2.88, 0.01,
'p', 0,
DT_ANALITICAL);
663 double p1[3] = {-x, -x, 0 };
664 double p2[3] = { x, x, 0 };
665 long nn[3] = { n, n, 0 };
680 double x,
double y,
double z,
double E,
double nu,
681 double a1,
double a2,
double a3,
double ea1,
double ea2,
double ea3,
DiffTypes dt)
715 void eqiv_gener_1x2dI_2d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double y,
double E,
double nu,
double a1,
double a2,
double ea,
DiffTypes dt)
748 void eqiv_gener_1x2dI_3d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double y,
double E,
double nu,
double a1,
double a2,
double ea,
DiffTypes dt)
782 void eqiv_gener_gx2dI_2d (
const char *vtkAmndFile,
int gx,
int gy,
double dx,
double dy,
double Em,
double num,
const double *rs,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode)
801 for (i=0; i<gx; i++) {
802 for (j=0; j<gy; j++) {
819 p->
set_problem_size( -dx*(0.5*gx - 0.5) - na*a1, -dy*(0.5*gy - 0.5) - na*a2, 0.0, dx*(0.5*gx - 0.5) + na*a1, dy*(0.5*gy - 0.5) + na*a2, 0.0, 0.05);
828 void eqiv_gener_gx2dI_3d (
const char *vtkAmndFile,
int gx,
int gy,
double dx,
double dy,
double Em,
double num,
const double *rs,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode)
847 for (i=0; i<gx; i++) {
848 for (j=0; j<gy; j++) {
872 void eqiv_gener_2x2dI_3d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode)
914 void eqiv_gener_2x2dI_2d (
const char *vtkAmndFile,
double Em,
double num,
const double *rs,
double x,
double E,
double nu,
double a1,
double a2,
DiffTypes dt,
int mode)
973 void print_graf (
const char *vtkGeomFile,
const char *path,
const char *suff,
int lc,
char axe,
int comp,
double coordMin,
double coordMax,
double coordDelta,
char pt_flag,
double dshift,
DiffTypes dt,
Bod *b,
bool odd)
977 if (coordMin >= coordMax)
errol;
980 double *
e =
new double[9];
981 double *s =
new double[9];
988 if (axe ==
'X') cind = 0;
989 else if (axe ==
'Y') cind = 1;
990 else if (axe ==
'Z') cind = 2;
993 double coords[] = { 0.0, 0.0, 0.0 };
994 coords[cind] = coordMin;
1000 bool D = comp >1 ?
false :
true;
1003 FILE * fileD; sprintf(name,
"%sgraf_lc%d_%c_displc_%d%s.dat", path, lc == 3 ? 2 : lc, axe, comp, suff);
if (D)
OpenFile(fileD, name,
_WRITE_);
1004 FILE * fileE; sprintf(name,
"%sgraf_lc%d_%c_strain_%d%s.dat", path, lc == 3 ? 2 : lc, axe, comp == 3 ? 2 : comp, suff);
OpenFile(fileE, name,
_WRITE_);
1005 FILE * fileS; sprintf(name,
"%sgraf_lc%d_%c_stress_%d%s.dat", path, lc == 3 ? 2 : lc, axe, comp == 3 ? 2 : comp, suff);
OpenFile(fileS, name,
_WRITE_);
1011 if (b[i].coord[cind] < coordMin || coordMax < b[i].coord[cind])
continue;
1012 for (
int aa=0; aa<2; aa++) {
1015 if (aa==0 && D) fprintf (fileD,
"%lf\t%lf\n", b[i].coord[cind], d[comp] + dshift);
1016 ; fprintf (fileE,
"%lf\t%lf\n", b[i].coord[cind], e[comp]);
1017 ; fprintf (fileS,
"%lf\t%lf\n", b[i].coord[cind], s[comp]);
1019 if (b[i].mat[0] != 0 && b[i].mat[1] != 0 && b[i].mat[0] != b[i].mat[1]) {
1020 if (b[i].mat[0] > 9 && b[i].mat[1] > 9)
break;
1021 if(aa==0) out = out ?
false :
true;
1028 while (b[i++].last !=
true);
1031 double toler = 1.e-3;
1032 if (3*toler > coordDelta) toler = 0.2 * coordDelta;
1033 long pic_old, pic, picreq;
1036 bool doublep =
false;
1039 while (coords[cind] - coordMax < 0.1*coordDelta ) {
1047 if (pic != pic_old) {
1049 if (pic_old == -1) {
1067 if (D) fprintf (fileD,
"%lf\t%lf\n", coords[cind], d[comp] + dshift);
1068 ; fprintf (fileE,
"%lf\t%lf\n", coords[cind], e[comp]);
1069 ; fprintf (fileS,
"%lf\t%lf\n", coords[cind], s[comp]);
1072 if (!adapt) coords[cind] = coordMin + (++n)*coordDelta;
1073 else coords[cind] += coordDelta;
1108 sprintf (name,
"%sANSYS/rslts_lc%d/list.%c.nodes.txt", path, lc, axe);
1109 file =
_openFileN(
"r",
"ansys coords file", name);
1113 fscanf(file,
"%ld", &nNodes);
1116 Res =
new Bod[nNodes];
1117 memset(Res, 0, nNodes*
sizeof(
Bod));
1119 for (i = 0; i < nNodes; i++) {
1123 fscanf(file,
"%d", &Res[i].ID);
1124 fscanf(file,
"%lf %lf %lf", &Res[i].coord[0], &Res[i].coord[1], &Res[i].coord[2]);
1131 sprintf (name,
"%sANSYS/rslts_lc%d/list.%c.%s.txt", path, lc, axe, strn ?
"strain" :
"stress");
1132 file =
_openFileN(
"r",
"ansys result file", name);
1137 fscanf(file,
"%d", ¤t_mat);
1146 fscanf(file,
"%d", ¤t_node);
1147 for (i = 0; i < nNodes; i++) {
1148 if (current_node == Res[i].ID) {
1150 if (Res[i].mat[0] != 0) {
1151 if (Res[i].mat[1] != 0)
errol;
1155 Res[i].
mat[pos] = current_mat;
1156 for (j = 0; j < 6; j++)
1157 fscanf(file,
"%lf", &Res[i].rslt[pos][j]);
1166 else if (c ==
'1') {
1168 fscanf(file,
"%d", ¤t_mat);
1178 if (axe ==
'X') { coord_index = 0; std::sort(Res, Res + nNodes, &
compare_x); }
1179 else if (axe ==
'Y') { coord_index = 1; std::sort(Res, Res + nNodes, &
compare_y); }
1183 sprintf (name,
"%sgraf_lc%d_%c_%s_%d.ansys.dat", path, lc, axe, strn ?
"strain" :
"stress", comp == 3 ? 2 : comp);
1187 if (axe ==
'X') cind = 0;
1188 else if (axe ==
'Y') cind = 1;
1189 else if (axe ==
'Z') cind = 2;
1192 for (i = 0; i < nNodes; i++) {
1193 if (Res[i].coord[cind] < coordMin || coordMax < Res[i].coord[cind])
continue;
1195 if (Res[i].mat[0] != 0 && Res[i].mat[1] != 0) {
1198 if (Res[i - 1].mat[0] == Res[i].mat[0]) {
1199 fprintf(file,
"%lf\t%lf\n", Res[i].coord[coord_index], Res[i].rslt[0][comp]);
1200 fprintf(file,
"%lf\t%lf\n", Res[i].coord[coord_index], Res[i].rslt[1][comp]);
1203 else if (Res[i - 1].mat[0] == Res[i].mat[1]) {
1204 fprintf(file,
"%lf\t%lf\n", Res[i].coord[coord_index], Res[i].rslt[1][comp]);
1205 fprintf(file,
"%lf\t%lf\n", Res[i].coord[coord_index], Res[i].rslt[0][comp]);
1211 fprintf(file,
"%lf\t%lf\n", Res[i].coord[coord_index], Res[i].rslt[0][comp]);
1212 else if (Res[i].mat[1])
1213 fprintf(file,
"%lf\t%lf\n", Res[i].coord[coord_index], Res[i].rslt[1][comp]);
1224 if (half) nn = nNodes-1;
1227 b =
new Bod[nNodes + nn];
1228 memcpy (b+nn, Res,
sizeof(
Bod));
1230 for (i = 1; i < nNodes; i++) {
1231 ; memcpy (b+nn+i, Res+i,
sizeof(
Bod));
1232 if (half) { memcpy (b+nn-i, Res+i,
sizeof(
Bod));
1233 b[nn-i].
coord[coord_index] *= -1; }
1236 b[nn + nNodes-1].
last =
true;
1252 sprintf (name,
"%sANSYS/rslts_lc%d/list.%c.nodes.txt", path, lc, axe);
1253 file =
_openFileN(
"r",
"ansys coords file", name);
1257 fscanf(file,
"%ld", &nNodes);
1260 Res =
new Bod[nNodes];
1261 memset(Res, 0, nNodes*
sizeof(
Bod));
1263 for (i = 0; i < nNodes; i++) {
1267 fscanf(file,
"%d", &Res[i].ID);
1268 fscanf(file,
"%lf %lf %lf", &Res[i].coord[0], &Res[i].coord[1], &Res[i].coord[2]);
1275 sprintf (name,
"%sANSYS/rslts_lc%d/list.%c.%s.txt", path, lc, axe,
"displ");
1276 file =
_openFileN(
"r",
"ansys result file", name);
1287 fscanf(file,
"%d", ¤t_node);
1288 for (i = 0; i < nNodes; i++) {
1289 if (current_node == Res[i].ID) {
1291 for (j = 0; j < 4; j++)
1292 fscanf(file,
"%lf", &Res[i].disp[j]);
1301 else if (c ==
'1') {
1312 if (axe ==
'X') { coord_index = 0; std::sort(Res, Res + nNodes, &
compare_x); }
1313 else if (axe ==
'Y') { coord_index = 1; std::sort(Res, Res + nNodes, &
compare_y); }
1317 sprintf (name,
"%sgraf_lc%d_%c_%s_%d.ansys.dat", path, lc, axe,
"displc", comp);
1321 if (axe ==
'X') cind = 0;
1322 else if (axe ==
'Y') cind = 1;
1323 else if (axe ==
'Z') cind = 2;
1326 for (i = 0; i < nNodes; i++) {
1327 if (Res[i].coord[cind] < coordMin || coordMax < Res[i].coord[cind])
continue;
1329 fprintf(file,
"%lf\t%lf\n", Res[i].coord[coord_index], Res[i].disp[comp]);
1347 double r1 = ax[1] * 1.01;
1348 double r2 = ax[1] * 4.5;
1349 double dr = ax[1] * 0.005;
1350 int boduu = round((r2 - r1) / dr + 1);
1351 int bodu = 360 * boduu;
1354 points2D =
new double*[bodu];
1355 points3D =
new double*[bodu];
1356 for (i = 0; i < bodu; i++)points2D[i] =
new double[3];
1357 for (i = 0; i < bodu; i++)points3D[i] =
new double[3];
1358 for (i = 0; i < 360; i++)
for (j = 0; j < boduu; j++){
1359 points2D[i * boduu + j][0] = (r1 + dr*j)*cos(
PI*i / 180);
1360 points2D[i * boduu + j][1] = (r1 + dr*j)*sin(
PI*i / 180);
1361 points2D[i * boduu + j][2] = 0.;
1362 points3D[i * boduu + j][0] = 0.;
1363 points3D[i * boduu + j][1] = (r1 + dr*j)*cos(
PI*i / 180);
1364 points3D[i * boduu + j][2] = (r1 + dr*j)*sin(
PI*i / 180);
1384 Problem *analFce2D, *analFce3D;
1389 strain_2D =
new double*[nlc];
1390 for (i = 0; i < nlc; i++)strain_2D[i] =
new double[4];
1392 stress_2D =
new double*[nlc];
1393 for (i = 0; i < nlc; i++)stress_2D[i] =
new double[4];
1395 disp_2D =
new double*[nlc];
1396 for (i = 0; i < nlc; i++)disp_2D[i] =
new double[2];
1399 strain_3D =
new double*[nlc];
1400 for (i = 0; i < nlc; i++)strain_3D[i] =
new double[9];
1402 stress_3D =
new double*[nlc];
1403 for (i = 0; i < nlc; i++)stress_3D[i] =
new double[9];
1405 disp_3D =
new double*[nlc];
1406 for (i = 0; i < nlc; i++)disp_3D[i] =
new double[3];
1411 double rs2D[] = { 1.0, 0.0, 0.0, 0.0 };
1412 double rs3D[] = { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 };
1416 printf(
"Starting the measurement...\n");
1441 printf(
"Measuring 2D numerical diff...\n");
1464 times[0] = (tb - ta) / (
double)CLOCKS_PER_SEC;
1465 printf(
"It took %.2lf seconds.\n", times[0]);
1468 printf(
"Measuring 3D numerical diff...\n");
1474 analFce3D->
set_inclusion_all(0, 0, 0, 0, 2.4, 0.3, ax[0], ax[1], ax[2], 0, 30, 0);
1487 times[1] = (tb - ta) / (
double)CLOCKS_PER_SEC;
1488 printf(
"It took %.2lf seconds.\n", times[1]);
1491 printf(
"Measuring 3D analytical diff...\n");
1497 analFce3D->
set_inclusion_all(0, 0, 0, 0, 2.4, 0.3, ax[0], ax[1], ax[2], 0, 30, 0);
1510 times[2] = (tb - ta) / (
double)CLOCKS_PER_SEC;
1511 printf(
"It took %.2lf seconds.\n", times[2]);
1514 printf(
"Measuring 3D complex diff...\n");
1520 analFce3D->
set_inclusion_all(0, 0, 0, 0, 2.4, 0.3, ax[0], ax[1], ax[2], 0, 30, 0);
1533 times[3] = (tb - ta) / (
double)CLOCKS_PER_SEC;
1534 printf(
"It took %.2lf seconds.\n", times[3]);
1537 double ref = times[2];
1538 printf(
"\n2D ND: %.1lf\n3D ND: %.1lf\n3D AD: %.1lf\n3D CD: %.1lf\n", times[0] / ref * 100, times[1] / ref * 100, times[2] / ref * 100, times[3] / ref * 100);
1541 void createNodes(
double a,
double b,
double c,
double da,
double db,
double dc,
double **&points,
int &n) {
1544 na = round((2.*a / da + 1));
1545 nb = round((2.*b / db + 1));
1546 nc = round((2.*c / dc + 1));
1548 points =
new double*[n];
1549 for (i = 0; i < n; i++)points[i] =
new double[3];
1551 for (ia = 0; ia < na; ia++)
for (ib = 0; ib < nb; ib++)
for (ic = 0; ic < nc; ic++) {
1552 points[id][0] = -a + ia*da;
1553 points[id][1] = -b + ib*db;
1554 points[id][2] = -c + ic*dc;
1567 double a = 10., b = 10., c = 10., da = .5, db = .5, dc = .5;
1574 strain_3D =
new double*[nlc];
1575 for (i = 0; i < nlc; i++)strain_3D[i] =
new double[9];
1577 stress_3D =
new double*[nlc];
1578 for (i = 0; i < nlc; i++)stress_3D[i] =
new double[9];
1580 disp_3D =
new double*[nlc];
1581 for (i = 0; i < nlc; i++)disp_3D[i] =
new double[3];
1584 double rs3D[] = { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 };
1586 if (difftype ==
DT_NUMERICAL)printf(
"NUMERICAL DIFF\n");
1588 if (difftype ==
DT_COMPLEX)printf(
"COMPLEX DIFF\n");
1592 printf(
"Computing 3D Ellipsoid...\n");
1597 analFce->
set_inclusion_all(0, 0, 0, 0, 2.4, 0.3, 8., 5., 4., 20., 30., 50.);
1607 for (i = 0; i < bodu; i++)
delete []points[i];
1612 printf(
"Computing 3D Sphere...\n");
1617 analFce->
set_inclusion_all(0, 0, 0, 0, 2.4, 0.3, 5., 5., 5., 20., 30., 50.);
1627 for (i = 0; i < bodu; i++)
delete[]points[i];
1672 printf(
"Computing 3D Oblate spheroid...\n");
1677 analFce->
set_inclusion_all(0, 0, 0, 0, 2.4, 0.3, 5., 5., 2., 20., 30., 50.);
1687 for (i = 0; i < bodu; i++)
delete[]points[i];
1692 printf(
"Computing 3D Prolate spheroid...\n");
1697 analFce->
set_inclusion_all(0, 0, 0, 0, 2.4, 0.3, 8., 5., 5., 20., 30., 50.);
1707 for (i = 0; i < bodu; i++)
delete[]points[i];
1774 void intersection_3d_core (
double c1x,
double c1y,
double c1z,
double a1x,
double a1y,
double a1z,
double e1x,
double e1y,
double e1z,
1775 double c2x,
double c2y,
double c2z,
double a2x,
double a2y,
double a2z,
double e2x,
double e2y,
double e2z,
1776 bool expected,
bool ee,
const char *s)
1786 double rs [] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
1792 p->
set_inclusion_all (0, c1x, c1y, c1z, 5.0, 0.4, a1x, a1y, a1z, e1x, e1y, e1z);
1793 p->
set_inclusion_all (1, c2x, c2y, c2z, 5.0, 0.4, a2x, a2y, a2z, e2x, e2y, e2z);
1804 if (ee ==
false || (ee ==
true && expected ==
false)) {
1805 printf (
" NOT CONVERGED %s", s);
1810 if ((
bool)result != expected) {
1811 printf (
" \nERRORR - expectation of overlap is %s\n", expected ?
"YES" :
"NO");
1816 printf (
" OK%s", s);
1829 Problem *analFce2D, *analFce3D;
1831 const double rs2d[] = { 1.0, 0.0, 0.0, 0.0 };
1832 const double rs3d[] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
1834 double *point =
new double[3];
1839 double *displc_2D =
new double[2];
double *displc_3D =
new double[3];
1840 double *strain_2D =
new double[4];
double *strain_3D =
new double[9];
1841 double *stress_2D =
new double[4];
double *stress_3D =
new double[9];
1843 int _2D[] = { 0, 3, 1 };
1844 int _3D[] = { 0, 4, 1 };
1846 double **results = NULL;
1852 char vtkAmndFile2d [] =
"rotation/amnd.2d.vtk";
1853 char vtkAmndFile3d [] =
"rotation/amnd.3d.vtk";
1854 for (
int ii = 0; ii <= 180; ii++){
1856 eqiv_gener_1x2dI_2d (vtkAmndFile2d, 1.0, 0.4, rs2d, 0.0, 0.0, 2.4, 0.3, 1.0, 0.5, ii*1.0, dt2d);
1857 eqiv_gener_1x2dI_3d (vtkAmndFile3d, 1.0, 0.4, rs3d, 0.0, 0.0, 2.4, 0.3, 1.0, 0.5, ii*1.0, dt3d);
1859 analFce2D = (
new Problem())->read_inclusions_plus_initialize_and_print (vtkAmndFile2d, NULL, dt2d);
1860 analFce3D = (
new Problem())->read_inclusions_plus_initialize_and_print (vtkAmndFile3d, NULL, dt3d);
1865 for (k = 0; k < 3; k++){
1866 results[ii][2 * k ] = strain_2D[_2D[k]];
1867 results[ii][2 * k + 1] = strain_3D[_3D[k]];
1869 for (k = 0; k < 3; k++){
1870 results[ii][2 * k + 6] = stress_2D[_2D[k]];
1871 results[ii][2 * k + 7] = stress_3D[_3D[k]];
1873 for (k = 0; k < 2; k++){
1874 results[ii][2 * k + 12] = displc_2D[k];
1875 results[ii][2 * k + 13] = displc_3D[k];
1881 char name[10], filename2d[25], filename3d[25];
1883 for (index = 0; index < 8; index++) {
1884 if (index == 0) sprintf(name,
"strain1");
1885 if (index == 1) sprintf(name,
"strain2");
1886 if (index == 2) sprintf(name,
"strain3");
1887 if (index == 3) sprintf(name,
"stress1");
1888 if (index == 4) sprintf(name,
"stress2");
1889 if (index == 5) sprintf(name,
"stress3");
1890 if (index == 6) sprintf(name,
"disp1");
1891 if (index == 7) sprintf(name,
"disp2");
1893 sprintf (filename2d,
"./rotation/%s.2d.dat", name);
1894 sprintf (filename3d,
"./rotation/%s.3d.dat", name);
1895 o2 = fopen(filename2d,
"wt");
1896 o3 = fopen(filename3d,
"wt");
1897 for (i = 0; i <= 180; i++) {
1898 fprintf(o2,
"%d %.14lf\n", i, results[i][2 * index ]);
1899 fprintf(o3,
"%d %.14lf\n", i, results[i][2 * index + 1]);
1909 double a1x,
double a1y,
double a1z,
double g1x,
double g1y,
double g1z,
double e1x,
double e1y,
double e1z,
1910 double a2x,
double a2y,
double a2z,
double g2x,
double g2y,
double g2z,
double e2x,
double e2y,
double e2z)
1912 double e = 0.01 * (a1y+a2y)/2.0;
1915 cx + (g1x+g2x ), cy , cz , a2x,a2y,a2z, e2x,e2y,e2z,
true ,
true,
"");
1917 cx + (g1x+g2x+e), cy , cz , a2x,a2y,a2z, e2x,e2y,e2z,
false,
true,
"");
1919 cx - (g1x+g2x ), cy , cz , a2x,a2y,a2z, e2x,e2y,e2z,
true ,
true,
"");
1921 cx - (g1x+g2x+e), cy , cz , a2x,a2y,a2z, e2x,e2y,e2z,
false,
true,
" ");
1924 cx , cy + (g1y+g2y ), cz , a2x,a2y,a2z, e2x,e2y,e2z,
true ,
true,
"");
1926 cx , cy + (g1y+g2y+e), cz , a2x,a2y,a2z, e2x,e2y,e2z,
false,
true,
"");
1928 cx , cy - (g1y+g2y ), cz , a2x,a2y,a2z, e2x,e2y,e2z,
true ,
true,
"");
1930 cx , cy - (g1y+g2y+e), cz , a2x,a2y,a2z, e2x,e2y,e2z,
false,
true,
" ");
1933 cx , cy , cz + (g1z+g2z ), a2x,a2y,a2z, e2x,e2y,e2z,
true ,
true,
"");
1935 cx , cy , cz + (g1z+g2z+e), a2x,a2y,a2z, e2x,e2y,e2z,
false,
true,
"");
1937 cx , cy , cz - (g1z+g2z ), a2x,a2y,a2z, e2x,e2y,e2z,
true ,
true,
"");
1939 cx , cy , cz - (g1z+g2z+e), a2x,a2y,a2z, e2x,e2y,e2z,
false,
true,
" \n");
1943 double a1x,
double a1y,
double a1z,
double g1x,
double g1y,
double g1z,
double e1x,
double e1y,
double e1z,
1944 double a2x,
double a2y,
double a2z)
1946 intersection_3d_core_6 (cx,cy,cz, a1x,a1y,a1z, g1x,g1y,g1z, e1x,e1y,e1z, a2x,a2y,a2z, a2x, a2y, a2z, 0.0, 0.0, 0.0);
1947 intersection_3d_core_6 (cx,cy,cz, a1x,a1y,a1z, g1x,g1y,g1z, e1x,e1y,e1z, a2x,a2y,a2z, a2y, a2x, a2z, 0.0, 0.0, 90.0);
1948 intersection_3d_core_6 (cx,cy,cz, a1x,a1y,a1z, g1x,g1y,g1z, e1x,e1y,e1z, a2x,a2y,a2z, a2y, a2z, a2x, 0.0, 90.0, 90.0);
1949 intersection_3d_core_6 (cx,cy,cz, a1x,a1y,a1z, g1x,g1y,g1z, e1x,e1y,e1z, a2x,a2y,a2z, a2x, a2z, a2y, 0.0, 90.0, 0.0);
1950 intersection_3d_core_6 (cx,cy,cz, a1x,a1y,a1z, g1x,g1y,g1z, e1x,e1y,e1z, a2x,a2y,a2z, a2z, a2x, a2y, 90.0, 90.0, 0.0);
1951 intersection_3d_core_6 (cx,cy,cz, a1x,a1y,a1z, g1x,g1y,g1z, e1x,e1y,e1z, a2x,a2y,a2z, a2z, a2y, a2x, 90.0, 90.0, 90.0);
1955 double a1x,
double a1y,
double a1z,
1956 double a2x,
double a2y,
double a2z)
1958 intersection_3d_core_6x6 (cx,cy,cz, a1x,a1y,a1z, a1x, a1y, a1z, 0.0, 0.0, 0.0, a2x,a2y,a2z);
1959 intersection_3d_core_6x6 (cx,cy,cz, a1x,a1y,a1z, a1y, a1x, a1z, 0.0, 0.0, 90.0, a2x,a2y,a2z);
1960 intersection_3d_core_6x6 (cx,cy,cz, a1x,a1y,a1z, a1y, a1z, a1x, 0.0, 90.0, 90.0, a2x,a2y,a2z);
1961 intersection_3d_core_6x6 (cx,cy,cz, a1x,a1y,a1z, a1x, a1z, a1y, 0.0, 90.0, 0.0, a2x,a2y,a2z);
1962 intersection_3d_core_6x6 (cx,cy,cz, a1x,a1y,a1z, a1z, a1x, a1y, 90.0, 90.0, 0.0, a2x,a2y,a2z);
1963 intersection_3d_core_6x6 (cx,cy,cz, a1x,a1y,a1z, a1z, a1y, a1x, 90.0, 90.0, 90.0, a2x,a2y,a2z);
1969 printf (
"\n TOOLS - 3D intersection:\n");
1971 double cx = 0.0, cy = 0.0, cz = 0.0;
1972 double a1x = 3.0, a1y = 2.0, a1z = 1.0;
1973 double a2x = 3.0, a2y = 2.0, a2z = 1.0;
1983 cx + 4.24 , cy + 2.0, cz + 1.0, 3.0, 2.0, 1.0, 0.0, 0.0, 0.0,
true ,
false,
"\n");
1985 cx + 4.26 , cy + 2.0, cz + 1.0, 3.0, 2.0, 1.0, 0.0, 0.0, 0.0,
false,
false,
"\n");
1989 cx + 4.35 , cy + 2.0, cz + 1.0, 2.0, 2.0, 2.0, 0.0, 0.0, 0.0,
true ,
false,
"\n");
1991 cx + 4.40 , cy + 2.0, cz + 1.0, 2.0, 2.0, 2.0, 0.0, 0.0, 0.0,
false,
false,
"\n");
1996 cx + 1.68 , cy + 2.0, cz + 1.0, 3.0, 2.0, 1.0, 90.0, 90.0, 90.0,
true ,
false,
"\n");
1998 cx + 1.70 , cy + 2.0, cz + 1.0, 3.0, 2.0, 1.0, 90.0, 90.0, 90.0,
false,
false,
"\n");
2008 double c2x,
double c2y,
double a2x,
double a2y,
double e2,
2009 bool expected,
const char *s)
2019 double rs [] = { 1.0, 0.0, 0.0, 0.0 };
2036 if (result != expected) {
2037 printf (
" \nERRORR - expectation of overlap is %s\n", expected ?
"YES" :
"NO");
2041 printf (
" OK%s", s);
2047 double a1x,
double a1y,
double g1x,
double g1y,
double e1,
2048 double a2x,
double a2y,
double g2x,
double g2y,
double e2)
2050 double e = 0.01 * (a1y+a2y)/2.0;
2053 cx + (g1x+g2x ), cy , a2x,a2y, e2,
true ,
"");
2055 cx + (g1x+g2x+e), cy , a2x,a2y, e2,
false,
"");
2057 cx - (g1x+g2x ), cy , a2x,a2y, e2,
true ,
"");
2059 cx - (g1x+g2x+e), cy , a2x,a2y, e2,
false,
" ");
2062 cx , cy + (g1y+g2y ), a2x,a2y, e2,
true ,
"");
2064 cx , cy + (g1y+g2y+e), a2x,a2y, e2,
false,
"");
2066 cx , cy - (g1y+g2y ), a2x,a2y, e2,
true ,
"");
2068 cx , cy - (g1y+g2y+e), a2x,a2y, e2,
false,
" ");
2075 printf (
"\n TOOLS - 2D intersection:\n");
2077 double cx = 0.0, cy = 0.0;
2078 double a1x = 5.0, a1y = 2.0;
2079 double a2x = 4.0, a2y = 1.5;
2082 intersection_2d_core_4 (cx, cy, a1x, a1y, a1x, a1y, 0.0, a2x, a2y, a2x, a2y, 0.0);
2083 intersection_2d_core_4 (cx, cy, a1x, a1y, a1x, a1y, 0.0, a2x, a2y, a2y, a2x, 90.0);
2084 intersection_2d_core_4 (cx, cy, a1x, a1y, a1y, a1x, 90.0, a2x, a2y, a2x, a2y, 0.0);
2085 intersection_2d_core_4 (cx, cy, a1x, a1y, a1y, a1x, 90.0, a2x, a2y, a2y, a2x, 90.0);
2089 cx - 4.62, cy + 3.0, a2x,a2y, 0.0,
true ,
"\n");
2091 cx - 4.66, cy + 3.0, a2x,a2y, 0.0,
false,
"\n");
2094 cx - 3.952, cy + 2.0, a2x,a2y, 110.0,
true ,
"\n");
2096 cx - 3.952, cy + 2.0, a2x,a2y, 109.0,
false,
"\n");
2099 cx - 4.50, cy + 2.0, a2x,a2y, 40.0,
true ,
"\n");
2101 cx - 4.52, cy + 2.0, a2x,a2y, 40.0,
false,
"\n");
2123 double rs1 [] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
2146 double minCoord = -4.0;
2147 double maxCoord = 4.0;
2150 double result[6] = { 0., 0., 0., 0., 0., 0. };
2157 for (i = 0; i < 2; i++) {
2158 sprintf(name,
"pokus_graf_2.0_X_%02ld.dat", i);
OpenFile(out1, name,
_WRITE_);
2159 sprintf(name,
"pokus_graf_2.0_Y_%02ld.dat", i);
OpenFile(out2, name,
_WRITE_);
2161 double coord = minCoord;
2163 while (coord <= maxCoord) {
2164 x[0] = x[1] = x[2] = 0.0;
2169 fprintf(out1,
"%e\t%e\n", x[i], result[0]);
2170 fprintf(out2,
"%e\t%e\n", x[i], result[1]);
void set_Euller_angles_deg(double x)
void set_centroids(double x, double y)
void input_data_initialize_and_check_consistency(void)
Initializes and checks consistency of all input data. This function has to be called after data input...
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...
bool point_is_inside(const double *coords, double epsilon=0.0) const
Function returns the position of a given point related to an inclusion.
bool FP_skip_expected_string(FILE *src, const char *expctd, bool cs)
... word and compare with expected one
void set_dimension(int d)
file of various types and symbolic constant definitions
bool FP_skip_line(FILE *stream, int n)
move file descriptor to the start of the n-th new line //[former read_line]
void set_inclusion_semiaxesDimensions(long id, double a1, double a2, double a3=0.0)
Sets the id -th inclusion sorted semiaxes dimensions [a1,a2,a3]. The a3 dimension is ignored in the c...
void set_inclusion_shape(long id, InclusionGeometry shape)
Sets the id -th inclusion shape. Default shape is detected automaticly.
Problem * read_inclusions_plus_initialize_and_print(const char *inclusion_file, const char *equiv_file, DiffTypes dt)
Original Honza Novak's balancing.
#define _openFileN(_1, _2, _3)
static void give_energy_MM()
compute energy of mumech solution
void find_inclusions_in_BB(void)
void give_StiffnessMatrixFull(double *answer) const
Copy stiffness tensor into full matrix answer.
void set_inclusion_E_nu(long id, double E, double nu)
Sets the id -th inclusion material properties, Young's modulus E and Poissons ratio nu...
void CloseFile(FILE *file)
description: function closes a previously opened file and tests the succes of the closing note: funct...
void print_equivalent_problem(const char *filename)
Prints the equivalent problem record into the VTK file.
Class of function for homogenization of stress fields.
void set_problem_size(double a1, double a2, double a3, double b1, double b2, double b3, double node_distance)
Inclusion * give_inclusion(long i) const
debug, for one function in tools
void set_inclusion_EulerAnglesDEG(long id, double e1, double e2=0.0, double e3=0.0)
Sets the id -th inclusion Euler angles [e1,e2,e3] given in degrees. The e2 and e3 angles are ignored ...
void set_Inclusion_shape(InclusionGeometry val)
void set_Semiaxes_dimensions(double x, double y)
Class mElement, mesh element.
void set_RemoteStrain(int id, const double *rs)
Sets the id -th remote strain, rs is row-by-row matrix of dimensions 2x2 or 3x3 for 2d or 3d problem...
void set_inclusion_centroids(long id, double x, double y, double z=0.0)
Sets the id -th inclusion centroids [x,y,z]. The z coordinate is ignored in the case of 2 dimensions...
void set_boundingBox(double x1, double y1, double x2, double y2)
void set_SBA_optimized(bool val)
Set type of self-balancing algorithm.
void matrix_giveFullStiffMatrix(double *m) const
void set_number_of_inclusions(long n)
Sets number of inclusions.
VOIGHT / engineering notation saved in FEEP order.
void set_SBAM(SBAtype val)
static double cmp_mm_ansys_total_energy(const char *basename, const char *vtkGeomFile, int lc)
void read_geometry_file_vtk(const char *vtkMeshFile, int pid, int lc, bool add)
Read input file with mesh geometry from vtk file.
long give_inclusion_with_point_inside(const double *coords, double epsilon=0.0) const
Returns inclusion ID inside the point lays.
void set_data_set(void)
Function switches bool flag data_set on true. That indicates start of the process of data input...
void set_matrix_E_nu(double E, double nu)
Sets problem dimension.
double giveTotalVolumeFractionOfInclusions(void) const
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 ...
Class HomogenizationMethods.
static bool ellipses_overlap(const Inclusion *inc1, const Inclusion *inc2)
void give_ovlivneni(const double *coords, double *result)
Funkce pro zkoumani ucinku inkluze na druhou v balancovacim algoritmu. Casem smazat, pac balancing se asi nebude pouzivat.
void set_diffType(DiffTypes val)
Sets type of differentiation, analytical by default.
Homogenization * give_new_homogenization(HomogenizationType ht)
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; white space can be ...
bool areSame(double abszero, double relzero, double a, double b)
Mesh * give_new_mesh(void)
Give verbose level.
bool file_delete_if_exist(const char *name)
void set_inclusion_all(long id, double x, double y, double e, double n, double a1, double a2, double e1)
Agregates ...
void DeleteArray2D(bool **array, long d1)
Function deletes a 2D 'bool' array of dimension d1 x ??, allocated by new.
void printFieldsOnMeshGrid(const char *mesh_file_out, const double *p1, const double *p2, const long *n, char ptFlag, int rs, int nrs, PFCmode pfcMode=PFCM_OPTIMIZED) const
Function computes all fields (displacements, strains and stresses) in nodes a regular orthogonal mesh...
virtual void giveHomogenizedStiffnessMatrix(double *answer)=0
Function returning the homogenized stiffness matrix according the defined method termitovo pridat par...
double ** AllocateArray2D(long d1, long d2)
Operations with 2d, 3d, 4d arrays of various sizes.
void print_visualization(const char *filename, int n, int dim=0, bool refined=false)
Triangulates inclusions surfaces and prints filename VTK file.
void set_Youngs_modulus(double val)
void read_input_file(const char *filename)
Reads filename VTK input file containing inclusion geometry and topology.
Class of function for ... homogenization.
void OpenFile(FILE **file, char *name, const char mode[])
Operations with file descriptors.
void printFieldsOnMeshVTK(const char *mesh_file_out, const char *mesh_file, char ptFlag, int rs, int nrs, PFCmode pfcMode=PFCM_OPTIMIZED) const
Function computes all fields (displacements, strains and stresses) in nodes a mesh given via VTK file...
Class Mesh contains and handles all mesh data.
virtual const char * giveClassName()
Function returning class name.
static int ellipsoids_overlap(const Inclusion *inc1, const Inclusion *inc2)
void set_Poissons_ratio(double val)
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.
void CleanVector(double *a, long n)
Functin cleans a 'double' vector, initialize each value being 0-zero.
void set_intFieldsShape(int val)
void set_UnitRemoteStrains(void)
Function sets a set of unit remote strains.
void set_numberOfRemoteStrains(int n)
Sets number of remote strains.
long giveFieldsOfPointOneRS(double *displc, double *strain, double *stress, const double *coords, char ptFlag, int rs, PFCmode pfcMode=PFCM_OPTIMIZED, long reqIncl=-3, STRNotation tn=STRN_THEORETICAL_ROW) const
Function gives results for only one remote strain. See function giveFieldsOfPoint().
void convert_to_equivalent_problem(void)
Converts the given heterogeneous problem to the equivalent problem.