AMDiS {#mainpage} ===== The *Adaptive Multi-Dimensional Simulation Toolbox* (AMDiS) is a Finite-Element discretization module allowing for fast prototyping of PDEs on adaptively refined grids. It is implemented on top of the [Dune](https://dune-project.org) framework. Tutorial -------- As an example of usage, we want to solve an elliptic PDE, the Poisson equation, \f$-\Delta u = f \f$ in \f$\Omega \f$ with \f$u = g \f$ on a subset of the boundary \f$\Gamma\subset\partial\Omega \f$. For simplicity, we assume \f$f(x) \equiv -1 \f$ and \f$g(x) \equiv 0 \f$, the domain \f$\Omega \f$ a square domain \f$[0,1]^2 \f$ and \f$\Gamma \f$ the lower and left edge of the boundary. ~~~~~~~~~~~~~~~{.cpp} #include #include #include #include // The namespace all AMDiS classes and functions are defined in using namespace AMDiS; // A dune grid type using Grid = Dune::AlbertaGrid; // A dune-functions globalBasis wrapped in a struct, // here representing local polynomial shape functions of degree 1 using Traits = LagrangeBasis; int main(int argc, char* argv[]) { // Initialize linear-algebra backend and read parameters from file Environment env(argc, argv); // Create a problem class containing all data for assembling ProblemStat prob("poisson"); // Initialize grid, globalBasis, solution vector and systenmatrix prob.initialize(INIT_ALL); // An operator representing the weak laplacian with coefficient = 1.0 auto opL = makeOperator(tag::gradtest_gradtrial{}, 1.0); prob.addMatrixOperator(opL, 0, 0); // An rhs-operator representing an analytic function f(x) = -1 auto opF = makeOperator(tag::test{}, [](auto const& x) { return -1.0; }, 0); prob.addVectorOperator(opF, 0); // Define the boundary Gamma auto predicate = [](auto const& x){ return x[0] < 1.e-8 || x[1] < 1.e-8; }; // Set a value g(x) = 0 at this part of the boundary prob.addDirichletBC(predicate, 0, 0, 0.0); // assemble and solve the linear system AdaptInfo adaptInfo("adapt"); AdaptStationary adapt("adapt", prob); adapt.adapt(); return 0; } ~~~~~~~~~~~~~~~ Notes ----- An AMDiS program consists of three main incredients: 1. A Problem class that holds all information necessary for assembling a linear system, see \ref ProblemStat. 2. Operators describing the (bi)linear-form of your PDE, see \ref operators. 3. A parameter file controlling several parts of the solution process, see \ref Initfile.