v0.13.0
UnknownInterface.cpp
Go to the documentation of this file.
1 /** \file UnknownInterface.cpp
2  * \brief Unknown interfce implementation
3  *
4  * MoFEM is free software: you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or (at your
7  * option) any later version.
8  *
9  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12  * License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
16  */
17 
18 namespace MoFEM {
19 
22  version =
23  Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD);
25 }
26 
28  Version &version) {
30  const EntityHandle root_meshset = 0;
31  const int def_version[] = {-1, -1, -1};
32  Tag th;
33  rval = moab.tag_get_handle("MOFEM_VERSION", 3, MB_TYPE_INTEGER, th,
34  MB_TAG_CREAT | MB_TAG_MESH, &def_version);
35  int *version_ptr;
36  if (rval == MB_ALREADY_ALLOCATED) {
37  const void *tag_data[1];
38  CHKERR moab.tag_get_by_ptr(th, &root_meshset, 1, tag_data);
39  version_ptr = (int *)tag_data[0];
40  } else {
41  const void *tag_data[1];
42  CHKERR moab.tag_get_by_ptr(th, &root_meshset, 1, tag_data);
43  version_ptr = (int *)tag_data[0];
44  version_ptr[0] = MoFEM_VERSION_MAJOR;
45  version_ptr[1] = MoFEM_VERSION_MINOR;
46  version_ptr[2] = MoFEM_VERSION_BUILD;
47  }
48  version = Version(version_ptr);
50 }
51 
53  Version version) {
55  const EntityHandle root_meshset = 0;
56  const int def_version[] = {-1, -1, -1};
57  Tag th;
58  rval = moab.tag_get_handle("MOFEM_VERSION", 3, MB_TYPE_INTEGER, th,
59  MB_TAG_CREAT | MB_TAG_MESH, &def_version);
60  int *version_ptr;
61  const void *tag_data[1];
62  CHKERR moab.tag_get_by_ptr(th, &root_meshset, 1, tag_data);
63  version_ptr = (int *)tag_data[0];
64  version_ptr[0] = version.majorVersion;
65  version_ptr[1] = version.minorVersion;
66  version_ptr[2] = version.buildVersion;
68 }
69 
72  version =
73  Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD);
75 }
76 
77 } // namespace MoFEM
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85
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
static MoFEMErrorCode getLibVersion(Version &version)
Get library version.
static MoFEMErrorCode setFileVersion(moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
Get database major version.
static MoFEMErrorCode getInterfaceVersion(Version &version)
Get database major version.
static MoFEMErrorCode getFileVersion(moab::Interface &moab, Version &version)
Get database major version.