v0.13.0
CoreTemplates.hpp
Go to the documentation of this file.
1 /** \file CoreTemplates.hpp
2  * \brief Core interface class for user interface
3  *
4  * Low level data structures not used directly by user
5  *
6  * FIXME It is a mess with names of core cpp files need better organization
7  *
8  */
9 
10 /*
11  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
18  */
19 
20 #include <LogManager.hpp>
21 #include <BitRefManager.hpp>
22 #include <MeshsetsManager.hpp>
23 #include <SeriesRecorder.hpp>
24 
25 namespace MoFEM {
26 
28 
29 template <int N>
31  int verb) {
32  return this->setMoabInterface(new_moab, verb);
33 };
34 
35 template <int N>
36 boost::shared_ptr<RefEntityTmp<0>>
38  return Core::makeSharedRefEntity(*this, ent);
39 }
40 
41 template <int V>
42 CoreTmp<0>::CoreTmp(moab::Interface &moab, MPI_Comm comm, const int verbose,
44  : moab(moab), mofemComm(comm), verbose(verbose),
45  initaliseAndBuildField(PETSC_FALSE),
46  initaliseAndBuildFiniteElements(PETSC_FALSE) {
47 
48  ierr = coreGenericConstructor(moab, comm, verbose);
49  CHKERRABORT(comm, ierr);
50 
51  MOFEM_LOG_CHANNEL("WORLD");
52  if (verbose > QUIET) {
53  MOFEM_LOG_C("WORLD", Sev::verbose, "Core number < %d >", V);
54  }
55 }
56 
57 template <int N>
58 CoreTmp<N>::CoreTmp(moab::Interface &moab, ///< MoAB interface
59  MPI_Comm comm, ///< MPI communicator
60  const int verbose ///< Verbosity level
61  )
62  : CoreTmp<N - 1>(moab, comm, verbose, CoreValue<N>()) {
63 
64  // Register sub-interfaces
65  ierr = this->registerSubInterfaces();
66  CHKERRABORT(comm, ierr);
67  ierr = this->clearMap();
68  CHKERRABORT(comm, ierr);
69  ierr = this->getTags();
70  CHKERRABORT(comm, ierr);
71  ierr = this->getOptions(verbose);
72  CHKERRABORT(comm, ierr);
73 
74  this->basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
75  this->setRefEntBasicDataPtr(*this, this->basicEntityDataPtr);
76 
77  ierr = this->initialiseDatabaseFromMesh(verbose);
78  CHKERRABORT(comm, ierr);
79 
80  MOFEM_LOG_CHANNEL("WORLD");
81 }
82 
83 } // namespace MoFEM
Interface managing BitRefLevels.
Log and register warnings.
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:314
MeshsetsManager interface.
MoFEM interface.
@ QUIET
Definition: definitions.h:221
SeverityLevel
Severity levels.
Definition: LogManager.hpp:43
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:287
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
const int N
Definition: speed_test.cpp:3
static boost::shared_ptr< RefEntityTmp< 0 > > makeSharedRefEntity(MoFEM::Interface &m_field, const EntityHandle ent)
Definition: Core.cpp:907
MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb)
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
virtual boost::shared_ptr< RefEntityTmp< 0 > > make_shared_ref_entity(const EntityHandle ent)