Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91006751
test_interpolate_tetrahedron_6.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 6, 21:10
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Nov 8, 21:10 (2 d)
Engine
blob
Format
Raw Data
Handle
22178265
Attached To
rAKA akantu
test_interpolate_tetrahedron_6.cc
View Options
/**
* @file test_interpolate_tetrahedron_6.cc
* @author Nicolas Richart <nicolas.richart@epfl.ch>
* @date Mon Jul 19 10:55:49 2010
*
* @brief test of the fem class
*
* @section LICENSE
*
* \<insert license here\>
*
*/
/* -------------------------------------------------------------------------- */
#include <cstdlib>
#include <fstream>
/* -------------------------------------------------------------------------- */
#include "aka_common.hh"
#include "fem.hh"
#include "mesh.hh"
#include "mesh_io.hh"
#include "mesh_io_msh.hh"
/* -------------------------------------------------------------------------- */
using
namespace
akantu
;
int
main
(
int
argc
,
char
*
argv
[])
{
UInt
dim
=
3
;
ElementType
type
=
_tetrahedron_6
;
MeshIOMSH
mesh_io
;
Mesh
my_mesh
(
dim
);
mesh_io
.
read
(
"cube1.msh"
,
my_mesh
);
FEM
*
fem
=
new
FEM
(
my_mesh
,
dim
,
"my_fem"
);
debug
::
setDebugLevel
(
dblDump
);
fem
->
initShapeFunctions
();
std
::
cout
<<
*
fem
<<
std
::
endl
;
StaticMemory
*
st_mem
=
StaticMemory
::
getStaticMemory
();
std
::
cout
<<
*
st_mem
<<
std
::
endl
;
Vector
<
Real
>
const_val
(
fem
->
getMesh
().
getNbNodes
(),
2
,
"const_val"
);
Vector
<
Real
>
val_on_quad
(
0
,
2
,
"val_on_quad"
);
for
(
UInt
i
=
0
;
i
<
const_val
.
getSize
();
++
i
)
{
const_val
.
values
[
i
*
2
+
0
]
=
1.
;
const_val
.
values
[
i
*
2
+
1
]
=
2.
;
}
fem
->
interpolateOnQuadraturePoints
(
const_val
,
val_on_quad
,
2
,
type
);
std
::
ofstream
my_file
(
"out.txt"
);
my_file
<<
const_val
<<
std
::
endl
;
my_file
<<
val_on_quad
<<
std
::
endl
;
// interpolate coordinates
Vector
<
Real
>
coord_on_quad
(
0
,
my_mesh
.
getSpatialDimension
(),
"coord_on_quad"
);
fem
->
interpolateOnQuadraturePoints
(
my_mesh
.
getNodes
(),
coord_on_quad
,
my_mesh
.
getSpatialDimension
(),
type
);
my_file
<<
my_mesh
.
getNodes
()
<<
std
::
endl
;
my_file
<<
coord_on_quad
<<
std
::
endl
;
delete
fem
;
finalize
();
return
EXIT_SUCCESS
;
}
Event Timeline
Log In to Comment