diff --git a/Apps/Common/SIMMultiPatchModelGen.C b/Apps/Common/SIMMultiPatchModelGen.C new file mode 100644 index 00000000..c77c949a --- /dev/null +++ b/Apps/Common/SIMMultiPatchModelGen.C @@ -0,0 +1,34 @@ +// $Id$ +//============================================================================== +//! +//! \file SIMMultiPatchModelGen.C +//! +//! \date Sep 5 2016 +//! +//! \author Arne Morten Kvarving / SINTEF +//! +//! \brief Base class for simulators equipped with multi-patch model generators. +//! +//============================================================================== + +#include "SIMMultiPatchModelGen.h" +#include "MultiPatchModelGenerator.h" +#include "IFEM.h" +#include "SIM2D.h" +#include "SIM3D.h" + + +template<> +ModelGenerator* SIMMultiPatchModelGen::createModelGenerator(const TiXmlElement* geo) const +{ + IFEM::cout <<" Using multi-patch model generator" << std::endl; + return new MultiPatchModelGenerator2D(geo); +} + + +template<> +ModelGenerator* SIMMultiPatchModelGen::createModelGenerator(const TiXmlElement* geo) const +{ + IFEM::cout <<" Using multi-patch model generator" << std::endl; + return new MultiPatchModelGenerator3D(geo); +} diff --git a/Apps/Common/SIMMultiPatchModelGen.h b/Apps/Common/SIMMultiPatchModelGen.h new file mode 100644 index 00000000..98669197 --- /dev/null +++ b/Apps/Common/SIMMultiPatchModelGen.h @@ -0,0 +1,45 @@ +// $Id$ +//============================================================================== +//! +//! \file SIMMultiPatchModelGen.h +//! +//! \date Sep 5 2016 +//! +//! \author Arne Morten Kvarving / SINTEF +//! +//! \brief Base class for simulators equipped with multi-patch model generators. +//! +//============================================================================== + +#ifndef _SIM_MULTI_PATCH_MODEL_GEN_H_ +#define _SIM_MULTI_PATCH_MODEL_GEN_H_ + +#include "SIMbase.h" + + +/*! + \brief Inherit this class to equip your SIM with multi-patch model generators. +*/ + +template +class SIMMultiPatchModelGen : public Dim +{ +public: + //! \brief Constructor for standard problems. + //! \param[in] n1 Number of fields + SIMMultiPatchModelGen(int n1) : Dim(n1) {} + + //! \brief Constructor for mixed problems. + //! \param[in] unf Number of fields on bases + SIMMultiPatchModelGen(const SIMbase::CharVec& unf) : Dim(unf) {} + + //! \brief Empty destructor. + virtual ~SIMMultiPatchModelGen() {} + +protected: + //! \brief Instantiate a generator for the finite element model. + //! \param[in] geo XML element containing geometry defintion + ModelGenerator* createModelGenerator(const TiXmlElement* geo) const override; +}; + +#endif