

AMDiS (Adaptive MultiDimensional Simulations) is a C++ library to solve a broad class of partial differential equations (PDE) using adaptive finite elements. Here you will find some information and tutorials about AMDiS usage/installation/extension...






## Installation of AMDiS



 [Installing AMDiS on Linux](install_linux)



 [Installing AMDiS on Windows](install_win)



 [Installing AMDiS on MacOS](install_mac)






## Tutorial



The objective of this tutorial is to introduce the user into the main AMDiS features by giving some application examples.






For every example the following aspects are described:



 **Abstract problem description**: In the header of each example section, the abstract problem definition is given. Sometimes, some solution strategies on a high abstraction level are mentioned, also.



 **Source code**: In the source code section, the listing of the example source code is explained.



 **Parameter file**: In this section, the parameter file is described. The parameter file contains parameters which are read be the application at runtime. The name of the parameter file is usually passed to the the application as a command line argument.



 **Macro file*: In the macro file section, the definition of the coarse macro mesh is shown, which is the basis for adaptive refinements.



 **Output**: The AMDiS results are written to output files that contain the final mesh and the problem solution on this mesh. The output can be visualized with [ParaView](http://www.paraview.org). In the output section, the visualized problem results are shown and discussed.






To avoid unnecessary repetitions, not every aspect of every example is described, but only those aspects that have not appeared in previous examples.






Available examples:



 [Stationary problem with Dirichlet boundary condition](demo_ellipt)



 [Time dependent problem](demo_heat)



 [Systems of PDEs](demo_vecellipt)



 [Neumann boundary conditions](demo_neumann)



 [Periodic boundary conditions](demo_periodic)



 [Projections](demo_projection)



 [Parametric elements](demo_parametric)






## Tutorial (using expressions syntax)



The new expressions syntax is applied to the AMDiS demos to see the advantage over the old syntax and how to use it in realworld examples.






Available examples:



 [Poisson equation](demo_expr_ellipt)



 [Heat equation](demo_expr_heat)



 [Nonlinear example](demo_expr_nonlin)



 [Rosenbrock timediscretization](demo_expr_rosenbrock)






## Expressions



In order to write a differential equation in a mathematical natural way we have developed an expression framework, that allowes exacly this. Instead of adding abstract operatorclasses to the problem definition we implement the coefficient functions of the operators using mathematical operators. An example is the following bilinearform






```math



a(c,\vartheta) := \big\langle\frac{1}{\epsilon}(\phi^2  1) c,\; \vartheta\big\rangle + \big\langle\max(10^{5},\;(\phi+1))\nabla c,\; \nabla\vartheta\big\rangle



```






Assume that ``\phi`` represents a DOFVector, i.e. a discrete representation of a function in a functionspace, that is known in advance, or given by an iterative solution procedure from the last iteration. Here we use a solution component of the problem `prob`:






```c++



DOFVector<double>* phi = prob>getSolution(0);



```






The bilinearform consists of two individual parts, a term of zeroth derivative order (ZOT) and a term that contains two derivatives, of ``c`` and ``\vartheta``, i.e. of the trial and test function. We have to implement the corresponding coefficient functions of these two terms individually and add the term using the functions `addZOT`, respective `addSOT` to the operator. Lets assume the trial and test functions are in the finite element space`feSpace` given as the first space of the problem, then we can define the bilinearform as






```c++



const FiniteElemSpace* feSpace = prob>getFeSpace(0);






Operator *op = new Operator(feSpace, feSpace);



addZOT(op, (1.0/epsilon) * (pow<2>(valueOf(phi))  1.0) );



addSOT(op, max(1.e5, valueOf(phi) + 1.0) )



prob>addMatrixOperator(*op, 0, 0);



```






the keyword `valueOf` indicates that we want to evaluate the values of the `DOFVector` at the corresponding quadrature points during assembling. One could als evaluate the gradient, or partial derivative of a `DOFVector`, using the functions `gradientOf(DV)`, or `derivativeOf(DV, comp)`, respectively.






For details see the [AMDiSExpressions reference page](amdis_expressions).









## Initfile Manual



AMDiS is equipped with a parser for parameter files to control simulations,



e.g. set material parameters, define the timestep length, set meshes for each



problem and configure the number of global refinements. These parameter files



(or initfiles) are simple text files in a special syntax, that is described here.






For details see the [AMDiSInitfile reference page](amdis_initfile).






## AMDiS extensions



Many things can be realized using AMDiS today, but some things



are really complicated to implement. Other common tasks need a lot



of coding to be solved.






In the ''AMDiSExtensions'' a lot of standard task are realized and



implemented. This manual should give you a short introduction



to some of the features. The extensions are work in progress, so



the signature and interface of the methods and classes can change



from one version to the next. Nevertheless it builds a set of



very useful tools are used in every day work by several projects



today.






The manual still not covers all features of the AMDiSExtensions.



But it should give you enough information to get started.






 [Introduction](amdis_extensions_intro)



 [Handling data on unstructured gridsHandling data on unstructured grids](amdis_extensions_data)



 [Mesh refinement tools](amdis_extensions_refinement)



 [Boundary conditions](amdis_extensions_bc)



 [Base Problems](amdis_extensions_baseproblems)






## Visualization



AMDiS provides a list of different output formats. We recommend to use ParaView as visualization tool. Therefore we have implemented a VTUwriter for stationary solutions and a PVD writer for animated data, respective time series. Also writers for other formats are provided and can be configurated. Read here how to deal with output data...






For details see the [AMDiSVisualization page](visualization). 


\ No newline at end of file 