added: convenience wrapper class for multi-patch generator usage in applications

note: does not instance for 1D
This commit is contained in:
Arne Morten Kvarving 2016-09-12 11:14:21 +02:00
parent 1791d22e91
commit 1adfcf1804
2 changed files with 79 additions and 0 deletions

View File

@ -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<SIM2D>::createModelGenerator(const TiXmlElement* geo) const
{
IFEM::cout <<" Using multi-patch model generator" << std::endl;
return new MultiPatchModelGenerator2D(geo);
}
template<>
ModelGenerator* SIMMultiPatchModelGen<SIM3D>::createModelGenerator(const TiXmlElement* geo) const
{
IFEM::cout <<" Using multi-patch model generator" << std::endl;
return new MultiPatchModelGenerator3D(geo);
}

View File

@ -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 Dim>
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