65 #define maxNumberOfMeshes 1000 66 Problem :: Problem (
void) : Problems ()
70 data_equivalent =
false;
74 matrix =
new MatrixRecord (
this);
84 approx_point_pos1 = 0.99;
99 min_axes_diff_change =
true;
100 max_axes_diff_change =
false;
103 totalNoActingIncls = 0;
115 Problem :: ~Problem ()
117 for (
int i=0; i<noIncl; i++)
delete inclusions[i];
118 delete [] inclusions;
120 if (meshes) {
for (
int i=0; i<
maxNumberOfMeshes; i++)
delete meshes[i];
delete [] meshes; }
121 if (homogs) {
for (
int i=0; i<
maxNumberOfMeshes; i++)
delete homogs[i];
delete [] homogs; }
127 void Problem :: input_data_initialize_and_check_consistency (
void)
129 for (
int i=0; i<noIncl; i++)
130 inclusions[i]->input_data_initialize_and_check_consistency();
136 void Problem :: set_number_of_inclusions (
long n)
139 if (twodim) { inclusions =
new Inclusion*[noIncl];
for (
int i=0; i<noIncl; i++) inclusions[i] =
new InclusionRecord2D(i,
this); }
147 void Problem :: generate_equiv_1x2dI_2d (
double Em,
double num,
const double *rs,
double x,
double y,
double E,
double nu,
double a1,
double a2,
double ea,
DiffTypes dt)
151 this->set_data_set();
152 this->set_dimension(2);
153 this->set_diffType(dt);
154 this->set_matrix_E_nu(Em, num);
156 this->set_numberOfRemoteStrains(1);
157 this->set_RemoteStrain(0, rs);
160 this->set_UnitRemoteStrains();
163 this->set_number_of_inclusions(1);
165 this->set_inclusion_centroids(0, x, y);
166 this->set_inclusion_E_nu(0, E, nu);
167 this->set_inclusion_semiaxesDimensions(0, a1, a2);
168 this->set_inclusion_EulerAnglesDEG(0, ea);
170 this->input_data_initialize_and_check_consistency();
173 this->convert_to_equivalent_problem();
178 void Problem :: set_approximation (
int val)
180 if (val < 0 || val>2)
_errorr(
"Wrong approximation value.");
181 if (this->approximation > 0)
_errorr(
"Another approximation is already set. It can be set only once.");
183 int n_approximations = 0;
185 this->approximation = val;
192 n_points = this->give_dimension() * 2 + 1;
193 n_approximations = this->give_dimension();
194 for (
int i = 0; i < noIncl; i++) {
195 this->inclusions[i]->n_approx_points = n_points;
197 this->inclusions[i]->approx_points_eps_tau =
AllocateArray2D(n_points, this->give_VM_TENS_RANGE());
198 this->inclusions[i]->approx_coef =
new double**[this->give_nLC()];
199 for (
int j = 0; j < this->give_nLC(); j++) {
200 this->inclusions[i]->approx_coef[j] =
new double*[n_approximations];
201 for (
int k = 0; k < n_approximations; k++) {
202 this->inclusions[i]->approx_coef[j][k] =
new double[this->give_VM_TENS_RANGE()];
203 for (
int ii = 0; ii < this->give_VM_TENS_RANGE(); ii++)this->inclusions[i]->approx_coef[j][k][ii] = 0.;
206 CleanArray2d(this->inclusions[i]->approx_points, n_points, 3);
207 CleanArray2d(this->inclusions[i]->approx_points_eps_tau, n_points, this->give_VM_TENS_RANGE());
209 this->inclusions[i]->approx_points[1][0] -= approx_point_pos1*this->inclusions[i]->a[0];
210 this->inclusions[i]->approx_points[2][0] += approx_point_pos1*this->inclusions[i]->a[0];
211 this->inclusions[i]->approx_points[3][1] -= approx_point_pos1*this->inclusions[i]->a[1];
212 this->inclusions[i]->approx_points[4][1] += approx_point_pos1*this->inclusions[i]->a[1];
213 if (this->give_dimension() == 3) {
214 this->inclusions[i]->approx_points[5][2] -= approx_point_pos1*this->inclusions[i]->a[2];
215 this->inclusions[i]->approx_points[6][2] += approx_point_pos1*this->inclusions[i]->a[2];
217 for (
int j = 0; j < n_points; j++)this->inclusions[i]->transformCoords_L2G(this->inclusions[i]->approx_points[j], this->inclusions[i]->approx_points[j]);
221 if (this->give_dimension() == 2) {
223 n_approximations = 5;
227 n_approximations = 9;
229 for (
int i = 0; i < noIncl; i++) {
230 this->inclusions[i]->n_approx_points = n_points;
232 this->inclusions[i]->approx_points_eps_tau =
AllocateArray2D(n_points, this->give_VM_TENS_RANGE());
233 this->inclusions[i]->approx_coef =
new double**[this->give_nLC()];
234 for (
int j = 0; j < this->give_nLC(); j++) {
235 this->inclusions[i]->approx_coef[j] =
new double*[n_approximations];
236 for (
int k = 0; k < n_approximations; k++) {
237 this->inclusions[i]->approx_coef[j][k] =
new double[this->give_VM_TENS_RANGE()];
238 for (
int ii = 0; ii < this->give_VM_TENS_RANGE(); ii++)this->inclusions[i]->approx_coef[j][k][ii] = 0.;
241 CleanArray2d(this->inclusions[i]->approx_points, n_points, 3);
242 CleanArray2d(this->inclusions[i]->approx_points_eps_tau, n_points, this->give_VM_TENS_RANGE());
244 this->inclusions[i]->approx_points[1][0] -= approx_point_pos1*this->inclusions[i]->a[0];
245 this->inclusions[i]->approx_points[2][0] += approx_point_pos1*this->inclusions[i]->a[0];
246 this->inclusions[i]->approx_points[3][1] -= approx_point_pos1*this->inclusions[i]->a[1];
247 this->inclusions[i]->approx_points[4][1] += approx_point_pos1*this->inclusions[i]->a[1];
249 this->inclusions[i]->approx_points[5][0] -= 0.5*this->inclusions[i]->a[0];
250 this->inclusions[i]->approx_points[5][1] -= 0.5*this->inclusions[i]->a[1];
251 this->inclusions[i]->approx_points[6][0] += 0.5*this->inclusions[i]->a[0];
252 this->inclusions[i]->approx_points[6][1] -= 0.5*this->inclusions[i]->a[1];
253 this->inclusions[i]->approx_points[7][0] -= 0.5*this->inclusions[i]->a[0];
254 this->inclusions[i]->approx_points[7][1] += 0.5*this->inclusions[i]->a[1];
255 this->inclusions[i]->approx_points[8][0] += 0.5*this->inclusions[i]->a[0];
256 this->inclusions[i]->approx_points[8][1] += 0.5*this->inclusions[i]->a[1];
258 if (this->give_dimension() == 3) {
259 this->inclusions[i]->approx_points[9][2] -= approx_point_pos1*this->inclusions[i]->a[2];
260 this->inclusions[i]->approx_points[10][2] += approx_point_pos1*this->inclusions[i]->a[2];
262 this->inclusions[i]->approx_points[11][0] -= 0.5*this->inclusions[i]->a[0];
263 this->inclusions[i]->approx_points[11][2] -= 0.5*this->inclusions[i]->a[2];
264 this->inclusions[i]->approx_points[12][0] += 0.5*this->inclusions[i]->a[0];
265 this->inclusions[i]->approx_points[12][2] -= 0.5*this->inclusions[i]->a[2];
266 this->inclusions[i]->approx_points[13][0] -= 0.5*this->inclusions[i]->a[0];
267 this->inclusions[i]->approx_points[13][2] += 0.5*this->inclusions[i]->a[2];
268 this->inclusions[i]->approx_points[14][0] += 0.5*this->inclusions[i]->a[0];
269 this->inclusions[i]->approx_points[14][2] += 0.5*this->inclusions[i]->a[2];
270 this->inclusions[i]->approx_points[15][1] -= 0.5*this->inclusions[i]->a[1];
271 this->inclusions[i]->approx_points[15][2] -= 0.5*this->inclusions[i]->a[2];
272 this->inclusions[i]->approx_points[16][1] += 0.5*this->inclusions[i]->a[1];
273 this->inclusions[i]->approx_points[16][2] -= 0.5*this->inclusions[i]->a[2];
274 this->inclusions[i]->approx_points[17][1] -= 0.5*this->inclusions[i]->a[1];
275 this->inclusions[i]->approx_points[17][2] += 0.5*this->inclusions[i]->a[2];
276 this->inclusions[i]->approx_points[18][1] += 0.5*this->inclusions[i]->a[1];
277 this->inclusions[i]->approx_points[18][2] += 0.5*this->inclusions[i]->a[2];
282 for (
int j = 0; j < n_points; j++)this->inclusions[i]->transformCoords_L2G(this->inclusions[i]->approx_points[j], this->inclusions[i]->approx_points[j]);
330 void scan_FIELD_head (FILE *stream,
long noincl,
int nexc,
char format,
const char *name)
333 if (format ==
'i') sprintf(flint,
"int");
334 else if (format ==
'f') sprintf(flint,
"float");
338 sprintf (auxs,
"Error in section %s", name);
346 bool Problem :: file_type_s2e (
const char *s)
348 if (
_STRCMP(s,
"2D" ) == 0) { twodim =
true;
return false; }
349 else if (
_STRCMP(s,
"2Dequiv") == 0) { twodim =
true;
return true; }
350 else if (
_STRCMP(s,
"3D" ) == 0) { twodim =
false;
return false; }
351 else if (
_STRCMP(s,
"3Dequiv") == 0) { twodim =
false;
return true; }
352 else _errorr2 (
"Invalid structure of the given VTK file, the key word %s at the second line is not supported", s);
357 void Problem :: read_input_file (
const char *filename)
359 if (data_set)
_errorr(
"data_set already given");
362 if (this->verbose > 0)
363 printf(
"Reading of VTK file of multiple inclusion, please wait ...\n" );
366 char *fn =
new char[255];
367 strcpy(fn, filename);
375 bool lgc = stream->
isFile();
378 if (lgc) WORD =
new char[255];
390 amd = this->file_type_s2e (WORD);
428 _errorr(
"No AppendedData section");
430 if (
_STRCMP(parent->
Value(),
"AppendedData") != 0)
_errorr (
"name of xelement is not \"AppendedData\"");
433 if ( parent->
Value()[0] !=
'_' )
_errorr(
"There is no character \'_\' at the start of section AppendedData");
436 if (
_STRCMP(parent->
Value(),
"Input_Type") != 0)
_errorr(
"name of xelement is not Input_Type");
441 const char *text = parent->
Value();
444 if (
_STRCMP(text,
"SBA_mode") == 0) {
446 SBA_optimized = (bool)(auxl-1);
448 else if (
_STRCMP(text,
"conversion_mode") == 0) {
451 else if (
_STRCMP(text,
"Matrix_record") == 0) {
454 matrix->set_E_nu(e, nu);
456 else if (
_STRCMP(text,
"Remote_strains") == 0) {
461 this->matrix->set_nlc(nlc);
463 if (this->matrix->scan_Remote_strains(str) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD);
465 else if (
_STRCMP(text,
"Min_axes_diff") == 0) {
double m; sscanf (parent->
ToElement()->
GetText(),
"%lf", &m); this->set_semiaxes_min_difference(m); }
466 else if (
_STRCMP(text,
"Max_axes_diff") == 0) {
double m; sscanf (parent->
ToElement()->
GetText(),
"%lf", &m); this->set_semiaxes_max_difference(m); }
472 xnel = stream->
tixel();
479 bool status =
true, prnt;
481 long i, j, nn, auxl, noel, cno, offset;
483 const char *data=NULL, *offs=NULL, *typs, *str;
495 if (fgets (LINE, lLINE, stream->
file()) == NULL)
break;
508 if (
_STRCMP(WORD,
"Points") == 0) {
522 if (twodim) { inclusions =
new Inclusion*[noIncl];
for (
int i=0; i<noIncl; i++) inclusions[i] =
new InclusionRecord2D(i,
this); }
530 while (noel) { noel--;
531 if (lgc) { status += ( fscanf (stream->
file(),
"%lf %lf %lf", inclusions[noIncl]->origin, inclusions[noIncl]->origin+1, inclusions[noIncl]->origin+2) == 3 );
if (inclusions[noIncl]->origin[2] != 0.0)
_errorr(
"3. coordinates is not 0.0"); }
532 else { status += ( sscanf (data,
"%lf %lf %lf", inclusions[noIncl]->origin, inclusions[noIncl]->origin+1, inclusions[noIncl]->origin+2) == 3 );
if (inclusions[noIncl]->origin[2] != 0.0)
_errorr(
"3. coordinates is not 0.0"); status += (
SP_skip_word(data) &&
SP_skip_word(data) &&
SP_skip_word(data)); }
537 while (noel) { noel--;
538 if (lgc) { status += ( fscanf (stream->
file(),
"%lf %lf %lf", inclusions[noIncl]->origin, inclusions[noIncl]->origin+1, inclusions[noIncl]->origin+2) == 3 ); }
539 else { status += ( sscanf (data,
"%lf %lf %lf", inclusions[noIncl]->origin, inclusions[noIncl]->origin+1, inclusions[noIncl]->origin+2) == 3 ); status += (
SP_skip_word(data) &&
SP_skip_word(data) &&
SP_skip_word(data)); }
549 else if (
_STRCMP(WORD,
"CELLS") == 0) {
559 data =
XP_giveDAtext (stream->
tixel(), 1,
false,
"ascii",
"Int32",
"connectivity", NULL);
564 if (!lgc) offset = 0;
566 for (i=0; i<noel; i++) {
568 if (lgc) { fscanf (stream->
file(),
"%ld",&nn); cno = cno - nn - 1; }
569 else { nn = offset; status +=
SP_scan_number (offs, offset); nn = offset - nn; }
571 if (nn != 1)
_errorr3 (
"The number of CELL(%ld) nodes is %ld, it should be 1", i, nn);
573 if (lgc) fscanf (stream->
file(),
"%ld", &auxl);
575 if (auxl != i)
_errorr4 (
"The CELL(%ld) node ID is %ld, it should be %ld", i, auxl, i);
582 fgets (LINE, lLINE, stream->
file()); str=LINE;
587 while (noel) { noel--;
588 if (lgc) fscanf (stream->
file(),
"%ld",&auxl);
590 if (auxl != 1)
_errorr2 (
"Unsupported CELL_TYPE %ld, only \"1\" is supported", auxl);
599 _errorr2(
"Invalid structure of the given VTK file, the key word %s is not supported", WORD);
604 else if (
_STRCMP(WORD,
"POINT_DATA") == 0 ||
_STRCMP(WORD,
"PointData") == 0) {
609 else { prnt =
true; }
614 else if (
_STRCMP(WORD,
"CELL_DATA") == 0 ||
_STRCMP(WORD,
"CellData") == 0) {
619 else { prnt =
true; }
624 else if (
_STRCMP(WORD,
"FIELD") == 0) {
627 if (!lgc)
_errorr(
"FIELD in nonlegacy");
637 for (i=0; i<noel; i++) {
640 if (
_STRCMP(WORD,
"Acting_inclusions_list") == 0) {
641 auxl = this->totalNoActingIncls;
644 for (j=0; j<noIncl; j++)
645 if (
FP_scan_array (stream->
file(), inclusions[i]->noActingIncls, inclusions[i]->actingIncls) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD);
647 else if (
_STRCMP(WORD,
"Remote_strains") == 0) {
651 fscanf (stream->
file(),
"%d", &nLC);
652 this->matrix->set_nlc(nLC);
655 if (this->matrix->scan_Remote_strains(stream->
file()) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD);
657 else if (
_STRCMP(WORD,
"SBA_mode") == 0) {
659 fscanf (stream->
file(),
"%ld", &auxl);
660 SBA_optimized = (bool)(auxl-1);
662 else if (
_STRCMP(WORD,
"conversion_mode") == 0) {
664 fscanf (stream->
file(),
"%d", &intFieldsShape);
666 else if (
_STRCMP(WORD,
"Matrix_record") == 0) {
669 fscanf (stream->
file(),
"%lf %lf", &
e, &nu);
671 this->matrix->set_E_nu(e, nu);
674 _errorr3 (
"Invalid name of %d -th FIELD \"%s\"", i, WORD);
680 else if (
_STRCMP(WORD,
"SCALARS") == 0 ||
_STRCMP(WORD,
"VECTORS") == 0 ||
_STRCMP(WORD,
"TENSORS") == 0 ||
_STRCMP(WORD,
"DataArray") == 0) {
692 else if (
_STRCMP(WORD,
"Youngs_modulus" ) == 0) { auxl = 1;
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_number (&auxstrm, inclusions[j] ->E ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
693 else if (
_STRCMP(WORD,
"Poissons_ratio" ) == 0) { auxl = 1;
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_number (&auxstrm, inclusions[j] ->nu ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
695 else if (
_STRCMP(WORD,
"Semiaxes_dimensions" ) == 0) { auxl = this->give_VECT_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, inclusions[j] ->a ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
697 else if (
_STRCMP(WORD,
"Euller_angles_deg" ) == 0) { auxl = this->give_EA_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (inclusions[j]->scan_eAngles_DEG(&auxstrm) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
698 else if (
_STRCMP(WORD,
"Euller_angles_rad" ) == 0) { auxl = this->give_EA_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (inclusions[j]->scan_eAngles_RAD(&auxstrm) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
710 else if (
_STRCMP(WORD,
"Action_radius" ) == 0) { auxl = 1;
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_number (&auxstrm, inclusions[j]->actionRadius ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
711 else if (
_STRCMP(WORD,
"Acting_inclusions_number" ) == 0) { auxl = 1;
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'i', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_number (&auxstrm, inclusions[j]->noActingIncls ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
713 else if (
_STRNCMP(WORD,
"Local_Eq_strain_", 16 ) == 0) {
714 auxl = atoi(WORD+19);
if (auxl != nLC)
_errorr(
"Local_Eq_strain: Number of load cases mismatch"); WORD[18] =
'\0';
715 auxl = atoi(WORD+16) - 1;
if (auxl != les)
_errorr(
"Local_Eq_strain ID mismatch");
716 auxl = this->give_VM_TENS_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if ( inclusions[j]->scan_locEigStrain_LC(&auxstrm, les) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); les++; }
717 else if (
_STRNCMP(WORD,
"Global_Eq_strain_", 17 ) == 0) {
718 auxl = atoi(WORD+20);
if (auxl != nLC)
_errorr(
"Global_Eq_strain: Number of load cases mismatch"); WORD[19] =
'\0';
719 auxl = atoi(WORD+17) - 1;
if (auxl != ges)
_errorr(
"Global_Eq_strain ID mismatch");
720 auxl = this->give_VM_TENS_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (((
InclusionRecord3D*)inclusions[j])->scan_globEigStrain_LC(&auxstrm, ges) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); ges++; }
722 else if (
_STRCMP(WORD,
"Stiffnesses_C" ) == 0) { auxl = this->give_ISO_C_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, ((
InclusionRecord3D*)inclusions[j])->C ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
723 else if (
_STRCMP(WORD,
"Elliptic_potentials" ) == 0) { auxl = this->give_EL_POT_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, ((
InclusionRecord3D*)inclusions[j])->eInt ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
724 else if (
_STRCMP(WORD,
"Eshelby_tensor" ) == 0) { auxl = this->give_ISO_C_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, ((
InclusionRecord3D*)inclusions[j])->S ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
725 else if (
_STRCMP(WORD,
"Eshelby_tensor_inverse" ) == 0) { auxl = this->give_ISO_C_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, ((
InclusionRecord3D*)inclusions[j])->SInv ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
726 else if (
_STRCMP(WORD,
"Global_2_local_transform_matrix_for_vectors") == 0) { auxl = this->give_TRNSFM_MTRX_VEC_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, ( inclusions[j])->T ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
728 else if (
_STRCMP(WORD,
"Global_2_local_transform_matrix_for_tensors") == 0) { auxl = this->give_TRNSFM_MTRX_TENS_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, ((
InclusionRecord3D*)inclusions[j])->Te ) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
729 else if (
_STRCMP(WORD,
"Local_2_global_transform_matrix_for_tensors") == 0) { auxl = this->give_TRNSFM_MTRX_TENS_RANGE();
scan_DATA_field_head (stream, &auxstrm, str, type, auxl,
'f', WORD);
for (j=0; j<noIncl; j++)
if (
ST_scan_array (&auxstrm, auxl, ((
InclusionRecord3D*)inclusions[j])->TeInv) !=
true)
_errorr2 (
"There is few numbers in section %s", WORD); }
732 _errorr2 (
"Invalid name of SCALARS/DataArray for POINT_DATA/PointData \"%s\"", WORD);
735 if (
_STRCMP(WORD,
"Acting_inclusions_number") == 0)
736 for (j=0; j<noIncl; j++) {
737 inclusions[j]->ActingIncls_allocate();
738 this->totalNoActingIncls += inclusions[j]->noActingIncls;
746 else if (
_STRCMP(WORD,
"") == 0) {;}
747 else _errorr2 (
"Invalid structure of the given VTK file, unexpected key word \"%s\"", WORD);
749 if (lgc) {
if (cno)
_errorr2 (
"cno(%ld) is not zero", cno); }
751 if (data && data[0] !=
'\0')
_errorr2(
"CellData of name \"%s\" has too many numbers", WORD);
752 if (offs && offs[0] !=
'\0')
_errorr(
"error");
756 if (lgc)
delete [] WORD;
757 if (status ==
false)
_errorr(
"error");
760 if (this->data_equivalent) {
761 if (les != nLC)
_errorr(
"few Local_Eq_strain in input file");
762 if (ges != nLC)
_errorr(
"few Global_Eq_strain in input file");
769 if (amd) data_equivalent =
true;
772 if (this->data_equivalent) {
773 if (matrix == NULL)
_errorr(
"Matrix record is not given");
781 void Problem :: convert_to_equivalent_problem (
void)
783 if (!this->data_set)
_errorr(
"set");
784 if ( this->data_equivalent)
_errorr(
"initialized");
786 if (matrix == NULL)
_errorr(
"Matrix record is not given");
790 if (this->verbose > 0)
791 printf(
"Creating inclusion records, please wait ...\n" );
795 for (
int i=0; i<noIncl; i++) {
797 prevInclRec = inclusions[i];
801 if (SBA_optimized) this->findAffectedInclusions();
804 this->updateEigenstrainsBySBalgorithm();
807 this->data_equivalent =
true;
814 void Problem :: updateEigenstrainsBySBalgorithm (
void)
816 clock_t selfUpdateTimeStart = clock( );
819 for (i=0; i<this->give_nLC(); i++) {
820 if (this->verbose > 0)
821 printf(
"Transformation strain update of LoadCase no. %ld in progress, please wait ... \n", i );
824 for (j=0; j<noIncl; j++)
825 inclusions[j]->SBA_computeInitialStrains(i);
828 this->updateEigenstrainsBySBalgorithm_2D (i);
831 selfBalanceAlgorithm::totalEigStrainInInclCentroidsUpdate (
this);
833 for (j=0; j<noIncl; j++)
839 clock_t selfUpdateTimeEnd = clock( );
841 if (this->verbose > 0)
842 printf(
"updateEigenstrainsBySBalgorithm: multiple self-balance algorithm time: %.5e sec\n",
843 ( selfUpdateTimeEnd - selfUpdateTimeStart )/ (
double ) CLOCKS_PER_SEC );
848 void Problem :: updateEigenstrainsBySBalgorithm_2D (
int strainID)
854 double **last_eps_tau = NULL;
862 if (step >= this->get_SBA_maxiters())
_errorr(
"convergence not reached");
864 if (step >= this->get_SBA_reqiters())
break;
867 norma = updateEpsTauInSBal(strainID, last_eps_tau);
871 if (last_eps_tau != NULL) {
872 for (
int i = 0; i < this->give_nLC(); i++)
delete[]last_eps_tau[i];
873 delete[]last_eps_tau;
876 if (this->verbose > 0)
877 printf(
"\nBallancing : %d steps\n", step);
880 f = fopen(
"./EpsilonyTau.txt",
"wt");
881 for (
int i = 0; i < this->noIncl; i++) {
882 fprintf(f,
"Inkluze %d\n", i);
883 for (
int j = 0; j < this->inclusions[i]->n_approx_points; j++) {
884 for (
int k = 0; k < this->give_VM_TENS_RANGE(); k++)fprintf(f,
"%lf ", this->inclusions[i]->approx_points_eps_tau[j][k]);
888 fprintf(f,
"Lokalni souradnice\n");
889 for (
int j = 0; j < this->inclusions[0]->n_approx_points; j++) {
890 fprintf(f,
"%d] %lf %lf\n", j, this->inclusions[0]->approx_points[j][0] - this->inclusions[0]->origin[0], this->inclusions[0]->approx_points[j][1] - this->inclusions[0]->origin[1]);
905 vektor pricinek_strain(3);
906 double norma_delta_e_s;
911 for (i = 0; i < noIncl; i++)
912 suma_e_s[i].define(3);
916 if (step >= this->get_SBA_maxiters())
_errorr(
"convergence not reached");
918 if (step >= this->get_SBA_reqiters())
break;
921 for (i = 0; i < noIncl; i++)
922 suma_e_s[i].vynulovat();
925 for (i = 0; i < noIncl; i++) {
926 for (j = 0; j < inclusions[i]->noActingIncls; j++) {
927 jj = inclusions[i]->actingIncls[j];
929 suma_e_s[i].
pricist(pricinek_strain);
934 for (i = 0; i < noIncl; i++) {
935 for (j = 0; j < noIncl; j++) {
938 suma_e_s[i].
pricist(pricinek_strain);
944 for (i = 0; i < noIncl; i++)
947 for (i = 0; i < noIncl; i++) {
950 AddVector(((
InclusionRecord2D*)inclusions[i])->delta_e_t.v , inclusions[i]->Epsilon_Tau[strainID] , this->give_VM_TENS_RANGE());
953 norma_delta_e_s = 0.0;
954 for (i = 0; i < noIncl; i++)
961 if (this->verbose > 0)
962 printf(
"\nBallancing : %d steps\n", step);
968 printf(
"Ballancing loadcase %d\n", strainID);
969 double **tuhost =
new double*[3];
970 for (
int i = 0; i < 3; i++)tuhost[i] =
new double[3];
971 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)tuhost[i][j] = 0.;
972 tuhost[0][0] = this->matrix->C[0];
973 tuhost[0][1] = this->matrix->C[1];
974 tuhost[1][0] = this->matrix->C[2];
975 tuhost[1][1] = this->matrix->C[3];
976 tuhost[2][2] = this->matrix->C[4];
978 double AvSA[4], AvSB[4];
982 bool onlyMatrixC =
false;
983 bool onlyVxV =
false;
985 bool onlyExternal =
true;
987 int celk_cyklu = this->noIncl * 3, cyklu = 0;
988 int celk_cyklu_integrace = 0;
989 for (
int iA = 0; iA < noIncl; iA++)
for (
int iAl = 0; iAl < 3; iAl++)
for (
int iB = iA; iB < noIncl; iB++)
for (
int iBl = 0; iBl < 3; iBl++)celk_cyklu_integrace++;
992 double **ballance_matrix;
995 load =
new double*[3];
996 for (
int i = 0; i < 3; i++) load[i] =
new double[3];
997 load[0][0] = 1.; load[0][1] = 0.; load[0][2] = 0.;
998 load[1][0] = 0.; load[1][1] = 1.; load[1][2] = 0.;
999 load[2][0] = 0.; load[2][1] = 0.; load[2][2] = 1.;
1000 int q = this->noIncl * 3 + plus3;
1004 int nnn, pointInInclusion;
1005 double res, resv[3];
1007 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)matC[i][j] = 0.;
1009 double ***node_values;
1012 strain =
new double[3];
1013 right_side =
new double[q];
1014 ballance_matrix =
new double *[q];
1015 for (
int i = 0; i < q; i++)ballance_matrix[i] =
new double[q];
1017 double problem_size[3];
1019 for (
int i = 0; i < 2; i++) {
1020 if (floor(this->problem_size_A[i] / this->node_dist)*this->node_dist != this->problem_size_A[i])this->problem_size_A[i] = floor(this->problem_size_A[i] / this->node_dist)*this->node_dist;
1021 if (floor(this->problem_size_B[i] / this->node_dist)*this->node_dist != this->problem_size_B[i])this->problem_size_B[i] = floor(this->problem_size_B[i] / this->node_dist)*this->node_dist;
1023 for (
int i = 0; i < 3; i++)problem_size[i] = problem_size_B[i] - problem_size_A[i];
1024 if (problem_size[0] * problem_size[1] <= 0 || problem_size[0] < 0 || problem_size[1] < 0)
_errorr(
"Wrong problem size.");
1025 for (
int i = 0; i < 2; i++) {
1026 nnodes[i] = floor(problem_size[i] / this->node_dist) + 1;
1028 int nnnodes = nnodes[0] * nnodes[1];
1029 node_values =
new double**[this->noIncl * 3];
1030 for (
int i = 0; i < this->noIncl * 3; i++) {
1031 node_values[i] =
new double*[nnnodes];
1032 for (
int j = 0; j < nnnodes; j++)node_values[i][j] =
new double[3];
1034 nodes =
new double*[nnnodes];
1035 for (
int i = 0; i < nnnodes; i++)nodes[i] =
new double[3];
1037 for (
int i = 0; i < nnodes[1]; i++)
for (
int j = 0; j < nnodes[0]; j++) {
1038 nodes[nnn][0] = problem_size_A[0] + this->node_dist*j;
1039 nodes[nnn][1] = problem_size_A[1] + this->node_dist*i;
1045 double dsds = this->node_dist*this->node_dist;
1046 double volume = problem_size[0] * problem_size[1];
1047 double dsds_div_volume = dsds / volume;
1050 printf(
"Pocitam hodnoty strainu...\n");
1052 for (
int inclA = 0; inclA < this->noIncl; inclA++)
1053 for (
int inclAload = 0; inclAload < 3; inclAload++) {
1054 iA = inclA * 3 + inclAload;
1055 for (
int nodeID = 0; nodeID < nnnodes; nodeID++) {
1056 if (((
InclusionRecord2D*)inclusions[inclA])->point_is_inside(nodes[nodeID], 0.) ==
true)
1057 ((
InclusionRecord2D*)inclusions[inclA])->compute_strain_pert_from_eps_zero_int(nodes[nodeID], strain, load[inclAload]);
1059 ((
InclusionRecord2D*)inclusions[inclA])->compute_strain_pert_from_eps_zero_ext(nodes[nodeID], strain, load[inclAload]);
1064 for (
int i = 0; i < 3; i++)node_values[iA][nodeID][i] = strain[i];
1067 printf(
"%3.1lf %%\n", 100.*cyklu / celk_cyklu);
1100 printf(
"Integruju...\n");
1104 for (
int inclA = 0; inclA < this->noIncl; inclA++) {
1105 for (
int inclAload = 0; inclAload < 3; inclAload++) {
1106 iA = inclA * 3 + inclAload;
1110 for (
int nodeID = 0; nodeID < nnnodes; nodeID++) {
1111 for (
int i = 0; i < 3; i++)res -= node_values[iA][nodeID][i] * this->matrix->Remote_strain[strainID][i];
1114 right_side[inclA * 3 + inclAload] = res;
1116 for (
int inclB = inclA; inclB < this->noIncl; inclB++) {
1117 for (
int inclBload = 0; inclBload < 3; inclBload++) {
1118 iB = inclB * 3 + inclBload;
1122 for (
int nodeID = 0; nodeID < nnnodes; nodeID++) {
1123 for (
int i = 0; i < 3; i++)res += node_values[iA][nodeID][i] * node_values[iB][nodeID][i];
1126 ballance_matrix[inclA * 3 + inclAload][inclB * 3 + inclBload] = res;
1127 ballance_matrix[inclB * 3 + inclBload][inclA * 3 + inclAload] = res;
1132 printf(
"%3.1lf %%\n", 100.*cyklu / celk_cyklu_integrace);
1138 for (
int inclA = 0; inclA < this->noIncl; inclA++) {
1139 for (
int inclAload = 0; inclAload < 3; inclAload++) {
1140 iA = inclA * 3 + inclAload;
1143 for (
int i = 0; i < 3; i++)AvSA[i] = 0.;
1147 for (
int nodeID = 0; nodeID < nnnodes; nodeID++) {
1149 for (
int i = 0; i < 3; i++)AvSA[i] += node_values[iA][nodeID][i];
1151 pointInInclusion = this->give_inclusion_with_point_inside(nodes[nodeID]);
1153 if (!onlyExternal || (onlyExternal && pointInInclusion == -1)) {
1154 if (pointInInclusion == -1 || onlyMatrixC) {
1155 matC[0][0] = this->matrix->C[0];
1156 matC[0][1] = this->matrix->C[1];
1157 matC[1][0] = this->matrix->C[2];
1158 matC[1][1] = this->matrix->C[3];
1159 matC[2][2] = this->matrix->C[4];
1175 for (
int i = 0; i < 3; i++)resv[i] = 0.;
1176 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)
1177 resv[i] += matC[j][i] * node_values[iA][nodeID][j];
1178 for (
int i = 0; i < 3; i++)res -= resv[i] * this->matrix->Remote_strain[strainID][i];
1182 for (
int i = 0; i < 3; i++)resv[i] = 0.;
1183 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)
1184 resv[i] += node_values[iA][nodeID][j] * tuhost[j][i];
1185 for (
int i = 0; i < 3; i++)res += resv[i] * this->matrix->Remote_strain[strainID][i];
1191 for (
int i = 0; i < 3; i++)AvSA[i] *= dsds_div_volume;
1197 for (
int i = 0; i < 3; i++)resv[i] = 0.;
1198 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)
1199 resv[i] += tuhost[j][i] * AvSA[j];
1200 for (
int i = 0; i < 3; i++)res += resv[i] * this->matrix->Remote_strain[strainID][i] * volume;
1203 right_side[inclA * 3 + inclAload] = res;
1205 for (
int inclB = inclA; inclB < this->noIncl; inclB++) {
1206 for (
int inclBload = 0; inclBload < 3; inclBload++) {
1207 iB = inclB * 3 + inclBload;
1210 for (
int i = 0; i < 3; i++)AvSB[i] = 0.;
1214 for (
int nodeID = 0; nodeID < nnnodes; nodeID++) {
1216 for (
int i = 0; i < 3; i++)AvSB[i] += node_values[iB][nodeID][i];
1218 pointInInclusion = this->give_inclusion_with_point_inside(nodes[nodeID]);
1220 if (!onlyExternal || (onlyExternal && pointInInclusion == -1)) {
1221 if (pointInInclusion == -1 || onlyMatrixC) {
1222 matC[0][0] = this->matrix->C[0];
1223 matC[0][1] = this->matrix->C[1];
1224 matC[1][0] = this->matrix->C[2];
1225 matC[1][1] = this->matrix->C[3];
1226 matC[2][2] = this->matrix->C[4];
1242 for (
int i = 0; i < 3; i++)resv[i] = 0.;
1243 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)
1244 resv[i] += node_values[iA][nodeID][j] * matC[j][i];
1245 for (
int i = 0; i < 3; i++)res += resv[i] * node_values[iB][nodeID][i];
1249 for (
int i = 0; i < 3; i++)resv[i] = 0.;
1250 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)
1251 resv[i] += node_values[iA][nodeID][j] * tuhost[j][i];
1252 for (
int i = 0; i < 3; i++)res -= resv[i] * node_values[iB][nodeID][i];
1258 for (
int i = 0; i < 3; i++)AvSB[i] *= dsds_div_volume;
1264 for (
int i = 0; i < 3; i++)resv[i] = 0.;
1265 for (
int i = 0; i < 3; i++)
for (
int j = 0; j < 3; j++)
1266 resv[i] += tuhost[j][i] * AvSA[j];
1267 for (
int i = 0; i < 3; i++)res -= resv[i] * AvSB[i] * problem_size[0] * problem_size[1];
1270 ballance_matrix[inclA * 3 + inclAload][inclB * 3 + inclBload] = res;
1271 ballance_matrix[inclB * 3 + inclBload][inclA * 3 + inclAload] = res;
1276 printf(
"%3.1lf %%\n", 100.*cyklu / celk_cyklu_integrace);
1282 for (
int i = 0; i < 3; i++) {
1283 for (
int j = 0; j < 3; j++) {
1291 matice M(noIncl * 3, noIncl * 3);
1294 for (
int i = 0; i < noIncl * 3; i++)
for (
int j = 0; j < noIncl * 3; j++)M.
g(i, j) = ballance_matrix[i][j];
1295 for (
int i = 0; i < noIncl * 3; i++)V.
v[i] = right_side[i];
1305 printf(
"Resim soustavu rovnic...\n");
1309 double computed_load[3];
1310 for (
int inclID = 0; inclID < noIncl; inclID++) {
1311 for (
int j = 0; j < 3; j++)
1312 computed_load[j] = V.
v[inclID * 3 + j];
1313 ((
InclusionRecord2D*)inclusions[inclID])->compute_eps_tau(strainID, this->inclusions[inclID]->Epsilon_Tau[strainID], computed_load,
false);
1316 for (
int i = 0; i < this->noIncl; i++)printf(
"%lf %lf %lf\n", this->inclusions[i]->Epsilon_Tau[strainID][0], this->inclusions[i]->Epsilon_Tau[strainID][1], this->inclusions[i]->Epsilon_Tau[strainID][2]);
1322 else _errorr(
"Unknown SBAmode");
1327 void Problem :: findAffectedInclusions (
void)
1329 int *auxActingIncls = NULL;
1333 auxActingIncls =
new int[noIncl];
1336 for (i=0; i<noIncl; i++) {
1338 inclusions[i]->noActingIncls = 0;
1339 for (j=0; j<noIncl; j++) {
1340 if (i != j && inclusions[j]->point_is_affected(inclusions[i]->origin)) {
1341 auxActingIncls[inclusions[i]->noActingIncls] = j;
1342 inclusions[i]->noActingIncls++;
1346 if (this->inclusions[i]->noActingIncls != 0) {
1347 inclusions[i]->ActingIncls_allocate();
1348 CopyVector( auxActingIncls, inclusions[i]->actingIncls, inclusions[i]->noActingIncls );
1353 delete [] auxActingIncls;
1357 void Problem :: give_ovlivneni (
const double *coords,
double *result)
1362 point.
x[0] = coords[0];
1363 point.
x[1] = coords[1];
1364 point.
x[2] = coords[2];
1366 if (inclusions[0]->point_is_inside(point.
x, 1.e-7)) {
1371 ((
InclusionRecord3D*) inclusions[0])->esuf->giveEshelbyStrainOfOnePoint(&point);
1379 double Problem :: compute_supplement_energy (
int lc)
1382 for (
int i=0; i<noIncl; i++)
1383 E += this->inclusions[i]->compute_supplement_energy(lc);
1400 fprintf (stream->
file(),
"CELLS %ld %ld\n", noIncl, 2*noIncl);
1401 for (i=0; i<noIncl; i++)
1402 fprintf (stream->
file(),
"1 %ld\n", i);
1404 fprintf (stream->
file(),
"CELL_TYPES %ld\n", noIncl);
1405 for (i=0; i<noIncl; i++)
1406 fprintf (stream->
file(),
"1\n");
1427 for (
long i=1; i<=noIncl; i++) {
1443 if (format ==
'i') {
if (stream->
isFile()) sprintf(flint,
"int");
else sprintf(flint,
"Int32"); }
1444 else if (format ==
'f') {
if (stream->
isFile()) sprintf(flint,
"float");
else sprintf(flint,
"Float32"); }
1448 fprintf (stream->
file(),
"%s %d %d %s\n", name, noincl, slen, flint);
1506 for (
int i=0; i<n; i++) {
1507 sprintf (auxs+pos,
"%15d", values[i]); pos += 15;
1509 if (auxs[pos] !=
'\0') pos++;
1510 if (auxs[pos] !=
'\0')
errol;
1513 if ((i+1)%rv == 0) sprintf (auxs+pos,
"\n");
1514 else sprintf (auxs+pos,
" ");
1522 void Problem :: printVtkFileCompleteInclRec (
const char *rsltFileName)
1529 char auxs[20001]; auxs[20000] =
'\0';
1536 char *filename =
new char[255];
1537 strcpy(filename, rsltFileName);
1543 if (this->twodim) sprintf (type,
"2Dequiv");
1544 else sprintf (type,
"3Dequiv");
1552 for (i=0; i<this->noIncl; i++) {
1553 sprintf (auxs,
"%15.8e %15.8e %15.8e", this->inclusions[i]->origin[0], this->inclusions[i]->origin[1], this->inclusions[i]->origin[2]);
1555 if (lgc) fprintf (stream->
file(),
"%s\n", auxs);
1564 fprintf (stream->
file(),
"FIELD unstructured_data %d\n", 4);
1567 sprintf (auxs,
"%d", 1 + (
int)this->SBA_optimized);
1571 sprintf (auxs,
"%d", this->intFieldsShape);
1575 sprintf (auxs ,
"%12.6e", this->matrix->E());
1576 sprintf (auxs+12,
" %12.6e", this->matrix->nu());
1579 da =
print_VTK_field_head (stream,
"Remote_strains",
'f', this->give_nLC(), this->give_TENS_RANGE());
1581 for (i=0; i<this->give_nLC(); i++) {
1582 CopyVector (this->matrix->Remote_strain[i], rs, this->give_TENS_RANGE());
1586 for (j=0; j<this->give_TENS_RANGE(); j++)
1587 sprintf (auxs+j*13,
" %12.6e", rs[j]);
1595 auxl = 1; da =
print_VTK_data_head (stream,
"Inclusion_shape",
's',
'i', auxl);
for (i=0; i<this->noIncl; i++) { sprintf (auxs,
"%d", this->inclusions[i]->shape);
print_auxs (lgc, stream, da, auxs); }
1596 auxl = 1; da =
print_VTK_data_head (stream,
"Youngs_modulus",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) { sprintf (auxs,
"%.8e", this->inclusions[i] ->E );
print_auxs (lgc, stream, da, auxs); }
1597 auxl = 1; da =
print_VTK_data_head (stream,
"Poissons_ratio",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) { sprintf (auxs,
"%.8e", this->inclusions[i] ->nu );
print_auxs (lgc, stream, da, auxs); }
1598 auxl = this->give_VECT_RANGE(); da =
print_VTK_data_head (stream,
"Semiaxes_dimensions",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i] ->a );
print_auxs (lgc, stream, da, auxs); }
1599 auxl = this->give_EA_RANGE(); da =
print_VTK_data_head (stream,
"Euller_angles_rad",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i]->eAngles );
print_auxs (lgc, stream, da, auxs); }
1600 auxl = 1 ; da =
print_VTK_data_head (stream,
"Action_radius",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) { sprintf (auxs,
"%.8e", this->inclusions[i]->actionRadius);
print_auxs (lgc, stream, da, auxs); }
1602 if (! this->twodim) { da =
print_VTK_data_head (stream,
"Acting_inclusions_number",
's',
'i', 1);
for (i=0; i<this->noIncl; i++) { sprintf (auxs,
"%d", this->inclusions[i]->noActingIncls);
print_auxs (lgc, stream, da, auxs); } }
1604 auxl = this->give_ISO_C_RANGE(); da =
print_VTK_data_head (stream,
"Stiffnesses_C",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i]->C);
print_auxs (lgc, stream, da, auxs); }
1608 auxl = this->give_ISO_C_RANGE(); da =
print_VTK_data_head (stream,
"Eshelby_tensor",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i]->S);
print_auxs (lgc, stream, da, auxs); }
1612 auxl = this->give_TRNSFM_MTRX_VEC_RANGE(); da =
print_VTK_data_head (stream,
"Global_2_local_transform_matrix_for_vectors",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i]->T);
print_auxs (lgc, stream, da, auxs); }
1614 auxl = this->give_TRNSFM_MTRX_TENS_RANGE(); da =
print_VTK_data_head (stream,
"Global_2_local_transform_matrix_for_tensors",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i]->Te);
print_auxs (lgc, stream, da, auxs); }
1615 auxl = this->give_TRNSFM_MTRX_TENS_RANGE(); da =
print_VTK_data_head (stream,
"Local_2_global_transform_matrix_for_tensors",
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i]->TeInv);
print_auxs (lgc, stream, da, auxs); }
1618 int nlc = this->give_nLC();
1621 auxl = this->give_VM_TENS_RANGE();
1622 for (j=0; j<nlc; j++) { sprintf (auxs,
"Local_Eq_strain_%02ld_%02d", j+1, nlc); da =
print_VTK_data_head (stream, auxs,
's',
'f', auxl);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, auxl, this->inclusions[i]->Epsilon_Tau[j]);
print_auxs (lgc, stream, da, auxs); } }
1625 for (j=0; j<nlc; j++) { sprintf (auxs,
"Local_Eq_strain_%02ld_%02d", j+1, nlc); da =
print_VTK_data_head (stream, auxs,
's',
'f', 6);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, 6, ((
InclusionRecord3D*)this->inclusions[i])->locEigStrain_LC[j]);
print_auxs (lgc, stream, da, auxs); } }
1627 for (j=0; j<nlc; j++) { sprintf (auxs,
"Global_Eq_strain_%02ld_%02d", j+1, nlc); da =
print_VTK_data_head (stream, auxs,
's',
'f', 6);
for (i=0; i<this->noIncl; i++) {
print_values (auxs, 6, ((
InclusionRecord3D*)this->inclusions[i])->globEigStrain_LC[j]);
print_auxs (lgc, stream, da, auxs); } }
1630 fprintf (stream->
file(),
"FIELD unstructured_data %d\n", 1);
1632 auxl = this->totalNoActingIncls;
1634 for (i=0; i<this->noIncl; i++) {
1635 print_valuesi (auxs, this->inclusions[i]->noActingIncls, this->inclusions[i]->actingIncls, 10);
1647 long Problem :: give_inclusion_with_point_inside (
const double *coords,
double epsilon)
const 1650 for (i=0; i<noIncl; i++)
1651 if (inclusions[i]->point_is_inside(coords, epsilon) ==
true) {
1674 else _errorr (
"not supported notation");
1677 _errorr (
"not supported notation");
1690 else _errorr (
"not supported notation");
1693 _errorr (
"not supported notation");
1699 long Problem :: giveFieldsOfPointOneRS (
double *displc,
double *strain,
double *stress,
const double *coords,
1702 return this->giveFieldsOfPoint ( displc ? &displc : NULL, strain ? &strain : NULL, stress ? &stress : NULL, coords, ptFlag, rs, 1, pfcMode, reqIncl, tn);
1706 long Problem :: giveFieldsOfPoint (
double **displc,
double **strain,
double **stress,
const double *coords,
1710 long parent_incl = this->give_EshelbyPertFieldsOnePoint (coords, displc, strain, stress, rs, nrs, pfcMode, reqIncl);
1713 if (ptFlag ==
't') {
1714 for (
int i=0; i<nrs; i++) {
1720 if (displc)
AddVector (this->matrix->give_globHomog_Displc(i+rs, coords), displc[i], this->give_VECT_RANGE());
1721 if (strain)
AddVector (this->matrix->give_globHomog_Strain(i+rs), strain[i], this->give_VM_TENS_RANGE());
1722 if (stress)
AddVector (this->matrix->give_globHomog_Stress(i+rs), stress[i], this->give_VM_TENS_RANGE());
1725 else if (ptFlag !=
'p')
_errorr(
"wrong pt flag");
1736 long Problem :: give_EshelbyPertFieldsOnePoint (
const double *coo,
double **displc,
double **strain,
double **stress,
1737 int lc,
int nlc,
PFCmode pfcMode,
long reqIincl)
const 1741 if (this->matrix->origin) {
1742 coords =
new double[3];
1746 coords = (
double*)coo;
1748 nlc = this->check_lc_nlc(lc, nlc);
1754 if (reqIincl == -3) {
1755 parent_incl = this->give_inclusion_with_point_inside (coords, 0.0);
1758 else if (reqIincl == -2) {
1759 parent_incl = this->give_inclusion_with_point_inside (coords, 1.
e-6);
1760 if (parent_incl == -1)
1761 _errorr(
"point doesnot lay on inclusion, nekde asi zustala -2, ted tam ma byt -3 pro neurcitou polohu");
1764 else if (reqIincl == -1) {
1765 parent_incl = this->give_inclusion_with_point_inside (coords, -1.
e-6);
1766 if (parent_incl != -1)
1767 _errorr(
"point doesnot lay on matrix");
1770 else if (reqIincl >= 0) {
1771 parent_incl = reqIincl;
1772 if (inclusions[parent_incl]->point_is_inside (coords, 1.
e-3) ==
false)
1773 _errorr(
"point doesnot lay inside of the supposed inclusion");
1778 if (displc != NULL || strain != NULL || stress != NULL) {
1856 double **e_t_updated;
1870 if (parent_incl == -1) {
1872 this->give_EshelbyPertFieldsOnePoint_external (coords, displc, strain, stress, lc, nlc, pfcMode, parent_incl);
1878 if (intFieldsShape == 0) {
1880 if (strain) strain_r = strain;
1884 this->give_EshelbyPertFieldsOnePoint_external(coords, displc, strain_r, stress, lc, nlc, pfcMode, parent_incl);
1889 if (strain || stress) {
1897 for (
int i = 0; i < nlc; i++) ((
InclusionRecord2D*)inclusions[parent_incl])->compute_eps_tau(i+lc, e_t_updated[i], strain_r[i],
true);
1900 this->inclusions[parent_incl]->add_EshelbyPertStrain_internal_SIFCM (strain_r, lc, nlc, e_t_updated);
1904 this->inclusions[parent_incl]->add_EshelbyPertStress_internal_SIFCM(stress, lc, nlc, e_t_updated, strain_r);
1916 AddArray2D (this->inclusions[parent_incl]->give_EshelbyPertDisplc_internal(lc, nlc, coords), displc, nlc, this->give_VECT_RANGE());
1921 if (intFieldsShape == 1) {
1922 _errorr(
"Not implemented yet.");
1926 if (intFieldsShape == 2) {
1927 this->give_EshelbyPertFieldsOnePoint_external(this->inclusions[parent_incl]->origin, displc, strain, stress, lc, nlc, pfcMode, parent_incl);
1929 if (strain)
AddArray2D (this->inclusions[parent_incl]->give_EshelbyPertStrain_internal(lc, nlc) , strain, nlc, this->give_VM_TENS_RANGE());
1930 if (stress)
AddArray2D (this->inclusions[parent_incl]->give_EshelbyPertStress_internal(lc, nlc) , stress, nlc, this->give_VM_TENS_RANGE());
1931 if (displc)
AddArray2D (this->inclusions[parent_incl]->give_EshelbyPertDisplc_internal(lc, nlc, coords), displc, nlc, this->give_VECT_RANGE() );
1935 if (intFieldsShape == 3) {
1936 this->give_EshelbyPertFieldsOnePoint_external(coords, displc, strain, stress, lc, nlc, pfcMode, parent_incl);
1938 if (strain)
AddArray2D (this->inclusions[parent_incl]->give_EshelbyPertStrain_internal(lc, nlc) , strain, nlc, this->give_VM_TENS_RANGE());
1939 if (stress)
AddArray2D (this->inclusions[parent_incl]->give_EshelbyPertStress_internal(lc, nlc) , stress, nlc, this->give_VM_TENS_RANGE());
1940 if (displc)
AddArray2D (this->inclusions[parent_incl]->give_EshelbyPertDisplc_internal(lc, nlc, coords), displc, nlc, this->give_VECT_RANGE() );
1944 if (intFieldsShape == 4) {
1945 if (strain)
CopyArray2D (this->inclusions[parent_incl]->give_EshelbyPertStrain_internal(lc, nlc) , strain, nlc, this->give_VM_TENS_RANGE());
1946 if (stress)
CopyArray2D (this->inclusions[parent_incl]->give_EshelbyPertStress_internal(lc, nlc) , stress, nlc, this->give_VM_TENS_RANGE());
1947 if (displc)
CopyArray2D (this->inclusions[parent_incl]->give_EshelbyPertDisplc_internal(lc, nlc, coords), displc, nlc, this->give_VECT_RANGE() );
1956 if (this->matrix->origin)
delete [] coords;
1964 void Problem :: give_EshelbyPertFieldsOnePoint_external (
const double *coords,
double **displc,
double **strain,
double **stress,
1965 int lc,
int nlc,
PFCmode pfcMode,
long parent_incl)
const 1971 long *actIncls = NULL;
1973 noActIncls = this->noIncl;
1977 actIncls =
new long[this->noIncl];
1979 noActIncls = this->giveActingInclusions(actIncls, coords);
1981 else _errorr(
"giveEshelbyPertFieldsOfOnePoint: unknofn PFCmode");
1986 CopyVector (coords, point->
x, this->give_VECT_RANGE());
1988 bool delstrain =
false;
1990 if (stress && strain == NULL) {
1995 if (displc)
CleanArray2d (displc, nlc, this->give_VECT_RANGE());
1996 if (strain)
CleanArray2d (strain, nlc, this->give_VM_TENS_RANGE());
1998 for (
int i=0; i<noActIncls; i++) {
1999 if (parent_incl == i)
continue;
2002 if (pfcMode ==
PFCM_FULL) incl = this->inclusions[i];
2003 else incl = this->inclusions[actIncls[i]];
2010 if (strain)
AddArray2D (point->
strain, strain, nlc, this->give_VM_TENS_RANGE());
2015 for (
int i=0; i<nlc; i++)
2028 void Problem :: printFieldsOnMeshVTK (
const char *mesh_file_out,
const char *mesh_file,
2029 char ptFlag,
int rs,
int nrs,
2032 nrs = this->check_lc_nlc(rs, nrs);
2041 void Problem :: printFieldsOnMeshGrid (
const char *mesh_file_out,
const double *p1,
const double *p2,
const long *n,
2042 char ptFlag,
int rs,
int nrs,
2045 nrs = this->check_lc_nlc(rs, nrs);
2059 Problem *Problem::read_inclusions_plus_initialize_and_print (
const char *inclusion_file,
const char *equiv_file,
DiffTypes dt)
2061 this->set_diffType (dt);
2062 this->read_input_file (inclusion_file);
2064 this->input_data_initialize_and_check_consistency();
2066 if (this->data_equivalent ==
false)
2067 this->convert_to_equivalent_problem ();
2070 this->print_equivalent_problem (equiv_file);
2076 Mesh* Problem :: give_new_mesh (
void)
2078 meshes[nmeshes] =
new Mesh(nmeshes,
this);
2080 return meshes[nmeshes-1];
2089 homogs[nhomogs] =
new Dilute(nhomogs,
this);
2093 homogs[nhomogs] =
new MoriTanaka(nhomogs,
this);
2097 homogs[nhomogs] =
new ReussBound(nhomogs,
this);
2105 homogs[nhomogs] =
new RegGrid(nhomogs,
this);
2113 _errorr(
"Unknown homogenization type" );
2118 return homogs[nhomogs-1];
2122 void Problem :: print_equivalent_problem (
const char *vtkTopologyFileRec)
2125 this->totalNoActingIncls = 0;
2126 for (
long i=0; i<noIncl; i++)
2127 this->totalNoActingIncls += inclusions[i]->noActingIncls;
2130 this->printVtkFileCompleteInclRec (vtkTopologyFileRec);
2165 long Problem :: giveActingInclusions (
long *actIncls,
const double *coords)
const 2167 long noActIncls = 0;
2170 for (
long i=0; i<this->noIncl; i++)
2171 if (inclusions[i]->point_is_affected(coords)) {
2172 actIncls[noActIncls] = i;
2181 double Problem :: updateEpsTauInSBal (
int strainID,
double **&last_eps_tau)
2183 vektor suma_e_s(this->give_VM_TENS_RANGE());
2186 for (
int i = 0; i < noIncl; i++) {
2187 for (
int ap = -1; ap < this->inclusions[i]->n_approx_points; ap++) {
2188 if (ap == -1)
for (
int k = 0; k < 3; k++) point[k] = inclusions[i]->origin[k];
2189 else for (
int k = 0; k < 3; k++) point[k] = inclusions[i]->approx_points[ap][k];
2191 if (SBA_optimized) {
2192 for (
int j = 0; j < inclusions[i]->noActingIncls; j++) {
2193 ((
InclusionRecord2D*)inclusions[inclusions[i]->actingIncls[j]])->giveExtStrainPert(point, strain, strainID, 1);
2194 for (
int ii = 0; ii < this->give_VM_TENS_RANGE(); ii++)suma_e_s.
v[ii] += strain[0][ii];
2198 for (
int j = 0; j < noIncl; j++) {
2200 ((
InclusionRecord2D*)inclusions[j])->giveExtStrainPert(point, strain, strainID, 1);
2201 for (
int ii = 0; ii < this->give_VM_TENS_RANGE(); ii++)suma_e_s.
v[ii] += strain[0][ii];
2205 for (
int j = 0; j < this->give_VM_TENS_RANGE(); j++)suma_e_s.
v[j] += this->matrix->remote_strains()[strainID][j];
2207 if (ap == -1)this->inclusions[i]->Eps02EpsTau(this->inclusions[i]->Epsilon_Tau[strainID], suma_e_s.
v);
2208 else this->inclusions[i]->Eps02EpsTau(this->inclusions[i]->approx_points_eps_tau[ap], suma_e_s.
v);
2210 if (this->inclusions[i]->n_approx_points)this->inclusions[i]->update_approximations(strainID);
2216 if (last_eps_tau == NULL) {
2217 last_eps_tau =
AllocateArray2D(this->noIncl, this->give_VM_TENS_RANGE());
2218 for (
int i = 0; i < this->noIncl; i++)
for (
int j = 0; j < this->give_VM_TENS_RANGE(); j++) {
2219 last_eps_tau[i][j] = this->inclusions[i]->Epsilon_Tau[strainID][j];
2224 for (
int i = 0; i < this->noIncl; i++) {
2225 for (
int j = 0; j < this->give_VM_TENS_RANGE(); j++)
2226 norma +=
SQR(this->inclusions[i]->Epsilon_Tau[strainID][j] - last_eps_tau[i][j]);
2228 for (
int j = 0; j < this->give_VM_TENS_RANGE(); j++)
2229 last_eps_tau[i][j] = this->inclusions[i]->Epsilon_Tau[strainID][j];
2237 void Problem :: print_visualization (
const char *name,
int n,
int dim,
bool refined)
2239 if (this->data_equivalent ==
false)
_errorr(
"Inverse matrix TInv at inclusion have to be computed before calling print_geom function, for example call initialize_inclusion_records");
2241 if (dim == 0) dim = this->give_dimension();
2243 if (refined)
_errorr(
"refined je nejaky pokus, je rozbitej momentalne, ale mozna jen ve 2d");
2245 if (dim != this->give_dimension())
2246 _errorr(
"error in visualization of 3d problem in xy plane, still not repaired");
2250 Mesh umesh(1, NULL);
2267 for (
int i=0; i<noIncl; i++) {
2269 if (!refined) mesh1 =
new Mesh(1,
this, &umesh);
2270 else { mesh1 =
new Mesh(1,
this);
2279 for (
int j=0; j<nn; j++) {
2281 mesh.
Nodes[i*nn+j]->
M = &mesh;
2285 for (
int j=0; j<ne; j++) {
2287 mesh.
Elems[i*ne+j]->
M = &mesh;
2297 if (this->twodim)
_errorr(
"print_geom problem is 3d, please use parameter dim 2");
2300 Mesh umesh(1, NULL);
2317 for (
int i=0; i<noIncl; i++) {
2319 if (!refined) mesh1 =
new Mesh(1,
this, &umesh);
2320 else { mesh1 =
new Mesh(1,
this);
2328 for (
int j=0; j<nn; j++) {
2330 mesh.
Nodes[i*nn+j]->
M = &mesh;
2334 for (
int j=0; j<ne; j++) {
2336 mesh.
Elems[i*ne+j]->
M = &mesh;
2348 void Problem :: check_overlap (
void)
2352 for (i=0; i<this->noIncl; i++) {
2353 for (j=i+1; j<this->noIncl; j++) {
2354 status = this->inclusions[i]->find_overlap(this->inclusions[j]);
2358 _errorr(
"check_overlap: NOT converged");
2363 _errorr(
"check_overlap: OVERLAP");
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
XMLText * NewText(const char *text)
Create a new Text associated with this Document.
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 convert2Dtensor_TRtoVR_notation(double *t)
Function convert the symmetric double 2D tensor 't'.
virtual void initialize(const Inclusion *prevInclRec)=0
double * origin
coordinates of the inclusions' centorids
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)
file of various types and symbolic constant definitions
void generate_regularSphereMesh_2d(int n, const double *a)
Function generates uniform mesh on an unit circle.
bool FP_skip_line(FILE *stream, int n)
move file descriptor to the start of the n-th new line //[former read_line]
#define _SELF_BALANCE_NORM_LIMIT_
Class InclusionRecord contains and handles all inclusion data.
void local2global(const double *origin, const double *TInv)
Local to global transformation of all nodes.
void set_nlc(const Problem *p, int nlc)
Original Honza Novak's balancing.
void XP_check_expected_attribute(const XMLNode *xelem, const char *name, const char *value)
#define maxNumberOfMeshes
Class of function for Mori-Tanaka homogenization.
double & g(int radek, int sloupec)
virtual XMLComment * ToComment()
Safely cast to a Comment, or null.
#define SP_scan_expected_word_exit(_1, _2, _3, _4)
Namespace MatrixOperations.
const XMLElement * XP_give_unique_expected_elem(const XMLNode *xelem, const char *name, bool uniq)
Class mNode contains and handles all mesh node data.
double ** displacement
Calculated value - global displacement field.
XMLDocument * tix_doc(void)
double x[3]
Global coordinates of a point.
Class of function for homogenization of stress fields.
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)
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'.
const XMLNode * FirstChild() const
Get the first child node, or null if none exists.
long SP_scan_word(const char *&src, char *dest)
... word; return value is length of the word
The element is a container class.
#define FP_scan_expected_number_exit(_1, _2, _3)
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.
void giveTVproduct_6is6x6to12and6(double *result, const double *T, const double *vect)
Function gives product of tensor and vector - 'result = T * vect'.
void CopyArray2D(const double *const *src, double **dest, long d1, long d2)
Function copy two 2D double arrays with dimensions d1xd2 from 'src' to 'dest'.
mNode ** Nodes
1d array of pointers to Node.
PFCmode
Algorithm type of a point fields calculation.
void give_EshelbyPertFields_external(Point *point, int lc, int nlc, bool disp, bool strn)
Function gives the 'Eshelby' STRAIN and DISPLACEMENT field in an arbitrary EXTERNAL point for given l...
Notation used in the Brdecko's book or Jan Zeman's PhD thesis (generally used CTU's notation)...
void AddArray2D(const double *const *src, double **dest, long d1, long d2)
Function add 2D double array with dimensions d1xd2 from 'src' to 'dest'.
void convertTensorStress(bool twodim, double *tens, STRNotation oldNot, STRNotation newNot)
bool FP_scan_array(FILE *stream, int n, int *dest)
scan/copy array of numbers from src to dest, src pointer is shifted over the field ...
The header file of usefull macros.
FILE * file(void)
*** GET ***
void SubtractTwoVectors(const double *v1, const double *v2, double *answer, long n)
Function subtracts two vectors of entries. answer = v1 - v2.
bool ST_scan_number(Stream *src, int &dest)
*** *** *** *** TINYXML FCE *** *** *** ***
void SetAttribute(const char *name, const char *value)
Sets the named attribute to value.
XMLElement * print_VTK_field_head(Stream *stream, const char *name, char format, int slen, int noincl)
void CleanArray2d(double **a, long rows, long columns)
Function cleans an 2d 'double' array, initialize each value being 0-zero.
STRNotation
This enum defines a notation how to represent a symmetric second/fourth-order tensor by reducing its ...
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
XMLElement * NewElement(const char *name)
Create a new Element associated with this Document.
void print_VTK_FINISH(Stream *stream)
VOIGHT / engineering notation saved in FEEP order.
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)
Single Point data structure - contribution from Single inclusion.
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 ** strain
Calculated value - global strain fields.
double * TInv
LOCAL->GLOBAL displacement vector transfrmation matrix; TInv = T^-1 (inversion) = T^T (transposed) ...
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)
void convert3Dtensor_TRtoVR_notation(double *t)
Function convert the symmetric double 3D tensor 't'.
XMLNode is a base class for every object that is in the XML Document Object Model (DOM)...
void print_valuesi(char *auxs, int n, const int *values, int rv)
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.
const char * GetText() const
Convenience function for easy access to the text inside an element.
Class inclusion contains and handles all inclusion data.
XMLError QueryLongAttribute(const char *name, long *value) const
Given an attribute name, QueryIntAttribute() returns XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the co...
Class HomogenizationMethods.
void convert2Dtensor_TRtoROW_notation(double *t)
Function convert the symmetric double 2D tensor 't'.
double * a
Inclusion semiaxes' dimensions in global arrangement.
void print_VTK_init_point_data(Stream *stream, long n)
Class of function for Mori-Tanaka homogenization.
void print_VTK_START(Stream *stream, const char *filename)
Print head of vtk file.
InclusionGeometry
Inclusion shapes' type.
#define _errorr3(_1, _2, _3)
void giveTVproduct_3is3x3to5and3(double *result, const double *T, const double *vect)
Function gives product of tensor and vector - 'result = T * vect'.
void gaussovaEliminace(matice &m, vektor &right)
XMLElement * print_VTK_nodes_head(Stream *stream, long n)
void print_VTK_elems_head(Stream *stream, long noIncl)
void convert3Dtensor_TFEEPtoROW_notation(double *t)
Function convert the symmetric double 3D tensor 't'.
void scan_FIELD_head(FILE *stream, long noincl, int nexc, char format, const char *name)
scan_DATA_field_head
void DeleteArray2D(bool **array, long d1)
Function deletes a 2D 'bool' array of dimension d1 x ??, allocated by new.
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.
double ** AllocateArray2D(long d1, long d2)
Operations with 2d, 3d, 4d arrays of various sizes.
virtual XMLNode * ShallowClone(XMLDocument *document) const
Make a copy of this node, but not its children.
#define _errorr4(_1, _2, _3, _4)
Class of function for ... homogenization.
Class of function for Voight bound.
#define FP_scan_expected_word_exit(_1, _2, _3, _4)
Class Mesh contains and handles all mesh data.
Class of function for Mori-Tanaka homogenization.
The set of the functions returning the Eshelby solution of multiple inclusion task using the self-bal...
DEFAULT / INTERNAL FOR muMECH Theoretical notation saved in row-by-row form 2d: {t_11, t_12, t_21, t_22} 2d: {s_11, s_12, s_21, s_22} 3d: {t_11, t_12, t_13, t_21, t_22, t_23, t_31, t_32, t_33} 3d: {s_11, s_12, s_13, s_21, s_22, s_23, s_31, s_32, s_33}.
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
bool SP_skip_word(const char *&src, int n)
... word and space before
void CleanVector(double *a, long n)
Functin cleans a 'double' vector, initialize each value being 0-zero.
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.
void convertTensorStrain(bool twodim, double *tens, STRNotation oldNot, STRNotation newNot)
XMLNode * InsertEndChild(XMLNode *addThis)
Add a child node as the last (right) child.
void AddVector(const double *a, double *b, long n)
Function add given number of components from vector 'a' to vector 'b', b += a.
const XMLNode * NextSibling() const
Get the next (right) sibling node of this node.
void scale(const double *s)
Scale all nodes coordinates by vector s.
void print_values(char *auxs, int n, const double *values, int precision)
Class mElement contains and handles all mesh element data.
Class of function for Reuss bound.
XMLElement * print_VTK_data_head(Stream *stream, const char *name, char type, char format, int slen)