Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95108013
test_inverse_map.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, Dec 12, 22:28
Size
2 KB
Mime Type
text/x-c
Expires
Sat, Dec 14, 22:28 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22762556
Attached To
rAKA akantu
test_inverse_map.cc
View Options
/**
* Copyright (©) 2010-2023 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* This file is part of Akantu
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*/
/* -------------------------------------------------------------------------- */
#include "test_fe_engine_fixture.hh"
/* -------------------------------------------------------------------------- */
using
namespace
akantu
;
TYPED_TEST
(
TestFEMFixture
,
InverseMap
)
{
this
->
fem
->
initShapeFunctions
();
Matrix
<
Real
>
quad
=
GaussIntegrationElement
<
TestFixture
::
type
>::
getQuadraturePoints
();
const
auto
&
position
=
this
->
fem
->
getMesh
().
getNodes
();
/// get the quadrature points coordinates
Array
<
Real
>
coord_on_quad
(
quad
.
cols
()
*
this
->
nb_element
,
this
->
dim
,
"coord_on_quad"
);
this
->
fem
->
interpolateOnIntegrationPoints
(
position
,
coord_on_quad
,
this
->
dim
,
this
->
type
);
Vector
<
Real
>
natural_coords
(
this
->
dim
);
auto
length
=
(
this
->
upper
-
this
->
lower
).
template
lpNorm
<
Eigen
::
Infinity
>
();
for
(
auto
&&
enum_
:
enumerate
(
make_view
(
coord_on_quad
,
this
->
dim
,
quad
.
cols
())))
{
auto
el
=
std
::
get
<
0
>
(
enum_
);
const
auto
&
quads_coords
=
std
::
get
<
1
>
(
enum_
);
for
(
auto
q
:
arange
(
quad
.
cols
()))
{
Vector
<
Real
>
quad_coord
=
quads_coords
(
q
);
Vector
<
Real
>
ref_quad_coord
=
quad
(
q
);
this
->
fem
->
inverseMap
(
quad_coord
,
el
,
this
->
type
,
natural_coords
);
auto
dis_normalized
=
ref_quad_coord
.
distance
(
natural_coords
)
/
length
;
EXPECT_NEAR
(
0.
,
dis_normalized
,
3.5e-11
);
}
}
}
Event Timeline
Log In to Comment