Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wenqing
ogs
Commits
53308fbd
Commit
53308fbd
authored
3 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
Revert "[NumLib] Modified NumLibFemIsoTest according to the change in computeMappingMatrices"
This reverts commit
d0a28ac5
.
parent
87e812c4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/NumLib/TestCoordinatesMapping.cpp
+1
-6
1 addition, 6 deletions
Tests/NumLib/TestCoordinatesMapping.cpp
Tests/NumLib/TestFe.cpp
+14
-21
14 additions, 21 deletions
Tests/NumLib/TestFe.cpp
with
15 additions
and
27 deletions
Tests/NumLib/TestCoordinatesMapping.cpp
+
1
−
6
View file @
53308fbd
...
@@ -330,12 +330,7 @@ TEST(NumLib, FemNaturalCoordinatesMappingLineY)
...
@@ -330,12 +330,7 @@ TEST(NumLib, FemNaturalCoordinatesMappingLineY)
ASSERT_ARRAY_NEAR
(
exp_J
,
shape
.
J
.
data
(),
shape
.
J
.
size
(),
eps
);
ASSERT_ARRAY_NEAR
(
exp_J
,
shape
.
J
.
data
(),
shape
.
J
.
size
(),
eps
);
ASSERT_ARRAY_NEAR
(
exp_J
,
shape
.
invJ
.
data
(),
shape
.
invJ
.
size
(),
eps
);
ASSERT_ARRAY_NEAR
(
exp_J
,
shape
.
invJ
.
data
(),
shape
.
invJ
.
size
(),
eps
);
ASSERT_NEAR
(
1.0
,
shape
.
detJ
,
eps
);
ASSERT_NEAR
(
1.0
,
shape
.
detJ
,
eps
);
double
exp_dNdx
[
2
*
e_nnodes
]
=
{
double
exp_dNdx
[
2
*
e_nnodes
]
=
{
0
,
0
,
-
0.5
,
0.5
};
-
0.5
,
0.5
,
0
,
0
,
};
ASSERT_ARRAY_NEAR
(
exp_dNdx
,
shape
.
dNdx
.
data
(),
shape
.
dNdx
.
size
(),
eps
);
ASSERT_ARRAY_NEAR
(
exp_dNdx
,
shape
.
dNdx
.
data
(),
shape
.
dNdx
.
size
(),
eps
);
for
(
auto
n
=
0u
;
n
<
line
->
getNumberOfNodes
();
++
n
)
for
(
auto
n
=
0u
;
n
<
line
->
getNumberOfNodes
();
++
n
)
...
...
This diff is collapsed.
Click to expand it.
Tests/NumLib/TestFe.cpp
+
14
−
21
View file @
53308fbd
...
@@ -41,12 +41,11 @@ template <class TestFeType_, template <typename, int> class ShapeMatrixPolicy_>
...
@@ -41,12 +41,11 @@ template <class TestFeType_, template <typename, int> class ShapeMatrixPolicy_>
struct
TestCase
struct
TestCase
{
{
using
TestFeType
=
TestFeType_
;
using
TestFeType
=
TestFeType_
;
static
const
int
GlobalDim
=
TestFeType
::
global_dim
;
using
ShapeMatrixTypes
=
using
ShapeMatrixTypes
=
ShapeMatrixPolicy_
<
typename
TestFeType
::
ShapeFunction
,
ShapeMatrixPolicy_
<
typename
TestFeType
::
ShapeFunction
,
GlobalDim
>
;
TestFeType
::
ShapeFunction
::
DIM
>
;
template
<
typename
X
>
template
<
typename
X
>
using
ShapeMatrixPolicy
=
using
ShapeMatrixPolicy
=
ShapeMatrixPolicy_
<
X
,
GlobalDim
>
;
ShapeMatrixPolicy_
<
X
,
TestFeType
::
ShapeFunction
::
DIM
>
;
using
ShapeFunction
=
typename
TestFeType
::
ShapeFunction
;
using
ShapeFunction
=
typename
TestFeType
::
ShapeFunction
;
};
};
...
@@ -106,7 +105,8 @@ public:
...
@@ -106,7 +105,8 @@ public:
public:
public:
NumLibFemIsoTest
()
NumLibFemIsoTest
()
:
expectedM
(
e_nnodes
,
e_nnodes
),
:
D
(
dim
,
dim
),
expectedM
(
e_nnodes
,
e_nnodes
),
expectedK
(
e_nnodes
,
e_nnodes
),
expectedK
(
e_nnodes
,
e_nnodes
),
integration_method
(
2
)
integration_method
(
2
)
{
{
...
@@ -114,20 +114,14 @@ public:
...
@@ -114,20 +114,14 @@ public:
mesh_element
=
this
->
createMeshElement
();
mesh_element
=
this
->
createMeshElement
();
// set a conductivity tensor
// set a conductivity tensor
globalD
.
resize
(
TestFeType
::
global_dim
,
TestFeType
::
global_dim
);
setIdentityMatrix
(
dim
,
D
);
setIdentityMatrix
(
TestFeType
::
global_dim
,
globalD
);
D
*=
conductivity
;
globalD
*=
conductivity
;
MeshLib
::
ElementCoordinatesMappingLocal
ele_local_coord
(
MeshLib
::
ElementCoordinatesMappingLocal
ele_local_coord
(
*
mesh_element
,
*
mesh_element
,
MeshLib
::
CoordinateSystem
(
*
mesh_element
).
getDimension
());
MeshLib
::
CoordinateSystem
(
*
mesh_element
).
getDimension
());
Eigen
::
Matrix
<
double
,
ShapeFunction
::
DIM
,
TestFeType
::
global_dim
>
const
auto
R
=
ele_local_coord
.
getRotationMatrixToGlobal
().
topLeftCorner
(
R
=
ele_local_coord
.
getRotationMatrixToGlobal
()
TestFeType
::
dim
,
TestFeType
::
global_dim
);
.
transpose
()
globalD
.
noalias
()
=
R
.
transpose
()
*
(
D
*
R
);
.
topLeftCorner
(
mesh_element
->
getDimension
(),
TestFeType
::
global_dim
);
localD
=
R
*
globalD
*
R
.
transpose
();
// set expected matrices
// set expected matrices
this
->
setExpectedMassMatrix
(
expectedM
);
this
->
setExpectedMassMatrix
(
expectedM
);
...
@@ -158,12 +152,11 @@ public:
...
@@ -158,12 +152,11 @@ public:
static
const
double
conductivity
;
static
const
double
conductivity
;
static
const
double
eps
;
static
const
double
eps
;
Eigen
::
Matrix
<
double
,
TestFeType
::
global_dim
,
TestFeType
::
global_dim
>
DimMatrix
D
;
globalD
;
NodalMatrix
expectedM
;
NodalMatrix
expectedM
;
NodalMatrix
expectedK
;
NodalMatrix
expectedK
;
IntegrationMethod
integration_method
;
IntegrationMethod
integration_method
;
Eigen
::
Matrix
<
double
,
ShapeFunction
::
DIM
,
ShapeFunction
::
DIM
>
lo
c
alD
;
GlobalDimMatrixType
g
lo
b
alD
;
std
::
vector
<
const
MeshLib
::
Node
*>
vec_nodes
;
std
::
vector
<
const
MeshLib
::
Node
*>
vec_nodes
;
std
::
vector
<
const
MeshElementType
*>
vec_eles
;
std
::
vector
<
const
MeshElementType
*>
vec_eles
;
...
@@ -241,7 +234,7 @@ TYPED_TEST(NumLibFemIsoTest, CheckLaplaceMatrix)
...
@@ -241,7 +234,7 @@ TYPED_TEST(NumLibFemIsoTest, CheckLaplaceMatrix)
{
{
auto
const
&
shape
=
shape_matrices
[
i
];
auto
const
&
shape
=
shape_matrices
[
i
];
auto
wp
=
this
->
integration_method
.
getWeightedPoint
(
i
);
auto
wp
=
this
->
integration_method
.
getWeightedPoint
(
i
);
K
.
noalias
()
+=
shape
.
dNdx
.
transpose
()
*
this
->
lo
c
alD
*
shape
.
dNdx
*
K
.
noalias
()
+=
shape
.
dNdx
.
transpose
()
*
this
->
g
lo
b
alD
*
shape
.
dNdx
*
shape
.
detJ
*
wp
.
getWeight
();
shape
.
detJ
*
wp
.
getWeight
();
}
}
// std::cout << "K=\n" << K << std::endl;
// std::cout << "K=\n" << K << std::endl;
...
@@ -270,7 +263,7 @@ TYPED_TEST(NumLibFemIsoTest, CheckMassLaplaceMatrices)
...
@@ -270,7 +263,7 @@ TYPED_TEST(NumLibFemIsoTest, CheckMassLaplaceMatrices)
auto
wp
=
this
->
integration_method
.
getWeightedPoint
(
i
);
auto
wp
=
this
->
integration_method
.
getWeightedPoint
(
i
);
M
.
noalias
()
+=
M
.
noalias
()
+=
shape
.
N
.
transpose
()
*
shape
.
N
*
shape
.
detJ
*
wp
.
getWeight
();
shape
.
N
.
transpose
()
*
shape
.
N
*
shape
.
detJ
*
wp
.
getWeight
();
K
.
noalias
()
+=
shape
.
dNdx
.
transpose
()
*
(
this
->
lo
c
alD
*
shape
.
dNdx
)
*
K
.
noalias
()
+=
shape
.
dNdx
.
transpose
()
*
(
this
->
g
lo
b
alD
*
shape
.
dNdx
)
*
shape
.
detJ
*
wp
.
getWeight
();
shape
.
detJ
*
wp
.
getWeight
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment