Commit 9e5ac1b2 authored by Lukas Riedel's avatar Lukas Riedel

GridFactory builds YaspGrid without overlap. OVLP_AMG_4_DG works with YaspGrid

parent a7648318
......@@ -66,7 +66,8 @@ void Simulation<Traits>::operator_setup ()
// --- Solvers ---
lsgfs = std::make_unique<LSGFS>(LSGFSHelper::create(gv));
lscc = std::make_unique<LSCC>();
Dune::PDELab::constraints(*lsgfs,*lscc,false);
//Dune::PDELab::constraints(*lsgfs,*lscc,false);
//ls = std::make_unique<LS>(*gfs);
ls = std::make_unique<LS>(*igo,*cc,*lsgfs,*lscc,200,0);
//ls = std::make_unique<LS>(5000,0);
pdesolver = std::make_unique<PDESOLVER>(*igo,*ls);
......
......@@ -67,6 +67,7 @@ protected:
/// Linear solver type
using LS = Dune::PDELab::ISTLBackend_OVLP_AMG_4_DG<IGO,CC,LSGFS,LSCC,
Dune::PDELab::CG2DGProlongation,Dune::SeqSSOR,Dune::BiCGSTABSolver>;
//using LS = Dune::PDELab::ISTLBackend_BCGS_AMG_SSOR<IGO>;
/// Non-linear solver type
using PDESOLVER = Dune::PDELab::Newton<IGO,LS,U>;
/// Time stepping scheme
......
......@@ -84,7 +84,7 @@ public:
/// Constraints type of the GFS
using CON = Dune::PDELab::P0ParallelConstraints;
/// GFS type
using Type = typename Dune::PDELab::GridFunctionSpace<ES,FEM,CON,
using Type = typename Dune::PDELab::GridFunctionSpace<GridView,FEM,CON,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed> >;
/// GFS Constraints Container type
using CC = typename Type::template ConstraintsContainer<RF>::Type;
......@@ -92,12 +92,12 @@ public:
/// create GFS from GridView
static Type create (const GridView& gv)
{
ES es(gv);
//ES es(gv);
Dune::GeometryType geo;
geo.makeCube(dim);
auto fem = std::make_shared<FEM>(geo);
auto con = std::make_shared<CON>();
return Type(es,fem,con);
return Type(gv,fem,con);
}
};
......@@ -116,7 +116,7 @@ public:
/// FiniteElementMap type of GFS
using FEM = typename Dune::PDELab::PkLocalFiniteElementMap<ES,DF,RF,order>;
/// Constraints type of the GFS
using CON = Dune::PDELab::NoConstraints;
using CON = Dune::PDELab::P0ParallelConstraints;
/// GFS type
using Type = typename Dune::PDELab::GridFunctionSpace<ES,FEM,CON,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed>>;
......@@ -147,7 +147,7 @@ public:
/// FiniteElementMap type of GFS
using FEM = typename Dune::PDELab::QkDGLocalFiniteElementMap<DF,RF,order,dim>;
/// Constraints type of the GFS
using CON = Dune::PDELab::NoConstraints;
using CON = Dune::PDELab::P0ParallelConstraints;
/// GFS type
using Type = typename Dune::PDELab::GridFunctionSpace<ES,FEM,CON,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed> >;
......
......@@ -26,11 +26,11 @@ using SimplexAdaptive = Dune::Dorie::BaseTraits<Dune::UGGrid,
template<int dim, int order>
using Cube = Dune::Dorie::BaseTraits<Dune::Dorie::YaspGrid,
Dune::GeometryType::BasicType::cube,dim,order,true,false>;
/*
template<int dim, int order>
using CubeAdaptive = Dune::Dorie::BaseTraits<Dune::UGGrid,
Dune::GeometryType::BasicType::cube,dim,order,true,true>;
*/
int main(int argc, char** argv)
{
try{
......@@ -100,6 +100,7 @@ int main(int argc, char** argv)
}
}
else if (gtype == "rectangular"){
/*
if(adaptivity){
auto grid = Dune::Dorie::build_grid_cube<Dune::UGGrid<2>>(inifile,helper);
switch(FEorder){
......@@ -113,6 +114,7 @@ int main(int argc, char** argv)
}
}
else{ // no adaptivity
*/
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<2>>(inifile,helper);
switch(FEorder){
case 1:{
......@@ -123,7 +125,7 @@ int main(int argc, char** argv)
default:
DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!");
}
}
//}
}
else
DUNE_THROW(Dune::NotImplemented,"Grid Type not supported!");
......
......@@ -66,9 +66,10 @@ std::shared_ptr<GridType> build_grid_cube (const Dune::ParameterTree& inifile, c
const int level = inifile.get<int>("grid.initialLevel");
const Dune::FieldVector<double,dim> lowerLeft(0.);
const Dune::FieldVector<double,dim> upperRight = inifile.get<Dune::FieldVector<double,dim>>("grid.extensions");
const Dune::array<unsigned int,dim> elements = inifile.get<Dune::array<unsigned int,dim>>("grid.cells");
const Dune::array<int,dim> elements = inifile.get<Dune::array<int,dim>>("grid.cells");
auto grid = Dune::StructuredGridFactory<GridType>::createCubeGrid(lowerLeft,upperRight,elements);
//auto grid = Dune::StructuredGridFactory<GridType>::createCubeGrid(lowerLeft,upperRight,elements);
auto grid = std::make_shared<GridType>(upperRight,elements);
grid->globalRefine(level);
grid->loadBalance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment