// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // ============================================================================ // == == // == TU Dresden == // == == // == Institut für Wissenschaftliches Rechnen == // == Zellescher Weg 12-14 == // == 01069 Dresden == // == germany == // == == // ============================================================================ // == == // == https://gforge.zih.tu-dresden.de/projects/amdis/ == // == == // ============================================================================ /** \file RobinBC.h */ #ifndef AMDIS_ROBINBC_H #define AMDIS_ROBINBC_H #include "BoundaryCondition.h" #include "AbstractFunction.h" #include "DOFMatrix.h" #include "AMDiS.h" namespace AMDiS { /** * \ingroup Assembler * * \brief * Sub class of BoundaryCondition. Implements Robin and Neumann boundary conditions. * The flux in normal direction is given by \f$j = j_0 + \alpha u\f$ where * \f$j_0 \f$ and \f$alpha \f$ are functions evaluated at world coordinates * and \f$u \f$ is the problem solution. */ class RobinBC : public BoundaryCondition { public: /// Constructor. \f$j \f$ and \f$alpha \f$ are given as AbstractFunction objects. RobinBC(BoundaryType type, AbstractFunction > *j, AbstractFunction > *alpha, FiniteElemSpace *rowFeSpace, FiniteElemSpace *colFeSpace = NULL); /// Constructor. \f$j \f$ and \f$alpha \f$ are given as DOFVectors. RobinBC(BoundaryType type, DOFVectorBase *j, DOFVectorBase *alpha, FiniteElemSpace *rowFeSpace, FiniteElemSpace *colFeSpace = NULL); /// Constructor. \f$j \f$ and \f$alpha \f$ are given as Operator objects. RobinBC(BoundaryType type, Operator* jOp, Operator* alphaOp, FiniteElemSpace *rowFeSpace, FiniteElemSpace *colFeSpace = NULL); /// Implements BoundaryCondition::fillBoundaryCondition(); virtual void fillBoundaryCondition(DOFMatrix* matrix, ElInfo* elInfo, const DegreeOfFreedom* dofIndices, const BoundaryType* localBound, int nBasFcts); /// Implements BoundaryCondition::fillBoundaryCondition(); virtual void fillBoundaryCondition(DOFVectorBase* vector, ElInfo* elInfo, const DegreeOfFreedom* dofIndices, const BoundaryType* localBound, int nBasFcts); /// Implements BoundaryCondition::boundResidual(); virtual double boundResidual(ElInfo *elInfo, DOFMatrix *matrix, const DOFVectorBase *dv); protected: /// Surface operators for each element side for the Neumann part. DimVec* neumannOperators; /// Surface operators for each element side for the Robin part. DimVec* robinOperators; VectorOfFixVecs >**coords; }; class NeumannBC : public RobinBC { public: NeumannBC(BoundaryType type, AbstractFunction > *j, FiniteElemSpace *rowFeSpace, FiniteElemSpace *colFeSpace = NULL) : RobinBC(type, j, NULL, rowFeSpace, colFeSpace) {} NeumannBC(BoundaryType type, DOFVectorBase *j, FiniteElemSpace *rowFeSpace, FiniteElemSpace *colFeSpace = NULL) : RobinBC(type, j, NULL, rowFeSpace, colFeSpace) {} }; } #endif