PhaseFieldCrystal_.h 1.63 KB
 Praetorius, Simon committed Oct 23, 2013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 ``````/** \file PhaseFieldCrystal_.h */ #ifndef PHASE_FIELD_CRYSTAL_PRECON_H_ #define PHASE_FIELD_CRYSTAL_PRECON_H_ #include "AMDiS.h" #include "BaseProblem.h" #include "ExtendedProblemStat.h" using namespace AMDiS; /** Phase-field Crystal problem */ class PhaseFieldCrystal_ : public BaseProblem { public: // typedefs typedef BaseProblem super; public: PhaseFieldCrystal_(const std::string &name_, bool createProblem = true); ~PhaseFieldCrystal_() {} double *getTempParameter() { return &tempParameter; } virtual void fillOperators(); virtual void fillBoundaryConditions(); protected: bool useMobility; double tempParameter; double r; double rho0; double density; double two; double minus2; }; /** \ingroup MainInstat * \brief * Abstract function to calculate the pure PFC-Energy */ class Energy : public BinaryAbstractFunction { public: Energy() : BinaryAbstractFunction(4) { } double operator()(const double &rho, const double &mu) const { return -0.25*sqr(sqr(rho)) + 0.5*rho*mu; } }; class MobilityPfc : public AbstractFunction { public: MobilityPfc(double density_ = -0.3, double factor_ = 1.0, int degree=1) : AbstractFunction(degree+1), density(density_), factor(factor_), delta(1.e-6) { } double operator()(const double &rho) const { double mobility= abs(rho + 1.5)*factor; return std::max(mobility, 0.0); } protected: double density; double factor; double delta; }; #endif // PHASE_FIELD_CRYSTAL_PRECON_H_``````