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
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
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
Mojtaba Abdolkhani
ogs
Commits
8f531f2e
Commit
8f531f2e
authored
9 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
test natural coordinates mapping for 1.5D line
parent
9d070fea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/NumLib/CoordinatesMappingTestData/TestLine2.h
+9
-0
9 additions, 0 deletions
Tests/NumLib/CoordinatesMappingTestData/TestLine2.h
Tests/NumLib/TestCoordinatesMapping.cpp
+34
-2
34 additions, 2 deletions
Tests/NumLib/TestCoordinatesMapping.cpp
with
43 additions
and
2 deletions
Tests/NumLib/CoordinatesMappingTestData/TestLine2.h
+
9
−
0
View file @
8f531f2e
...
...
@@ -76,6 +76,15 @@ public:
nodes
[
1
]
=
new
MeshLib
::
Node
(
0.0
,
0.0
,
0.0
);
return
new
MeshLib
::
Line
(
nodes
);
}
// 1.5d line
static
MeshLib
::
Line
*
createY
()
{
MeshLib
::
Node
**
nodes
=
new
MeshLib
::
Node
*
[
e_nnodes
];
nodes
[
0
]
=
new
MeshLib
::
Node
(
0.0
,
-
1.0
,
0.0
);
nodes
[
1
]
=
new
MeshLib
::
Node
(
0.0
,
1.0
,
0.0
);
return
new
MeshLib
::
Line
(
nodes
);
}
};
const
double
TestLine2
::
r
[
dim
]
=
{
0.5
};
...
...
This diff is collapsed.
Click to expand it.
Tests/NumLib/TestCoordinatesMapping.cpp
+
34
−
2
View file @
8f531f2e
...
...
@@ -83,7 +83,7 @@ public:
vec_nodes
.
push_back
(
e
->
getNode
(
i
));
}
~
NumLibFemNaturalCoordinatesMappingTest
()
virtual
~
NumLibFemNaturalCoordinatesMappingTest
()
{
for
(
auto
itr
=
vec_nodes
.
begin
();
itr
!=
vec_nodes
.
end
();
++
itr
)
delete
*
itr
;
...
...
@@ -280,4 +280,36 @@ TYPED_TEST(NumLibFemNaturalCoordinatesMappingTest, CheckZeroVolume)
ASSERT_ARRAY_NEAR
(
exp_dNdx
,
shape
.
dNdx
.
data
(),
shape
.
dNdx
.
size
(),
this
->
eps
);
}
TEST
(
NumLib
,
FemNaturalCoordinatesMappingLineY
)
{
#ifdef OGS_USE_EIGEN
typedef
Eigen
::
Matrix
<
double
,
2
,
1
>
NodalVector
;
typedef
Eigen
::
Matrix
<
double
,
1
,
2
,
Eigen
::
RowMajor
>
DimNodalMatrix
;
typedef
Eigen
::
Matrix
<
double
,
1
,
1
,
Eigen
::
RowMajor
>
DimMatrix
;
typedef
Eigen
::
Matrix
<
double
,
2
,
2
,
Eigen
::
RowMajor
>
GlobalDimNodalMatrix
;
#endif
// Shape data type
typedef
ShapeMatrices
<
NodalVector
,
DimNodalMatrix
,
DimMatrix
,
GlobalDimNodalMatrix
>
ShapeMatricesType
;
typedef
NaturalCoordinatesMapping
<
MeshLib
::
Line
,
ShapeLine2
,
ShapeMatricesType
>
MappingType
;
double
r
[]
=
{
0.5
};
auto
line
=
TestLine2
::
createY
();
static
const
unsigned
dim
=
1
;
static
const
unsigned
e_nnodes
=
2
;
ShapeMatricesType
shape
(
dim
,
2
,
e_nnodes
);
MappingType
::
computeShapeMatrices
(
*
line
,
r
,
shape
);
double
exp_J
[
dim
*
dim
]
=
{
0.0
};
for
(
unsigned
i
=
0
;
i
<
dim
;
i
++
)
exp_J
[
i
+
dim
*
i
]
=
1.0
;
const
double
eps
(
std
::
numeric_limits
<
double
>::
epsilon
());
ASSERT_ARRAY_NEAR
(
TestLine2
::
nat_exp_N
,
shape
.
N
.
data
(),
shape
.
N
.
size
(),
eps
);
ASSERT_ARRAY_NEAR
(
TestLine2
::
nat_exp_dNdr
,
shape
.
dNdr
.
data
(),
shape
.
dNdr
.
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_NEAR
(
1.0
,
shape
.
detJ
,
eps
);
double
exp_dNdx
[
2
*
e_nnodes
]
=
{
0
,
0
,
-
0.5
,
0.5
};
ASSERT_ARRAY_NEAR
(
exp_dNdx
,
shape
.
dNdx
.
data
(),
shape
.
dNdx
.
size
(),
eps
);
delete
line
;
}
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