Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63426318
test_surface_extraction_tetrahedron_4.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
Mon, May 20, 01:17
Size
1 KB
Mime Type
text/x-c
Expires
Wed, May 22, 01:17 (2 d)
Engine
blob
Format
Raw Data
Handle
17771749
Attached To
rAKA akantu
test_surface_extraction_tetrahedron_4.cc
View Options
/**
* @file test_surface_extraction_3d.cc
* @author Leonardo Snozzi <leonardo.snozzi@epfl.ch>
* @date Mon Oct 25 11:40:12 2010
*
* @brief
*
* @section LICENSE
*
* <insert license here>
*
*/
/* -------------------------------------------------------------------------- */
#include "aka_common.hh"
#include "mesh.hh"
#include "mesh_io.hh"
#include "mesh_io_msh.hh"
#include "mesh_utils.hh"
#include "solid_mechanics_model.hh"
#include "material.hh"
#ifdef AKANTU_USE_IOHELPER
# include "io_helper.h"
#endif
//AKANTU_USE_IOHELPER
using
namespace
akantu
;
int
main
(
int
argc
,
char
*
argv
[])
{
int
dim
=
3
;
Mesh
mesh
(
dim
);
MeshIOMSH
mesh_io
;
mesh_io
.
read
(
"cubes.msh"
,
mesh
);
MeshUtils
::
buildFacets
(
mesh
,
1
,
0
);
MeshUtils
::
buildSurfaceID
(
mesh
);
unsigned
int
nb_nodes
=
mesh
.
getNbNodes
();
#ifdef AKANTU_USE_IOHELPER
DumperParaview
dumper
;
dumper
.
SetMode
(
TEXT
);
dumper
.
SetPoints
(
mesh
.
getNodes
().
values
,
dim
,
nb_nodes
,
"test-surface-extraction"
);
dumper
.
SetConnectivity
((
int
*
)
mesh
.
getConnectivity
(
_tetrahedron_4
).
values
,
TETRA1
,
mesh
.
getNbElement
(
_tetrahedron_4
),
C_MODE
);
dumper
.
SetPrefix
(
"paraview/"
);
dumper
.
Init
();
dumper
.
Dump
();
DumperParaview
dumper_surface
;
dumper_surface
.
SetMode
(
TEXT
);
dumper_surface
.
SetPoints
(
mesh
.
getNodes
().
values
,
dim
,
nb_nodes
,
"test-surface-extraction_boundary"
);
dumper_surface
.
SetConnectivity
((
int
*
)
mesh
.
getConnectivity
(
_triangle_3
).
values
,
TRIANGLE1
,
mesh
.
getNbElement
(
_triangle_3
),
C_MODE
);
double
*
surf_id
=
new
double
[
mesh
.
getSurfaceId
(
_triangle_3
).
getSize
()];
for
(
UInt
i
=
0
;
i
<
mesh
.
getSurfaceId
(
_triangle_3
).
getSize
();
++
i
)
surf_id
[
i
]
=
(
double
)
mesh
.
getSurfaceId
(
_triangle_3
).
values
[
i
];
dumper_surface
.
AddElemDataField
(
surf_id
,
1
,
"surface_id"
);
delete
[]
surf_id
;
dumper_surface
.
SetPrefix
(
"paraview/"
);
dumper_surface
.
Init
();
dumper_surface
.
Dump
();
#endif
//AKANTU_USE_IOHELPER
finalize
();
return
EXIT_SUCCESS
;
}
Event Timeline
Log In to Comment