diff --git a/AMDiS/src/MathFunctions.h b/AMDiS/src/MathFunctions.h index 7067585277e0bb50e69d09fb5bb7ec59138ef3db..26063236b334410b5da052c4f9ca4a95202693e1 100644 --- a/AMDiS/src/MathFunctions.h +++ b/AMDiS/src/MathFunctions.h @@ -1,10 +1,10 @@ -#ifndef AMDIS_MATHFUNCTIONS_H -#define AMDIS_MATHFUNCTIONS_H - - { - if (r < 0) - return 1; - if (r > 0) +// ============================================================================ +// == == +// == AMDiS - Adaptive multidimensional simulations == +// == == +// == http://www.amdis-fem.org == +// == == +// ============================================================================ // // Software License for AMDiS // @@ -17,6 +17,27 @@ // See also license.opensource.txt in the distribution. + +/** \file MathFunctions.h */ + +#ifndef AMDIS_MATHFUNCTIONS_H +#define AMDIS_MATHFUNCTIONS_H + +#include "Global.h" +#include <limits> + +using namespace std; +namespace AMDiS { + //converts signed distance to phasefield + inline double Phi1(double r, double eps) { return 0.5 * (1 - tanh(3 * r / eps)); } + inline double Phi2(double r, double eps) { return 0.5 * (1 + tanh(3 * r / eps)); } + + //levelset: positive (1) in the set, negative (-1) outside, zero on the boundary + inline double LevelSet(double r) + { + if (r < 0) + return 1; + if (r > 0) return -1; return 0; } diff --git a/AMDiS/src/SolutionDataStorage.h b/AMDiS/src/SolutionDataStorage.h index 1d7fd6f7c7f95dc42ab9f0553d80e8becdb52f9f..b0ed65641759d3e45068d02cb66f5cb27f821348 100644 --- a/AMDiS/src/SolutionDataStorage.h +++ b/AMDiS/src/SolutionDataStorage.h @@ -1,10 +1,10 @@ -#ifndef AMDIS_SOLUTION_DATA_STORAGE_H -#define AMDIS_SOLUTION_DATA_STORAGE_H - - struct SolutionHelper - { - typedef FiniteElemSpace* type; - }; +// ============================================================================ +// == == +// == AMDiS - Adaptive multidimensional simulations == +// == == +// == http://www.amdis-fem.org == +// == == +// ============================================================================ // // Software License for AMDiS // @@ -18,6 +18,27 @@ +/** \file SolutionDataStorage.h */ + +#ifndef AMDIS_SOLUTION_DATA_STORAGE_H +#define AMDIS_SOLUTION_DATA_STORAGE_H + +#include <iostream> +#include <fstream> +#include <vector> +#include <map> +#include "DOFVector.h" +#include "SystemVector.h" +#include "Parameters.h" + +namespace AMDiS { + + template<typename T> + struct SolutionHelper + { + typedef FiniteElemSpace* type; + }; + template <> struct SolutionHelper<SystemVector> { @@ -25,6 +46,7 @@ }; + /** \brief * Class to store solution data for one timestep. *