Skip to content
Snippets Groups Projects
Commit 0d1e9f80 authored by Samuel Burbulla's avatar Samuel Burbulla
Browse files

[factory] Add test of boundary segments in 2d.

parent 3caacd2f
No related branches found
No related tags found
1 merge request!59[gridfactory] Implement insertBoundarySegment.
Pipeline #19618 failed
Point(1) = { 0, 0, 0, 10.0};
Point(2) = { 0, 0, 1, 10.0};
Point(3) = {-1, 0, 0, 10.0};
Point(4) = { 1, 0, 1, 10.0};
Point(5) = { 1, 1, 1, 10.0};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 1};
Line(4) = {1, 4};
Line(5) = {4, 2};
Line(6) = {2, 5};
Line(7) = {5, 1};
Line Loop(1) = {1, 2, 3};
Plane Surface(1) = {1};
Line Loop(2) = {-1, 4, 5};
Plane Surface(2) = {2};
Line Loop(3) = {1, 6, 7};
Plane Surface(3) = {3};
Physical Surface(1) = {1:3};
Physical Line(42) = {2,3,4};
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
5
1 0 0 0
2 0 0 1
3 -1 0 0
4 1 0 1
5 1 1 1
$EndNodes
$Elements
6
1 1 2 42 2 2 3
2 1 2 42 3 3 1
3 1 2 42 4 1 4
4 2 2 1 1 1 2 3
5 2 2 1 2 1 4 2
6 2 2 1 3 1 2 5
$EndElements
......@@ -78,7 +78,24 @@ int main (int argc, char *argv[]) try
auto grid = std::shared_ptr<Grid>(factory.createGrid());
// check the boundary segments
checkBoundarySegments(*grid, factory,boundaryMarkers, 2, 1, 8);
checkBoundarySegments(*grid, factory, boundaryMarkers, 2, 1, 8);
}
{
std::cout << "\n################################################\n";
std::cout << "Checking FoamGrid<2, 3> (2d in 3d grid)\n";
std::cout << "################################################\n\n";
std::cout << " Creating grid" << std::endl;
using Grid = FoamGrid<2, 3>;
GridFactory<Grid> factory;
std::vector<int> boundaryMarkers, elementMarkers;
GmshReader<Grid>::read(factory, dune_foamgrid_path + "junction2d3dbseg.msh", boundaryMarkers, elementMarkers, /*verbose*/ true, /*insertBoundarySegments*/ true);
auto grid = std::shared_ptr<Grid>(factory.createGrid());
// check the boundary segments
checkBoundarySegments(*grid, factory, boundaryMarkers, 6, 3, 12);
}
}
// //////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment