muMECH
1.0
Main Page
Namespaces
Classes
Files
File List
File Members
src
tests
tests_vorel.cpp
Go to the documentation of this file.
1
#include "
problem.h
"
2
#include "
gelib.h
"
3
#include "
homogenization.h
"
4
#include "
mesh.h
"
5
6
using namespace
mumech
;
7
8
10
int
cmp_fields
(
int
n,
const
double
*f1,
const
double
*f2,
double
eps)
11
{
12
int
nd = 0;
13
14
while
(n--)
15
if
(fabs( (f1[n] - f2[n]) / f1[n]) > eps)
16
nd++;
17
18
return
nd;
19
}
20
21
void
vzor
(
void
)
22
{
23
// char vtkGeomFile[] = "vzor/X3D_3incl.geom.vtk";
24
// char vtkAmndFile[] = "vzor/X3D_3incl.amnd.vtk";
25
// char vtkMeshFile[] = "vzor/X3D_3incl.mesh";
26
//
27
// // regular mesh
28
// double p1[3] = {-3.0, -3.0, -3.0 };
29
// double p2[3] = { 3.0, 3.0, 3.0 };
30
// long n[3];
31
// n[0] = (p2[0] - p1[0]) / 0.2;
32
// n[1] = (p2[1] - p1[1]) / 0.2;
33
// n[2] = (p2[2] - p1[2]) / 0.2;
34
//
35
//
36
// Problem p; // mumech problem
37
// p.read_inclusions_plus_initialize_and_print (vtkGeomFile, vtkAmndFile, DT_ANALITICAL);
38
//
39
//
40
// Mesh *mesh = p.give_new_mesh ();
41
// mesh->generate_regular_mesh (p1, p2, n);
42
// mesh->compute_node_fields ('p', true, true, true, 0, 1, PFCM_FULL);
43
// mesh->print_geometry_file_vtk (vtkMeshFile, 0, 1);
44
//
45
// Homogenization *h = p.give_new_homogenization (HT_Dilute);
46
// h->set_mesh (mesh);
47
// h->compute_fields_HT_reg_grid (0, 0, PFCM_FULL);
48
49
// // kontrola
50
// double stress[6] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
51
//
52
// const double **field = h->give_stress();
53
// if (cmp_fields (6, stress, field[0], 1e-7)) _warningg("TestVerified_triple_incl_3D_homog_regular results differs");
54
}
55
56
57
void
tests_vorel
(
void
) {
58
59
vzor
();
60
61
}
62
63
/*end of file*/
mumech
Definition:
matrix_vector.cpp:6
vzor
void vzor(void)
Definition:
tests_vorel.cpp:21
gelib.h
General functions.
mesh.h
Class Mesh.
tests_vorel
void tests_vorel(void)
Definition:
tests_vorel.cpp:57
homogenization.h
Class Homogenization.
cmp_fields
int cmp_fields(int n, const double *f1, const double *f2, double eps)
Compare two fields.
Definition:
tests_vorel.cpp:10
problem.h
Class Problem.
This reference manual is part of the
muMECH
documentation. Generated on Wed Feb 24 2016 22:50:08 for muMECH by
1.8.11.