v0.15.0
Loading...
Searching...
No Matches
fix_file.cpp
Go to the documentation of this file.
1/** \file fix_file.cpp
2 \brief Load and save file
3*/
4
5#include <MoFEM.hpp>
6using namespace MoFEM;
7
8static char help[] = "...\n\n";
9
10int main(int argc, char *argv[]) {
11
12 MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
13
14 try {
15 char mesh_file_name[255] = "in.h5m";
16 char out_file_name[255] = "out.h5m";
17 PetscBool out_flg_file = PETSC_FALSE;
18 PetscOptionsBegin(PETSC_COMM_WORLD, "", "Fix file options", "none");
19 CHKERR PetscOptionsString("-file_name", "mesh file name", "", "mesh.h5m",
20 mesh_file_name, 255, &out_flg_file);
21 CHKERR PetscOptionsString("-out_file_name", "mesh file name", "",
22 "mesh.h5m", out_file_name, 255, &out_flg_file);
23 PetscOptionsEnd();
24
25 moab::Core mb_instance;
26 moab::Interface &moab = mb_instance;
27 const char *option;
28 option = "";
29
30 MOFEM_LOG("WORLD", Sev::inform)
31 << "In " << mesh_file_name << " out " << out_file_name;
32
33 CHKERR moab.load_file(mesh_file_name, 0, option);
34 bool changes = false;
35 CHKERR BitRefManager::fixTagSize(moab, &changes);
36 if (changes)
37 CHKERR moab.write_file(out_file_name);
38 }
39
41
43}
int main()
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
static char help[]
Definition fix_file.cpp:8
#define MOFEM_LOG(channel, severity)
Log.
char out_file_name[255]
char mesh_file_name[255]
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
static MoFEMErrorCode fixTagSize(moab::Interface &moab, bool *changed=nullptr)
Fix tag size when BITREFLEVEL_SIZE of core library is different than file BITREFLEVEL_SIZE.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:72
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:118