7#ifndef __MOFEMUNKNOWNINTERFACE_HPP__
8#define __MOFEMUNKNOWNINTERFACE_HPP__
21 Version(
const int minor,
const int major,
const int build)
25 auto str = [](
auto v) {
return boost::lexical_cast<std::string>(
v); };
53 template <
class IFACE>
58 if (error_if_registration_failed && (!
p.second)) {
60 "Registration of interface typeid(IFACE).name() = %s failed",
61 typeid(IFACE).name());
92 template <
class IFACE>
97 if (!(iface =
static_cast<IFACE *
>(ptr)))
129 template <
class IFACE>
131 return getInterface<IFACE>(*iface);
157 template <
class IFACE,
158 typename boost::enable_if<boost::is_pointer<IFACE>,
int>::type = 0>
160 typedef typename boost::remove_pointer<IFACE>::type IFaceType;
161 IFaceType *iface = NULL;
162 ierr = getInterface<IFACE>(iface);
163 CHKERRABORT(PETSC_COMM_SELF,
ierr);
190 template <
class IFACE,
typename boost::enable_if<boost::is_reference<IFACE>,
193 typedef typename boost::remove_reference<IFACE>::type IFaceType;
194 IFaceType *iface = NULL;
195 ierr = getInterface<IFaceType>(iface);
196 CHKERRABORT(PETSC_COMM_SELF,
ierr);
225 ierr = getInterface<IFACE>(iface);
226 CHKERRABORT(PETSC_COMM_SELF,
ierr);
262 moab::Interface &moab,
263 Version version =
Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR,
264 MoFEM_VERSION_BUILD));
286 typedef multi_index_container<
290 hashed_unique<member<UIdTypeMap, boost::typeindex::type_index,
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
const double v
phase velocity of light in medium (cm/ns)
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
boost::typeindex::type_index classIdx
UIdTypeMap(const boost::typeindex::type_index &idx)
base class for all interface classes
multi_index_container< UIdTypeMap, indexed_by< hashed_unique< member< UIdTypeMap, boost::typeindex::type_index, &UIdTypeMap::classIdx > > > > iFaceTypeMap_multiIndex
Data structure for interfaces Id and class names.
iFaceTypeMap_multiIndex iFaceTypeMap
Maps implementation to interface type name.
IFACE * getInterface() const
Function returning pointer to interface.
virtual MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const =0
static MoFEMErrorCode getLibVersion(Version &version)
Get library version.
MoFEMErrorCode registerInterface(bool error_if_registration_failed=true)
Register interface.
MoFEMErrorCode getInterface(IFACE **const iface) const
Get interface pointer to pointer of interface.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
static MoFEMErrorCode setFileVersion(moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
Get database major version.
IFACE getInterface() const
Get interface pointer to pointer of interface.
static MoFEMErrorCode getInterfaceVersion(Version &version)
Get database major version.
static MoFEMErrorCode getFileVersion(moab::Interface &moab, Version &version)
Get database major version.
virtual ~UnknownInterface()=default
Version(const int minor, const int major, const int build)