41 fprintf (stdout,
"cmp: \n");
47 sprintf (name,
"%sANSYS/rslts_lc%d/list.IB.mesh.vtu", basename, lc);
60 sprintf (name,
"%sANSYS/rslts_lc%d/list.IB.rslt.vtu", basename, lc);
66 double Err_all = mesh->
give_error(pidMM, pidAS, lc);
67 fprintf (stdout,
"Error: %.3lf%%\n", Err_all);
72 sprintf (name,
"%s%s", basename,
"cmp_energy.meshMM.vtk");
75 sprintf (name,
"%s%s", basename,
"cmp_energy.meshAS.vtk");
90 fprintf (stdout,
"cmp: \n");
99 double p1[3]; p1[2] = 0.0;
100 double p2[3]; p2[2] = 0.0;
101 long nn[3]; nn[2] = 0;
102 double x1, x2, y1, y2, dx, dy;
110 pMM->
generate_equiv_1x2dI_2d(1.0, 0.2, NULL, 0.0, 0.0, 10, 0.3, 1.0, 0.5, 0.0,
DT_NUMERICAL);
114 FILE *file = fopen (
"energy_MM.txt",
"wt");
116 sprintf (name,
"energy_MM.lc0.%2ld.%4.2lf.dat", steps, dx); FILE *file0 = fopen (name,
"wt");
117 sprintf (name,
"energy_MM.lc1.%2ld.%4.2lf.dat", steps, dx); FILE *file1 = fopen (name,
"wt");
118 sprintf (name,
"energy_MM.lc2.%2ld.%4.2lf.dat", steps, dx); FILE *file2 = fopen (name,
"wt");
121 for (
int step=0; step<steps; step++) {
123 p1[0] = x1 - step*
delta; p1[1] = y1 - step*
delta;
124 p2[0] = x2 + step*
delta; p2[1] = y2 + step*
delta;
125 nn[0] = (p2[0] - p1[0]) / dx; nn[1] = (p2[1] - p1[1]) / dy;
127 fprintf (file,
"BB %lf \n", p2[0]);
130 mesh =
new Mesh(0, NULL);
137 for (
int lc=0; lc<3; lc++) {
138 fprintf (file,
" lc = %ld\n", lc);
141 fprintf (file,
" lc%ld Ehom = %lf\n", lc, Eh);
144 fprintf (file,
" lc%ld Etot = %lf\n", lc, Et);
146 fprintf (file,
" lc%ld Epert num = Etotal - Ehomog = %lf\n", lc, Et - Eh);
148 if (lc == 0) fprintf (file0,
"%lf %lf\n", p2[0], Et - Eh);
149 if (lc == 1) fprintf (file1,
"%lf %lf\n", p2[0], Et - Eh);
150 if (lc == 2) fprintf (file2,
"%lf %lf\n", p2[0], Et - Eh);
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.
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...
int give_dimension(void) const
file of various types and symbolic constant definitions
virtual int give_nLC(void) const
Give number of load cases, e.i. number of load cases, i.e. number of Remote_strain fields...
Problem * read_inclusions_plus_initialize_and_print(const char *inclusion_file, const char *equiv_file, DiffTypes dt)
static void give_energy_MM()
compute energy of mumech solution
void compute_node_fields(char flag, bool displc_flag, bool strain_flag, bool stress_flag, int pid, int lc, int nLC, PFCmode pfcMode)
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.
double give_homog_energy(int lc, int pid=0)
double give_error(int pid1, int pid2, int lc)
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 ...
double give_total_energy(int pid, int lc)
Class Mesh contains and handles all mesh data.
int add_problem(const Problems *p)
void 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)
Problem description for FEM problem with results.