/* * Copyright(C) 1999-2020, 2022, 2023 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * * See packages/seacas/LICENSE for details */ #pragma once #include // for string #include // for vector namespace Excn { class Block; class CommunicationMetaData; class Mesh; template class NodeSet; template class SideSet; template class EdgeBlock; template class FaceBlock; } // namespace Excn /*! * This set of classes provides a thin wrapper around the exodusII * internals. It supplants several of the exodusII API calls in * order to avoid ncredef calls which totally rewrite the existing * database and can be very expensive. These routines provide all * required variable, dimension, and attribute definitions to the * underlying netcdf file with only a single ncredef call. * * To use the application must create an Excn::Internals instance * and call the Excn::Internals::write_meta_data() function. This * function requires several classes as arguments including: *
    *
  • Mesh -- defines mesh global metadata *
  • Block -- defines metadata for each block *
  • NodeSet -- defines metadata for each nodeset *
  • SideSet -- defines metadata for each sideset *
  • CommunicationMetaData -- global metadata relating to * parallel info. *
* * Calling Excn::Internals::write_meta_data(), replaces the * following exodusII and nemesis API calls: *
    *
  • ex_put_init(), *
  • ex_put_elem_block(), *
  • ex_put_node_set_param(), *
  • ex_put_side_set_param(), *
  • ne_put_init_info(), *
  • ne_put_loadbal_param(), *
  • ne_put_cmap_params(), *
*/ namespace Excn { class Redefine { public: explicit Redefine(int exoid); ~Redefine(); private: int exodusFilePtr; }; bool is_path_absolute(const std::string &path); template class Internals { public: Internals(int exoid, int maximum_name_length, int change_set_number) : exodusFilePtr(exoid), maximumNameLength(maximum_name_length), changeSetNumber(change_set_number) { } int write_meta_data(const Mesh &mesh, const std::vector &blocks, const std::vector> &nodesets, const std::vector> &sidesets, const std::vector> &edgeblocks, const std::vector> &faceblocks, const CommunicationMetaData &comm); bool check_meta_data(const Mesh &mesh, const std::vector &blocks, const std::vector> &nodesets, const std::vector> &sidesets, const std::vector> &edgeblocks, const std::vector> &faceblocks, const CommunicationMetaData &comm); private: int put_metadata(const Mesh &mesh, const CommunicationMetaData &comm); int put_metadata(const std::vector &blocks); int put_metadata(const std::vector> &nodesets); int put_metadata(const std::vector> &sidesets); int put_metadata(const std::vector> &edgeblocks); int put_metadata(const std::vector> &faceblocks); int put_non_define_data(const Mesh &mesh, const CommunicationMetaData &comm); int put_non_define_data(const std::vector &blocks); int put_non_define_data(const std::vector> &nodesets); int put_non_define_data(const std::vector> &sidesets); int put_non_define_data(const std::vector> &edgeblocks); int put_non_define_data(const std::vector> &faceblocks); int exodusFilePtr{}; int nodeMapVarID[3]{}; int elementMapVarID[2]{}; int commIndexVar{}; int elemCommIndexVar{}; int maximumNameLength{}; int changeSetNumber{0}; }; } // namespace Excn