| 1 |
// Copyright(C) 1999-2020, 2023, 2024 National Technology & Engineering Solutions |
| 2 |
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
// NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
// |
| 5 |
// See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
#include "Ionit_Initializer.h" |
| 8 |
|
| 9 |
#include "Ioss_CodeTypes.h" |
| 10 |
|
| 11 |
#if defined(SEACAS_HAVE_EXODUS) |
| 12 |
#include "exodus/Ioex_ChangeSet.h" |
| 13 |
#include "exodus/Ioex_IOFactory.h" |
| 14 |
#if defined(SEACAS_HAVE_EXONULL) |
| 15 |
#include "exonull/Ioexnl_IOFactory.h" |
| 16 |
#endif |
| 17 |
#endif |
| 18 |
|
| 19 |
#include "gen_struc/Iogs_DatabaseIO.h" |
| 20 |
#include "generated/Iogn_DatabaseIO.h" |
| 21 |
#include "heartbeat/Iohb_DatabaseIO.h" |
| 22 |
#include "text_mesh/Iotm_DatabaseIO.h" |
| 23 |
|
| 24 |
#ifdef HAVE_SEACASIOSS_ADIOS2 |
| 25 |
#include "adios/Ioad_Initializer.h" |
| 26 |
#endif |
| 27 |
|
| 28 |
#if defined(SEACAS_HAVE_CATALYST2) |
| 29 |
#include "catalyst/Iocatalyst_Initializer.h" |
| 30 |
#endif |
| 31 |
|
| 32 |
#if defined(SEACAS_HAVE_PAMGEN) |
| 33 |
#include "pamgen/Iopg_DatabaseIO.h" |
| 34 |
#endif |
| 35 |
|
| 36 |
#if defined(SEACAS_HAVE_FAODEL) |
| 37 |
#include "faodel/Iofaodel_DatabaseIO.h" |
| 38 |
#endif |
| 39 |
|
| 40 |
#if defined(SEACAS_HAVE_CGNS) |
| 41 |
#include "cgns/Iocgns_IOFactory.h" |
| 42 |
#endif |
| 43 |
|
| 44 |
#include "Ioss_ConcreteVariableType.h" |
| 45 |
#include "Ioss_Initializer.h" |
| 46 |
#include "null/Ionull_IOFactory.h" |
| 47 |
#include "transform/Iotr_Initializer.h" |
| 48 |
#include "visualization/cgns/Iovs_cgns_IOFactory.h" |
| 49 |
#include "visualization/exodus/Iovs_exodus_IOFactory.h" |
| 50 |
|
| 51 |
#include "Ioss_IOFactory.h" |
| 52 |
|
| 53 |
#include "Ioss_ChangeSetFactory.h" |
| 54 |
#include "Ioss_DynamicTopologyBroker.h" |
| 55 |
|
| 56 |
namespace { |
| 57 |
#if defined(IOSS_THREADSAFE) |
| 58 |
std::mutex m_; |
| 59 |
#endif |
| 60 |
} // namespace |
| 61 |
|
| 62 |
namespace Ioss::Init { |
| 63 |
Initializer &Initializer::initialize_ioss() |
| 64 |
{ |
| 65 |
static Initializer ionit; |
| 66 |
return ionit; |
| 67 |
} |
| 68 |
|
| 69 |
/** \brief Initialize the Ioss library. |
| 70 |
* |
| 71 |
* Calls appropriate internal functions and methods to |
| 72 |
* initialize the Ioss library. Initializes all database |
| 73 |
* types. |
| 74 |
*/ |
| 75 |
Initializer::Initializer() |
| 76 |
{ |
| 77 |
IOSS_FUNC_ENTER(m_); |
| 78 |
|
| 79 |
#if defined(SEACAS_HAVE_EXODUS) |
| 80 |
Ioex::IOFactory::factory(); // Exodus |
| 81 |
Ioex::ChangeSetFactory::factory(); |
| 82 |
#if defined(SEACAS_HAVE_EXONULL) |
| 83 |
Ioexnl::IOFactory::factory(); |
| 84 |
#endif |
| 85 |
#endif |
| 86 |
#if defined(SEACAS_HAVE_PAMGEN) |
| 87 |
Iopg::IOFactory::factory(); // Pamgen |
| 88 |
#endif |
| 89 |
#if defined(SEACAS_HAVE_FAODEL) |
| 90 |
Iofaodel::IOFactory::factory(); |
| 91 |
#endif |
| 92 |
#if defined(SEACAS_HAVE_CGNS) |
| 93 |
Iocgns::IOFactory::factory(); |
| 94 |
#endif |
| 95 |
|
| 96 |
#ifndef _MSC_VER |
| 97 |
Iovs_cgns::IOFactory::factory(); // Visualization Catalyst CGNS |
| 98 |
Iovs_exodus::IOFactory::factory(); // Visualization Catalyst Exodus |
| 99 |
#endif |
| 100 |
Iohb::IOFactory::factory(); // HeartBeat |
| 101 |
Iogn::IOFactory::factory(); // Generated |
| 102 |
Iotm::IOFactory::factory(); // TextMesh |
| 103 |
Iogs::IOFactory::factory(); // Structured Mesh Generator |
| 104 |
Ionull::IOFactory::factory(); |
| 105 |
Ioss::StorageInitializer(); |
| 106 |
Ioss::DynamicTopologyBroker::broker(); |
| 107 |
Ioss::ChangeSetFactory::factory(); |
| 108 |
Ioss::Initializer(); |
| 109 |
Iotr::Initializer(); |
| 110 |
#ifdef HAVE_SEACASIOSS_ADIOS2 |
| 111 |
Ioad::Initializer(); // ADIOS2 |
| 112 |
#endif |
| 113 |
#if defined(SEACAS_HAVE_CATALYST2) |
| 114 |
Iocatalyst::Initializer(); // Catalyst 2 |
| 115 |
#endif |
| 116 |
} |
| 117 |
|
| 118 |
Initializer::~Initializer() |
| 119 |
{ |
| 120 |
try { |
| 121 |
IOSS_FUNC_ENTER(m_); |
| 122 |
Ioss::IOFactory::clean(); |
| 123 |
// Put code here that should run after sierra is finished |
| 124 |
// executing... |
| 125 |
} |
| 126 |
catch (...) { |
| 127 |
} |
| 128 |
} |
| 129 |
} // namespace Ioss::Init |