Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • extensions/dune-foamgrid
  • ansgar/dune-foamgrid
  • simon.praetorius/dune-foamgrid
  • kilian.weishaupt/dune-foamgrid
  • samuel.burbulla/dune-foamgrid
  • lisa_julia.nebel/dune-foamgrid
6 results
Show changes
Commits on Source (6)
...@@ -58,7 +58,7 @@ namespace Dune { ...@@ -58,7 +58,7 @@ namespace Dune {
} }
GeometryType type() const { GeometryType type() const {
return GeometryType(1); return GeometryTypes::line;
} }
bool hasFather() const bool hasFather() const
......
...@@ -211,7 +211,7 @@ namespace Dune { ...@@ -211,7 +211,7 @@ namespace Dune {
} }
GeometryType type() const { GeometryType type() const {
return GeometryType(GeometryType::simplex, 2); return GeometryTypes::simplex(2);
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <dune/common/version.hh> #include <dune/common/version.hh>
#include <dune/geometry/type.hh>
#include <dune/grid/common/indexidset.hh> #include <dune/grid/common/indexidset.hh>
#include <dune/foamgrid/foamgrid/foamgridvertex.hh> // for FoamGridEntityImp #include <dune/foamgrid/foamgrid/foamgridvertex.hh> // for FoamGridEntityImp
...@@ -164,18 +165,18 @@ namespace Dune { ...@@ -164,18 +165,18 @@ namespace Dune {
myTypes_[i].clear(); myTypes_[i].clear();
if (numTriangles_>0 && dimgrid == 2) if (numTriangles_>0 && dimgrid == 2)
myTypes_[0].push_back(Dune::GeometryTypes::simplex(2)); myTypes_[0].push_back(GeometryTypes::simplex(2));
if (numQuads_>0 && dimgrid == 2) if (numQuads_>0 && dimgrid == 2)
myTypes_[0].push_back(Dune::GeometryTypes::cube(2)); myTypes_[0].push_back(GeometryTypes::cube(2));
if (numEdges_>0 && dimgrid == 2) if (numEdges_>0 && dimgrid == 2)
myTypes_[1].push_back(Dune::GeometryTypes::simplex(1)); myTypes_[1].push_back(GeometryTypes::simplex(1));
if (numEdges_>0 && dimgrid == 1) if (numEdges_>0 && dimgrid == 1)
myTypes_[0].push_back(Dune::GeometryTypes::simplex(1)); myTypes_[0].push_back(GeometryTypes::simplex(1));
if (numVertices_>0) if (numVertices_>0)
myTypes_[dimgrid].push_back(Dune::GeometryTypes::simplex(0)); myTypes_[dimgrid].push_back(GeometryTypes::simplex(0));
} }
private: private:
...@@ -378,18 +379,18 @@ public: ...@@ -378,18 +379,18 @@ public:
if (numTriangles_>0 && dimgrid == 2) if (numTriangles_>0 && dimgrid == 2)
myTypes_[0].push_back(Dune::GeometryTypes::simplex(2)); myTypes_[0].push_back(GeometryTypes::simplex(2));
if (numQuads_>0 && dimgrid == 2) if (numQuads_>0 && dimgrid == 2)
myTypes_[0].push_back(Dune::GeometryTypes::cube(2)); myTypes_[0].push_back(GeometryTypes::cube(2));
if (numEdges_>0 && dimgrid == 2) if (numEdges_>0 && dimgrid == 2)
myTypes_[1].push_back(GeometryType(1)); myTypes_[1].push_back(GeometryTypes::line);
if (numEdges_>0 && dimgrid == 1) if (numEdges_>0 && dimgrid == 1)
myTypes_[0].push_back(GeometryType(1)); myTypes_[0].push_back(GeometryTypes::line);
if (numVertices_>0) if (numVertices_>0)
myTypes_[dimgrid].push_back(GeometryType(0)); myTypes_[dimgrid].push_back(GeometryTypes::vertex);
} }
private: private:
......
...@@ -64,7 +64,7 @@ namespace Dune { ...@@ -64,7 +64,7 @@ namespace Dune {
} }
GeometryType type() const { GeometryType type() const {
return GeometryType(0); return GeometryTypes::vertex;
} }
bool hasFather() const bool hasFather() const
......
...@@ -36,16 +36,16 @@ void checkGridElementGrowth(Grid& grid, int numElements) ...@@ -36,16 +36,16 @@ void checkGridElementGrowth(Grid& grid, int numElements)
if (i==0) if (i==0)
{ {
// find the second index // find the second index
Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid,Dune::MCMGVertexLayout> mapper(grid); Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid> mapper(grid, Dune::mcmgVertexLayout());
// insert the new element // insert the new element
grid.insertElement(Dune::GeometryType(1), grid.insertElement(GeometryTypes::line,
{mapper.index(element.template subEntity<dim>(0)), newVIdx} {mapper.index(element.template subEntity<dim>(0)), newVIdx}
); );
} }
else else
{ {
grid.insertElement(Dune::GeometryType(1), grid.insertElement(GeometryTypes::line,
{oldVIdx, newVIdx} {oldVIdx, newVIdx}
); );
} }
...@@ -113,7 +113,7 @@ void checkGridElementMerge(Grid& grid) ...@@ -113,7 +113,7 @@ void checkGridElementMerge(Grid& grid)
enum { dim = Grid::dimension }; enum { dim = Grid::dimension };
// vertex mapper // vertex mapper
Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid,Dune::MCMGVertexLayout> mapper(grid); Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid> mapper(grid, Dune::mcmgVertexLayout());
// insert an element between the two closest boundary facets // insert an element between the two closest boundary facets
std::vector<unsigned int> vertices(dim+1); std::vector<unsigned int> vertices(dim+1);
...@@ -147,7 +147,7 @@ void checkGridElementMerge(Grid& grid) ...@@ -147,7 +147,7 @@ void checkGridElementMerge(Grid& grid)
} }
} }
} }
grid.insertElement(Dune::GeometryType(1), vertices); grid.insertElement(Dune::GeometryTypes::line, vertices);
std::size_t numBoundarySegments = grid.numBoundarySegments(); std::size_t numBoundarySegments = grid.numBoundarySegments();
std::cout << std::endl<< "numBoundarySegments before merge: " << numBoundarySegments << std::endl; std::cout << std::endl<< "numBoundarySegments before merge: " << numBoundarySegments << std::endl;
...@@ -253,7 +253,7 @@ void checkGridElementGrowthLevel(Grid& grid) ...@@ -253,7 +253,7 @@ void checkGridElementGrowthLevel(Grid& grid)
std::cout << "-------------------------------------------" << std::endl; std::cout << "-------------------------------------------" << std::endl;
// vertex mapper // vertex mapper
Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid,Dune::MCMGVertexLayout> mapper(grid); Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid> mapper(grid, Dune::mcmgVertexLayout());
// Then we do a merge with a level 1 and a level 0 vertex // Then we do a merge with a level 1 and a level 0 vertex
std::vector<unsigned int> elementVertices(dim+1); std::vector<unsigned int> elementVertices(dim+1);
for (const auto& element : elements(grid.leafGridView())) for (const auto& element : elements(grid.leafGridView()))
...@@ -274,7 +274,7 @@ void checkGridElementGrowthLevel(Grid& grid) ...@@ -274,7 +274,7 @@ void checkGridElementGrowthLevel(Grid& grid)
} }
} }
grid.insertElement(Dune::GeometryType(1), elementVertices); grid.insertElement(Dune::GeometryTypes::line, elementVertices);
bool elementsWillVanish = grid.preGrow(); bool elementsWillVanish = grid.preGrow();
if(elementsWillVanish) if(elementsWillVanish)
...@@ -316,8 +316,8 @@ void checkGridElementGrowthLevel(Grid& grid) ...@@ -316,8 +316,8 @@ void checkGridElementGrowthLevel(Grid& grid)
Dune::FieldVector<double, dimworld> growPoint(6.0); Dune::FieldVector<double, dimworld> growPoint(6.0);
growPoint[0] = 0.0; growPoint[0] = 0.0;
auto vIdx = grid.insertVertex(growPoint); auto vIdx = grid.insertVertex(growPoint);
grid.insertElement(Dune::GeometryType(1), {vIdx, elementVertices[0]}); grid.insertElement(Dune::GeometryTypes::line, {vIdx, elementVertices[0]});
grid.insertElement(Dune::GeometryType(1), {vIdx, elementVertices[1]}); grid.insertElement(Dune::GeometryTypes::line, {vIdx, elementVertices[1]});
elementsWillVanish = grid.preGrow(); elementsWillVanish = grid.preGrow();
if(elementsWillVanish) if(elementsWillVanish)
......
...@@ -20,7 +20,7 @@ void checkGridElementGrowth(Grid& grid) ...@@ -20,7 +20,7 @@ void checkGridElementGrowth(Grid& grid)
enum { dim = Grid::dimension }; enum { dim = Grid::dimension };
// the vertex mapper // the vertex mapper
LeafMultipleCodimMultipleGeomTypeMapper<Grid, MCMGVertexLayout> mapper(grid); LeafMultipleCodimMultipleGeomTypeMapper<Grid> mapper(grid, mcmgVertexLayout());
// let the top element grow // let the top element grow
for (const auto& element : elements(grid.leafGridView())) for (const auto& element : elements(grid.leafGridView()))
...@@ -175,7 +175,7 @@ int main (int argc, char *argv[]) ...@@ -175,7 +175,7 @@ int main (int argc, char *argv[])
auto idx1 = grid->insertVertex({3.0, 3.0, 3.0}); auto idx1 = grid->insertVertex({3.0, 3.0, 3.0});
auto idx2 = grid->insertVertex({3.0, 3.5, 3.0}); auto idx2 = grid->insertVertex({3.0, 3.5, 3.0});
auto idx3 = grid->insertVertex({3.5, 3.0, 3.0}); auto idx3 = grid->insertVertex({3.5, 3.0, 3.0});
grid->insertElement(Dune::GeometryType(Dune::GeometryType::simplex, dim), {idx1, idx2, idx3}); grid->insertElement(GeometryTypes::simplex(dim), {idx1, idx2, idx3});
grid->preGrow(); grid->preGrow();
grid->grow(); grid->grow();
grid->postGrow(); grid->postGrow();
......
...@@ -54,7 +54,7 @@ GridType* make2Din3DHybridTestGrid() ...@@ -54,7 +54,7 @@ GridType* make2Din3DHybridTestGrid()
std::vector<unsigned int> cornerIDs(3); std::vector<unsigned int> cornerIDs(3);
for (int j=0; j<3; j++) for (int j=0; j<3; j++)
cornerIDs[j] = triangles[i][j]; cornerIDs[j] = triangles[i][j];
factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex,2),cornerIDs); factory.insertElement(GeometryTypes::simplex(2), cornerIDs);
} }
...@@ -76,12 +76,12 @@ GridType* make2Din3DHybridTestGrid() ...@@ -76,12 +76,12 @@ GridType* make2Din3DHybridTestGrid()
std::vector<unsigned int> cornerIDs(3); std::vector<unsigned int> cornerIDs(3);
for (int j=0; j<3; j++) for (int j=0; j<3; j++)
cornerIDs[j] = quadrilaterals[i][j]; cornerIDs[j] = quadrilaterals[i][j];
factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex,2),cornerIDs); factory.insertElement(GeometryTypes::simplex(2), cornerIDs);
cornerIDs[0] = quadrilaterals[i][3]; cornerIDs[0] = quadrilaterals[i][3];
cornerIDs[1] = quadrilaterals[i][2]; cornerIDs[1] = quadrilaterals[i][2];
cornerIDs[2] = quadrilaterals[i][1]; cornerIDs[2] = quadrilaterals[i][1];
factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex,2),cornerIDs); factory.insertElement(GeometryTypes::simplex(2), cornerIDs);
} }
...@@ -93,7 +93,7 @@ GridType* make2Din3DHybridTestGrid() ...@@ -93,7 +93,7 @@ GridType* make2Din3DHybridTestGrid()
std::vector<unsigned int> cornerIDs(4); std::vector<unsigned int> cornerIDs(4);
for (int j=0; j<4; j++) for (int j=0; j<4; j++)
cornerIDs[j] = quadrilaterals[i][j]; cornerIDs[j] = quadrilaterals[i][j];
factory.insertElement(Dune::GeometryType(Dune::GeometryType::cube,2),cornerIDs); factory.insertElement(GeometryTypes::cube(2), cornerIDs);
} }
#endif #endif
......
...@@ -366,8 +366,7 @@ void oneDimensionalTest () ...@@ -366,8 +366,7 @@ void oneDimensionalTest ()
// using a finite volume method with an explicit Euler time discretization // using a finite volume method with an explicit Euler time discretization
// make a mapper for codim 0 entities in the leaf grid // make a mapper for codim 0 entities in the leaf grid
Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid,Dune::MCMGElementLayout> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid> mapper(*grid, Dune::mcmgElementLayout());
mapper(*grid);
// the primary variable vector // the primary variable vector
std::vector<double> temperature(mapper.size()); std::vector<double> temperature(mapper.size());
...@@ -445,7 +444,7 @@ void twoDimensionalTest () ...@@ -445,7 +444,7 @@ void twoDimensionalTest ()
} }
// Create the element geometries // Create the element geometries
Dune::GeometryType type(Dune::GeometryType::simplex, 2); constexpr auto type = Dune::GeometryTypes::simplex(2);
std::vector<std::vector<unsigned int> > cornerIDs({{1,9,11},{3,9,11},{2,3,5},{2,3,7}, std::vector<std::vector<unsigned int> > cornerIDs({{1,9,11},{3,9,11},{2,3,5},{2,3,7},
{0,1,4},{0,1,6},{4,5,8},{4,5,9}, {0,1,4},{0,1,6},{4,5,8},{4,5,9},
{0,8,10},{2,8,10},{6,7,10},{6,7,11}, {0,8,10},{2,8,10},{6,7,10},{6,7,11},
...@@ -475,8 +474,7 @@ void twoDimensionalTest () ...@@ -475,8 +474,7 @@ void twoDimensionalTest ()
// using an h-adaptive finite volume method with an explicit Euler time discretization // using an h-adaptive finite volume method with an explicit Euler time discretization
// make a mapper for codim 0 entities in the leaf grid // make a mapper for codim 0 entities in the leaf grid
Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid,Dune::MCMGElementLayout> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Grid> mapper(*grid, Dune::mcmgElementLayout());
mapper(*grid);
// the primary variable vector // the primary variable vector
std::vector<double> temperature(mapper.size()); std::vector<double> temperature(mapper.size());
......
...@@ -77,8 +77,7 @@ int main (int argc, char *argv[]) try ...@@ -77,8 +77,7 @@ int main (int argc, char *argv[]) try
factory.insertVertex(parametrization(p)); factory.insertVertex(parametrization(p));
// Create the element geometries // Create the element geometries
Dune::GeometryType triangle; constexpr auto triangle = Dune::GeometryTypes::triangle;
triangle.makeTriangle();
std::array<FieldVector<double,2>, 3> corners0 = {vertices[0], vertices[1], vertices[2]}; std::array<FieldVector<double,2>, 3> corners0 = {vertices[0], vertices[1], vertices[2]};
std::array<FieldVector<double,2>, 3> corners1 = {vertices[1], vertices[3], vertices[2]}; std::array<FieldVector<double,2>, 3> corners1 = {vertices[1], vertices[3], vertices[2]};
......