Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
code
pugs
Commits
70ef6a60
Commit
70ef6a60
authored
2 months ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Handles various ghost layers in mesh data base for tests
parent
93ebce77
Branches
Branches containing commit
No related tags found
1 merge request
!205
High-order polynomial reconstruction
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/MeshDataBaseForTests.cpp
+35
-14
35 additions, 14 deletions
tests/MeshDataBaseForTests.cpp
tests/MeshDataBaseForTests.hpp
+9
-6
9 additions, 6 deletions
tests/MeshDataBaseForTests.hpp
tests/test_PolynomialReconstruction_degree_2.cpp
+6
-3
6 additions, 3 deletions
tests/test_PolynomialReconstruction_degree_2.cpp
with
50 additions
and
23 deletions
tests/MeshDataBaseForTests.cpp
+
35
−
14
View file @
70ef6a60
#include
<MeshDataBaseForTests.hpp>
#include
<MeshDataBaseForTests.hpp>
#include
<mesh/CartesianMeshBuilder.hpp>
#include
<mesh/CartesianMeshBuilder.hpp>
#include
<mesh/Connectivity.hpp>
#include
<mesh/Connectivity.hpp>
#include
<mesh/GmshReader.hpp>
#include
<mesh/GmshReader.hpp>
#include
<mesh/MeshVariant.hpp>
#include
<mesh/MeshVariant.hpp>
#include
<utils/GlobalVariableManager.hpp>
#include
<utils/Messenger.hpp>
#include
<utils/Messenger.hpp>
#include
<utils/PugsAssert.hpp>
#include
<utils/PugsAssert.hpp>
#include
<NbGhostLayersTester.hpp>
#include
<filesystem>
#include
<filesystem>
#include
<fstream>
#include
<fstream>
...
@@ -13,17 +17,22 @@ const MeshDataBaseForTests* MeshDataBaseForTests::m_instance = nullptr;
...
@@ -13,17 +17,22 @@ const MeshDataBaseForTests* MeshDataBaseForTests::m_instance = nullptr;
MeshDataBaseForTests
::
MeshDataBaseForTests
()
MeshDataBaseForTests
::
MeshDataBaseForTests
()
{
{
m_cartesian_1d_mesh
=
CartesianMeshBuilder
{
TinyVector
<
1
>
{
-
1
},
TinyVector
<
1
>
{
3
},
TinyVector
<
1
,
size_t
>
{
23
}}.
mesh
();
for
(
size_t
nb_ghost_layers
=
1
;
nb_ghost_layers
<=
m_max_nb_ghost_layers
;
++
nb_ghost_layers
)
{
NbGhostLayersTester
t
{
nb_ghost_layers
};
m_cartesian_
2
d_mesh
=
m_cartesian_
1
d_mesh
.
push_back
(
CartesianMeshBuilder
{
TinyVector
<
2
>
{
0
,
-
1
},
TinyVector
<
2
>
{
3
,
2
},
TinyVector
<
2
,
size_t
>
{
6
,
7
}}.
mesh
();
CartesianMeshBuilder
{
TinyVector
<
1
>
{
-
1
},
TinyVector
<
1
>
{
3
},
TinyVector
<
1
,
size_t
>
{
23
}}.
mesh
()
)
;
m_cartesian_
3
d_mesh
=
m_cartesian_
2
d_mesh
.
push_back
(
CartesianMeshBuilder
{
TinyVector
<
3
>
{
0
,
1
,
0
},
TinyVector
<
3
>
{
2
,
-
1
,
3
},
TinyVector
<
3
,
size_t
>
{
6
,
7
,
4
}}.
mesh
();
CartesianMeshBuilder
{
TinyVector
<
2
>
{
0
,
-
1
},
TinyVector
<
2
>
{
3
,
2
},
TinyVector
<
2
,
size_t
>
{
6
,
7
}}.
mesh
()
)
;
m_unordered_1d_mesh
=
_buildUnordered1dMesh
();
m_cartesian_3d_mesh
.
push_back
(
m_hybrid_2d_mesh
=
_buildHybrid2dMesh
();
CartesianMeshBuilder
{
TinyVector
<
3
>
{
0
,
1
,
0
},
TinyVector
<
3
>
{
2
,
-
1
,
3
},
TinyVector
<
3
,
size_t
>
{
6
,
7
,
4
}}.
mesh
());
m_hybrid_3d_mesh
=
_buildHybrid3dMesh
();
m_unordered_1d_mesh
.
push_back
(
_buildUnordered1dMesh
());
m_hybrid_2d_mesh
.
push_back
(
_buildHybrid2dMesh
());
m_hybrid_3d_mesh
.
push_back
(
_buildHybrid3dMesh
());
}
}
}
const
MeshDataBaseForTests
&
const
MeshDataBaseForTests
&
...
@@ -50,37 +59,49 @@ MeshDataBaseForTests::destroy()
...
@@ -50,37 +59,49 @@ MeshDataBaseForTests::destroy()
std
::
shared_ptr
<
const
MeshVariant
>
std
::
shared_ptr
<
const
MeshVariant
>
MeshDataBaseForTests
::
cartesian1DMesh
()
const
MeshDataBaseForTests
::
cartesian1DMesh
()
const
{
{
return
m_cartesian_1d_mesh
;
const
size_t
nb_ghost_layers
=
GlobalVariableManager
::
instance
().
getNumberOfGhostLayers
();
Assert
((
nb_ghost_layers
>=
1
)
and
(
nb_ghost_layers
<=
m_max_nb_ghost_layers
));
return
m_cartesian_1d_mesh
[
nb_ghost_layers
-
1
];
}
}
std
::
shared_ptr
<
const
MeshVariant
>
std
::
shared_ptr
<
const
MeshVariant
>
MeshDataBaseForTests
::
cartesian2DMesh
()
const
MeshDataBaseForTests
::
cartesian2DMesh
()
const
{
{
return
m_cartesian_2d_mesh
;
const
size_t
nb_ghost_layers
=
GlobalVariableManager
::
instance
().
getNumberOfGhostLayers
();
Assert
((
nb_ghost_layers
>=
1
)
and
(
nb_ghost_layers
<=
m_max_nb_ghost_layers
));
return
m_cartesian_2d_mesh
[
nb_ghost_layers
-
1
];
}
}
std
::
shared_ptr
<
const
MeshVariant
>
std
::
shared_ptr
<
const
MeshVariant
>
MeshDataBaseForTests
::
cartesian3DMesh
()
const
MeshDataBaseForTests
::
cartesian3DMesh
()
const
{
{
return
m_cartesian_3d_mesh
;
const
size_t
nb_ghost_layers
=
GlobalVariableManager
::
instance
().
getNumberOfGhostLayers
();
Assert
((
nb_ghost_layers
>=
1
)
and
(
nb_ghost_layers
<=
m_max_nb_ghost_layers
));
return
m_cartesian_3d_mesh
[
nb_ghost_layers
-
1
];
}
}
std
::
shared_ptr
<
const
MeshVariant
>
std
::
shared_ptr
<
const
MeshVariant
>
MeshDataBaseForTests
::
unordered1DMesh
()
const
MeshDataBaseForTests
::
unordered1DMesh
()
const
{
{
return
m_unordered_1d_mesh
;
const
size_t
nb_ghost_layers
=
GlobalVariableManager
::
instance
().
getNumberOfGhostLayers
();
Assert
((
nb_ghost_layers
>=
1
)
and
(
nb_ghost_layers
<=
m_max_nb_ghost_layers
));
return
m_unordered_1d_mesh
[
nb_ghost_layers
-
1
];
}
}
std
::
shared_ptr
<
const
MeshVariant
>
std
::
shared_ptr
<
const
MeshVariant
>
MeshDataBaseForTests
::
hybrid2DMesh
()
const
MeshDataBaseForTests
::
hybrid2DMesh
()
const
{
{
return
m_hybrid_2d_mesh
;
const
size_t
nb_ghost_layers
=
GlobalVariableManager
::
instance
().
getNumberOfGhostLayers
();
Assert
((
nb_ghost_layers
>=
1
)
and
(
nb_ghost_layers
<=
m_max_nb_ghost_layers
));
return
m_hybrid_2d_mesh
[
nb_ghost_layers
-
1
];
}
}
std
::
shared_ptr
<
const
MeshVariant
>
std
::
shared_ptr
<
const
MeshVariant
>
MeshDataBaseForTests
::
hybrid3DMesh
()
const
MeshDataBaseForTests
::
hybrid3DMesh
()
const
{
{
return
m_hybrid_3d_mesh
;
const
size_t
nb_ghost_layers
=
GlobalVariableManager
::
instance
().
getNumberOfGhostLayers
();
Assert
((
nb_ghost_layers
>=
1
)
and
(
nb_ghost_layers
<=
m_max_nb_ghost_layers
));
return
m_hybrid_3d_mesh
[
nb_ghost_layers
-
1
];
}
}
std
::
shared_ptr
<
const
MeshVariant
>
std
::
shared_ptr
<
const
MeshVariant
>
...
...
This diff is collapsed.
Click to expand it.
tests/MeshDataBaseForTests.hpp
+
9
−
6
View file @
70ef6a60
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include
<array>
#include
<array>
#include
<memory>
#include
<memory>
#include
<string>
#include
<string>
#include
<vector>
class
MeshVariant
;
class
MeshVariant
;
...
@@ -35,15 +36,17 @@ class MeshDataBaseForTests
...
@@ -35,15 +36,17 @@ class MeshDataBaseForTests
private
:
private
:
explicit
MeshDataBaseForTests
();
explicit
MeshDataBaseForTests
();
constexpr
static
size_t
m_max_nb_ghost_layers
=
3
;
static
const
MeshDataBaseForTests
*
m_instance
;
static
const
MeshDataBaseForTests
*
m_instance
;
std
::
shared_ptr
<
const
MeshVariant
>
m_cartesian_1d_mesh
;
std
::
vector
<
std
::
shared_ptr
<
const
MeshVariant
>
>
m_cartesian_1d_mesh
;
std
::
shared_ptr
<
const
MeshVariant
>
m_cartesian_2d_mesh
;
std
::
vector
<
std
::
shared_ptr
<
const
MeshVariant
>
>
m_cartesian_2d_mesh
;
std
::
shared_ptr
<
const
MeshVariant
>
m_cartesian_3d_mesh
;
std
::
vector
<
std
::
shared_ptr
<
const
MeshVariant
>
>
m_cartesian_3d_mesh
;
std
::
shared_ptr
<
const
MeshVariant
>
m_unordered_1d_mesh
;
std
::
vector
<
std
::
shared_ptr
<
const
MeshVariant
>
>
m_unordered_1d_mesh
;
std
::
shared_ptr
<
const
MeshVariant
>
m_hybrid_2d_mesh
;
std
::
vector
<
std
::
shared_ptr
<
const
MeshVariant
>
>
m_hybrid_2d_mesh
;
std
::
shared_ptr
<
const
MeshVariant
>
m_hybrid_3d_mesh
;
std
::
vector
<
std
::
shared_ptr
<
const
MeshVariant
>
>
m_hybrid_3d_mesh
;
std
::
shared_ptr
<
const
MeshVariant
>
_buildUnordered1dMesh
();
std
::
shared_ptr
<
const
MeshVariant
>
_buildUnordered1dMesh
();
std
::
shared_ptr
<
const
MeshVariant
>
_buildHybrid2dMesh
();
std
::
shared_ptr
<
const
MeshVariant
>
_buildHybrid2dMesh
();
...
...
This diff is collapsed.
Click to expand it.
tests/test_PolynomialReconstruction_degree_2.cpp
+
6
−
3
View file @
70ef6a60
...
@@ -14,12 +14,17 @@
...
@@ -14,12 +14,17 @@
#include
<DiscreteFunctionDPkForTests.hpp>
#include
<DiscreteFunctionDPkForTests.hpp>
#include
<MeshDataBaseForTests.hpp>
#include
<MeshDataBaseForTests.hpp>
#include
<NbGhostLayersTester.hpp>
// clazy:excludeall=non-pod-global-static
// clazy:excludeall=non-pod-global-static
TEST_CASE
(
"PolynomialReconstruction_degree_2"
,
"[scheme]"
)
TEST_CASE
(
"PolynomialReconstruction_degree_2"
,
"[scheme]"
)
{
{
constexpr
size_t
degree
=
2
;
constexpr
size_t
degree
=
2
;
constexpr
size_t
nb_ghost_layers
=
2
;
NbGhostLayersTester
t
{
nb_ghost_layers
};
SECTION
(
"without symmetries"
)
SECTION
(
"without symmetries"
)
{
{
std
::
vector
<
PolynomialReconstructionDescriptor
>
descriptor_list
=
std
::
vector
<
PolynomialReconstructionDescriptor
>
descriptor_list
=
...
@@ -158,9 +163,7 @@ TEST_CASE("PolynomialReconstruction_degree_2", "[scheme]")
...
@@ -158,9 +163,7 @@ TEST_CASE("PolynomialReconstruction_degree_2", "[scheme]")
-
1.7
+
2.1
*
x
[
0
]
-
0.7
*
x
[
0
]
*
x
[
0
],
//
-
1.7
+
2.1
*
x
[
0
]
-
0.7
*
x
[
0
]
*
x
[
0
],
//
+
1.4
-
0.6
*
x
[
0
]
+
1.9
*
x
[
0
]
*
x
[
0
]};
+
1.4
-
0.6
*
x
[
0
]
+
1.9
*
x
[
0
]
*
x
[
0
]};
},
},
[](
const
R1
&
x
)
->
R3
{
[](
const
R1
&
x
)
->
R3
{
return
R3
{
+
1.6
+
0.7
*
x
[
0
],
-
2.1
+
1.2
*
x
[
0
],
+
1.1
-
0.3
*
x
[
0
]};
}};
return
R3
{
+
1.6
+
0.7
*
x
[
0
],
-
2.1
+
1.2
*
x
[
0
],
+
1.1
-
0.3
*
x
[
0
]};
}};
DiscreteFunctionP0Vector
Vh
=
test_only
::
exact_projection
(
mesh
,
degree
,
vector_exact
);
DiscreteFunctionP0Vector
Vh
=
test_only
::
exact_projection
(
mesh
,
degree
,
vector_exact
);
...
...
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