Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77577063
patch_test_linear_elastic.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
Thu, Aug 15, 06:59
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Aug 17, 06:59 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19887046
Attached To
rAKA akantu
patch_test_linear_elastic.cc
View Options
/* -------------------------------------------------------------------------- */
#include "mesh_utils.hh"
#include "non_linear_solver.hh"
#include "solid_mechanics_model.hh"
#include "test_gtest_utils.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
#include <vector>
/* -------------------------------------------------------------------------- */
TYPED_TEST
(
TestPatchTestLinearElastic
,
Implicit
)
{
this
->
model
->
initFull
(
_analysis_method
=
_static
);
this
->
applyBC
();
auto
&
solver
=
this
->
model
->
getNonLinearSolver
();
solver
.
set
(
"max_iterations"
,
2
);
solver
.
set
(
"threshold"
,
2e-4
);
solver
.
set
(
"convergence_type"
,
_scc_residual
);
this
->
model
->
solveStep
();
this
->
checkDisplacements
();
this
->
checkStrains
();
this
->
checkStresses
();
}
TYPED_TEST
(
TestPatchTestLinearElastic
,
Explicit
)
{
this
->
model
->
initFull
(
_analysis_method
=
_explicit_lumped_mass
);
this
->
applyBC
();
const
auto
&
coordinates
=
this
->
mesh
->
getNodes
();
auto
&
displacement
=
this
->
model
->
getDisplacement
();
//set the position of all nodes to the static solution
for
(
auto
&&
tuple
:
zip
(
make_view
(
coordinates
,
this
->
dim
),
make_view
(
displacement
,
this
->
dim
)))
{
this
->
setDisplacement
(
std
::
get
<
1
>
(
tuple
),
std
::
get
<
0
>
(
tuple
));
}
for
(
UInt
s
=
0
;
s
<
100
;
++
s
)
{
this
->
model
->
solveStep
();
}
auto
ekin
=
this
->
model
->
getEnergy
(
"kinetic"
);
EXPECT_NEAR
(
0
,
ekin
,
1e-16
);
this
->
checkDisplacements
();
this
->
checkStrains
();
this
->
checkStresses
();
}
Event Timeline
Log In to Comment