Skip to content

Commit

Permalink
Discontinuous galerkin (sandialabs#403)
Browse files Browse the repository at this point in the history
* EXODUS: refactor field metadata attribute output

* EXODUS: Beginnings of basis read

* EXODUS: basis query

* EXODUS: these got lost with some branch mishaps

* EXODUS: Spelling fix

* EXODUS: See if can fix intel errors

* EXODUS: Fix intel build

* EXODUS: Move internal function to correct header

* Windows fixes: make functions non-inline

Making certain functions in Ioss::Utils non-inline to avoid export
errors on Windows. Accessing the non-exported static variables was
causing errors. This avoids that. Also added API to access current
values for various streams.

* eliminate warnings

* IOSS: cgns - do not create assemblies from Unspecified VC

* Getting kokkos build working again [ci skip]

* TEST: Enable kokkos build

* IOSS: Change byte-size output to debug

* shellcheck recommendations

* TESTING: Remove adios2 until figure out issues

* EPU: Minor improvement in message (plural vs singular)

* IOSS: Rename qsort to sort

* IO_MODIFY: Better help output

* IO_MODIFY: clean-up comment [ci skip]

* Revert "EPU: Minor improvement in message (plural vs singular)"

This reverts commit 6ca490c.

* IOSS: Switch to using doctest from Catch2

* IOSS: cgns - remove lambdas to see if fixes stria issue

* IOSS: Remove shadowed variable

* Revert "Remove shadowed variable."

This reverts commit 4d54381a3264dea155de65d0588cb192b37c0e1f.

* Revert "IOSS: cgns - remove lambdas to see if fixes stria issue"

This reverts commit 8dde87a74344b8b57f0f948e58f73e82c950e074.

* IOSS: cgns - get CG_BUILD_PARALLEL define for all versions

* Update readme -- replace Catch2 with doctest [ci skip]

* @wortiz has signed the CLA from Pull Request sandialabs#303

* @mwestphal has signed the CLA from Pull Request sandialabs#304

* BLOT: Fix new argument mismatch warning with gcc-12

* Fix a recursive warning on assignement copy operator

* IOSS: DEBUG->DbgOut, WARNING->WarnOut to avoid windows issues

* IOSS: new version of clang-format

* New version of clang-format

* New version of clang-format

* TPL: Add INSTALL_PATH to metis/parmetis installs

* MODULE: Remove old unused unsupported lines [ci skip]

* @gjtempl has signed the CLA from Pull Request sandialabs#305

* Updates for serial build

Add SEACAS_HAVE_MPI include guards for ioss unit_tests that use MPI.
These are still run for serial builds and this change allows them to
compile and run.

Add -DMATIO_SHARED:BOOL=${SHARED} to TPS/matio/runcmake.sh. Matio's
CMake isn't respecting the CMAKE variable BUILD_SHARED_LIBS and still
builds shared version when SHARED=NO.

* IOSS: Handle uppercase field suffices

* IOSS: Clean up uppercase suffix fix

* ZELLIJ: Add offset option

* KOKKOS: Use current version

* TPL: Fix kokkos runcmake.sh for current version

* EXODUS: Clean up

* Copy top-level README to packages/seacas so available in Trilinos snapshot

* CONFIG: Update name of kokkos library

* EXODUS.PY: Add the get_block_id_map method

This adds functionality to add being able to easily find the
elements contained within EX_ELEM_BLOCK or other type without
keeping track of global and internal indicies.

* ZELLIJ: Better cache utilization for offset and scale

* IOSS: Handle specified field ordering (via index) if present

* IOSS: use reserve instead of resize since pushing back

* IO_MODIFY: Add rename capability

* IO_MODIFY: Clean up rename capability

* CONFIG: Add gnubrew compiler option

* CONFIG: Update hdf5 versions

* IO_MODIFY: update help options

* EXODUS: Fix problem with ex_get_block_id_map function

* SUPES: Make a variable be a correct spelling

* EXODUS: clang-analyzer fixes

* Bring up-to-date with master

* Clean up bad merge

* EXODUS: Clean up bad merge

* EXODUS: Clean up anothr bad merge

* EPU: Bring in fix from master

* EXODUS: Clean up python and varid lookup

* EXODUS: Support cardinality and user-define suffices; refactor

* EXODUS: Further refinement/refactoring of DG field interface

* EXODUS: Refactor component separator to allow for empty value

* EXODUS: Minor cleanup

* EXODUS: Refactor function naems; add test of ex_field utils

* EXODUS: Add missing file from last commit

* EXODUS: Fix bad handling of user-defined suffices

* EXODUS: Fix suffix handling in name building

* CI: Fix cmake version requirement

* EXODUS: More work on the basis metadata read

* EXODUS: Fix null test -- use double pipe

* EXODUS: refactor field metadata attribute output

* EXODUS: Beginnings of basis read

* EXODUS: basis query

* EXODUS: these got lost with some branch mishaps

* EXODUS: Spelling fix

* EXODUS: See if can fix intel errors

* EXODUS: Fix intel build

* EXODUS: Move internal function to correct header

* TEST: Enable kokkos build

* EPU: Minor improvement in message (plural vs singular)

* Revert "EPU: Minor improvement in message (plural vs singular)"

This reverts commit 6ca490c.

* IOSS: Remove shadowed variable

* Revert "Remove shadowed variable."

This reverts commit 4d54381a3264dea155de65d0588cb192b37c0e1f.

* CONFIG: Add gnubrew compiler option

* Bring up-to-date with master

* EXODUS: Support cardinality and user-define suffices; refactor

* EXODUS: Further refinement/refactoring of DG field interface

* EXODUS: Refactor component separator to allow for empty value

* EXODUS: Minor cleanup

* EXODUS: Refactor function naems; add test of ex_field utils

* EXODUS: Add missing file from last commit

* EXODUS: Fix bad handling of user-defined suffices

* EXODUS: Fix suffix handling in name building

* CI: Fix cmake version requirement

* EXODUS: More work on the basis metadata read

* EXODUS: Fix null test -- use double pipe

* EXODUS: Test field metadata read/write on nodes

* CI: Fix cxx standard setting

* EXODUS: Fix bad merge

* EXODUS: Fix bad merge

* EXODUS: Fix varid query for assembly and blob

* EXODUS.PY: See if this fixes ci build issues

* EXODUS: Fix ex__get_varid function

* Revert "EXODUS.PY: See if this fixes ci build issues"

This reverts commit 86f202d.

* EXODUS: Clean up ex_attribute struct

* EXODUS: realpath is gnu extension in c11/c99

* EXODUS: Provide realpath prototype

* EXODUS: Add missing functions for mingw

* EXODUS: Fix ex_attribute initiialization

* CI: Disable nczarr in netcdf

* EXODUS: Fix codacy null / 0 issue

* EXODUS: Removed unused struct member

* IOSS: Clean up some includes; remove the ... for ???

* EXODUS: Fix bad master merge

* EXODUS: Fix intel compiler build

* BLOT: Increase resolution of node/element id output

* IOSS: Change meta_data to metadata

* EXODUS: Use internal naming for static function

* Remove ioss as required library

* EXODUS: Add function name to output so know where it came from

* IOSS: Add function mapping Ioss field names to exodus ex_field_type

* IOSS: Output field metadata basic implemetation

* IOSS: Rename function for consistency

* IOSS: Add missing serialize io call

* APREPRO: Make strings test more robust

* IOSS: Build io_modify only if exodus enabled

* IOSS: Detect if exodus enabled for exodus include

* GREPOS: Intel overoptimizes unless inimap separate file

* GREPOS: Fix bad merge

* CONFIG: Silence CMake warning about python interpreter finding

* IOSS: Fix use of c++14/17 type-traits

* EXODUS: Filter out attributes Field@

* IOSS: Add mapping from exodus type to ioss field type

* IOSS: Handle composite fields with different component separators

* IOSS: Field - Add print method; support 2 separators for composite fields

* IOSS: get_fields works after enhanced field found some fields

* IOSS: Read/interpret exodus files with field metadata

* IOSS: Eliminate some char **names uses -- convert to NameList

* IOSS: Use more NameList and IntVector

* CI: Remove cmake policy; not recognized in docker build

* IOSS: CGNS - earlier versions have the CG_BUILD_HDF5 define in cgnsconfig.h

* CI: Update to latest version [ci skip]

* IOSS: Minor change to trigger workflows

* IOSS: Propogate name_array changes to parallel

* IOSS: Add serialize io calls wehre needed

* IOSS: Use correct export macro

* IOSS: Scalar fields do not need metadata; clutters file also

* Io modify handle cgns (sandialabs#453)

* IOSS: io_modify - try to get cgns structured mesh coordinate mods working

* IOSS: io_modify - fix coordinate modification routines

* IOSS: io_modify - try to handle block geometry modify in cgns

* IOSS: io_info -- bbox works for structured mesh

* IOSS: io_modify - redo geometry transformation code

---------

Co-authored-by: Greg Sjaardema <gdsjaar@sandia.gov>

* EXODUS: Fix element count in test writer

* IOSS: Handle user-defined field metadata output

* IOSS: Handle composite field multiple separators

* CI: See if can fix appveyor build [ci skip]

* IOSS: Put debug output in ifdef

* CI: Actually trigger build...

* CI: See if this affects appveyor...

* CI: Change install name/location

* EXODUS: Fix formatting of comment; turn off clang-format

* IOSS: Initial steps in adding Basis capability

* IOSS: Initial steps in adding Basis capability to field metadata query

* CI: mkdir lib before plugin path in case doesnot exist [ci skip]

* APREPRO: Fix some issues found in sierra input files

* Testing an undefined variable against a string in a boolean (EQ, NE, LT, ...) was always returning true.

  . Changed such that an undefined variable in a boolean test with a
    string expression treats the undefined variable as the empty
    string.
       `{if (undefined_var == "Greg")}'
    Will parse as
       `{if ("" == "Greg")}'
    and output an undefined_variable warning.

* The `exp()` function will output an ERANGE error for both underflow
  and overflow.  We are ok with underflow not giving an error.
  Changed so only get math error in case of overflow.

* EXPLORE: Add/Refactor qa,  qainfo and info list commands

* CI: Better error handling in script

* EPU: Delete input files if requested

* APREPRO: Fix to_string when fmt:: full precision output being used

* APREPRO: Refactor last change

* IOSS: heartbeat - add HEARTBEAT_FLUSH_INTERVAL property, document 0 will flush every step

* EXODUS: Fix output of Curl gradient field

* IOSS: Get field-metadata basis somewhat working

* APREPRO: Bring branch up-to-date and fix bad merge

* IOSS: Refactor function names for ComposedVariable

* EXODUS: Move basis to global attribute

* IOSS: Add quadrature storage type; beginnings of allowing multiple basis types

* EXODUS: Redo so basis, quad stored at global level

* IOSS: Modify tokenize to optionally return empty tokens

* IOSS: Start of refactor for allowing multiple basis; basis at root of exodus

* EXODUS: Allow more than one basis; field can specify which basis it is using

* IOSS: Refactor basis struct/type

* Iniitial support for quadrature storage type

* EXODUS: Treat Quad@ attribute as internal

* EXODUS: Add quadrature type and multiple basis/quad types to test read/write

* IOSS: cleanup quadrature implementation

* IOSS: Better const correctness

* IOSS: VariableType -- function to return quad/basis types

* IOSS: Support quadrature type in ioss<->exodus type mapping

* IOSS: exodus - output basis/quadrature types

* IOSS: Better suffix upper/lower detection

* EXODUS: Support nesting of user-defiend fields

* IOSS: Better compare output for fields

* IOSS: Remove debug print

* IOSS: Allow nesting on user-defined fields; refactor basis/quad output

* EXODUS: Remove unused variable

* EXODUS: Output from test program to stdout, not stderr

* EXODUS: Add test for enhanced field metadata

* EXODUS: Fix pipestatus values

* EXODUS: Fix windows build

* EXODUS: Remove shadowed variable

* EXODUS: Fix enhanced fields for random attribute ordering

* EXODUS: Test - more robust when nc4 changes attribute ordering

* EXODUS: get_X_metadata functions have count argument added so call-to-call order works

* EXODUS: Check for a null pointer

* EXODUS: Provide internal strsep and strlcat

* EXODUS: Improve portability

* EXODUS: A better way to get strdup

* EXODUS: Fix some compiler warnings; see if that makes test run...

* EXODUS: Fix memory leak in test code

* EXODUS: Deallocat struct in correct place

* EXODUS: Reorder unit test and update output

* IOSS: Add type and type_string to variable types

* IOSS: Refactor detailed field output

* IOSS: Allow detailed field output

* IOSS: Minor cleanup/refactor

* NEM_SLICE: Minor fix

* IOSS: Clean up fmt includes/use

* IOSS: Rewrite how catylyst deals with field names

* IOSS: Fix up some changes for catalyst for this branch

* IOSS: Fix default separator setting; do not recognize fields if property set

* EXODUS: Refactor get/put basis and quad metadata

* IOSS: Minor tweak to field printing

* IOSS: Refactor variable type determination

* EXODUS: Update nesting define; fix test dump file

* IOSS: Simplify datapool - remove seldom used capabilty

* IOSS: Refactor some names; add print

* EXODUS: Eliminate memory leak

* EXODUS: Fix spelling error

* EXODUS: Fix compiler warning

* EXODUS: Clean up some function name/doc

* Spelling fixes [ci skip]

* IOSS: Add backward compatible interfaces back

---------

Co-authored-by: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Co-authored-by: Greg Sjaardema <gdsjaar@sandia.gov>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mathieu Westphal <mathieu.westphal@kitware.com>
Co-authored-by: Gary Templet <gjtempl@sandia.gov>
Co-authored-by: Mario LoPrinzi <mvlopri@sandia.gov>
  • Loading branch information
7 people authored and tokusanya committed Jul 16, 2024
1 parent 796db44 commit e260195
Show file tree
Hide file tree
Showing 125 changed files with 4,475 additions and 1,088 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SET(Seacas_ENABLE_Zoltan_DEFAULT ON)
SET(TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE TRUE)

# Define the TriBITS minimum required CMake version
SET(TRIBITS_CMAKE_MINIMUM_REQUIRED 3.17.0)
SET(TRIBITS_CMAKE_MINIMUM_REQUIRED 3.22.0)

# CMake requires this be in the top file and not in an include file :-(
CMAKE_MINIMUM_REQUIRED(VERSION ${TRIBITS_CMAKE_MINIMUM_REQUIRED} FATAL_ERROR)
Expand Down
1 change: 1 addition & 0 deletions TPL/netcdf/runcmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ cmake .. -DCMAKE_C_COMPILER:FILEPATH=${CC} \
-DENABLE_MMAP:BOOL=ON \
-DENABLE_DAP:BOOL=OFF \
-DENABLE_BYTERANGE:BOOL=OFF \
-DENABLE_NCZARR:BOOL=OFF \
-DENABLE_V2_API:BOOL=OFF \
-DENABLE_FILTER_TESTING:BOOL=OFF \
-DENABLE_TESTS:BOOL=OFF \
Expand Down
1 change: 1 addition & 0 deletions packages/seacas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE(
set(${PROJECT_NAME}_C_Standard_DEFAULT c99)

SET(${PROJECT_NAME}_CMAKE_CXX_STANDARD_DEFAULT 17)
SET(CMAKE_CXX_STANDARD 17)
SET(${PROJECT_NAME}_CMAKE_CXX_STANDARDS_ALLOWED "(14|17|20)")
ADVANCED_SET(CMAKE_CXX_STANDARD ${${PROJECT_NAME}_CMAKE_CXX_STANDARD_DEFAULT}
CACHE STRING
Expand Down
1 change: 0 additions & 1 deletion packages/seacas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ Sandia National Laboratories,
We appreciate feedback from users of this package. Please send
comments, suggestions, and bug reports to Greg Sjaardema
<gdsjaar@sandia.gov>, <gsjaardema@gmail.com>

6 changes: 3 additions & 3 deletions packages/seacas/applications/blot/bl_version.f
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
Expand All @@ -11,8 +11,8 @@ SUBROUTINE VERSION(QAINFO)
CHARACTER*(MXQARC) QAINFO(6)

QAINFO(1) = 'blot '
QAINFO(2) = '2021/03/31 '
QAINFO(3) = ' 3.141 '
QAINFO(2) = '2024/03/25 '
QAINFO(3) = ' 3.1415 '
QAINFO(4) = ' '

RETURN
Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/applications/blot/matfac.f
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
Expand Down Expand Up @@ -101,6 +101,6 @@ INTEGER FUNCTION MATFAC (LINKF1, MAXNPF, NPFS, iel, numnp, IERR)

160 CONTINUE
RETURN
10000 FORMAT (' Poss. Contiguity Prob. at Hex ', I7,
* ', Nodes ', 4(I7,1X), 10(I7,1X))
10000 FORMAT (' Poss. Contiguity Prob. at Hex ', I11,
* ', Nodes ', 4(I11,1X), 10(I11,1X))
END
4 changes: 2 additions & 2 deletions packages/seacas/applications/blot/scaprt.f
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
Expand Down Expand Up @@ -94,7 +94,7 @@ SUBROUTINE SCAPRT (NAMECO, NAME, IVAR, TIMES,
& STIM(2)(:LTIM), NUMMAX, ISTMAX
10000 FORMAT (4X, A7, 1X, A, 3X, 2 (1X, A),
& 4X, A, 3X, A4, 3X, A4)
10010 FORMAT (4X, A7, 1X, A, 3X, 2 (1X, A), 4X, A, I7, I7)
10010 FORMAT (4X, A7, 1X, A, 3X, 2 (1X, A), 4X, A, I11, I11)
ELSE
WRITE (*, 10020) 'Range: ', SVAL(0)(:LVAL),
& SXYZ0(1)(:LX), SXYZ0(2)(:LY), SXYZ0(3)(:LZ),
Expand Down
1 change: 1 addition & 0 deletions packages/seacas/applications/grepos/gp_mapvar.f
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ subroutine mapvar(nold, nnew, nvar, map, vars, scr)

do 30 ivar = 1, nvar
do 10 i = 1, nnew
write (*,*) i, map(i)
scr(i) = vars(map(i) + nold * (ivar-1) )
10 continue

Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/applications/nem_slice/elb.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ template <typename INT> struct Graph_Description
std::vector<INT> adj{};
std::vector<INT> start{};
std::vector<std::vector<INT>> sur_elem;
Graph_Description<INT>() = default;
Graph_Description() = default;
};

/* Various constants */
Expand Down
22 changes: 20 additions & 2 deletions packages/seacas/applications/slice/SL_Decompose.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ extern double seacas_timer();
extern void progress(const std::string &output);

namespace {
char **get_name_array(size_t count, int size)
{
auto *names = new char *[count];
for (size_t i = 0; i < count; i++) {
names[i] = new char[size + 1];
std::memset(names[i], '\0', size + 1);
}
return names;
}

void delete_name_array(char **names, int count)
{
for (int i = 0; i < count; i++) {
delete[] names[i];
}
delete[] names;
}

template <typename INT>
void create_adjacency_list(const Ioss::Region &region, std::vector<idx_t> &pointer,
std::vector<idx_t> &adjacency, INT)
Expand Down Expand Up @@ -684,7 +702,7 @@ std::vector<int> decompose_elements(const Ioss::Region &region, SystemInterface
if (map_count > 0) {
int max_name_length = ex_inquire_int(exoid, EX_INQ_DB_MAX_USED_NAME_LENGTH);
max_name_length = max_name_length < 32 ? 32 : max_name_length;
char **names = Ioss::Utils::get_name_array(map_count, max_name_length);
char **names = get_name_array(map_count, max_name_length);
int error = ex_get_names(exoid, EX_ELEM_MAP, names);
if (error < 0) {
exodus_error(__LINE__);
Expand All @@ -701,7 +719,7 @@ std::vector<int> decompose_elements(const Ioss::Region &region, SystemInterface
break;
}
}
Ioss::Utils::delete_name_array(names, map_count);
delete_name_array(names, map_count);
}

if (!map_read) {
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
Exodus_for libraries/exodus_for PT OPTIONAL
ExoIIv2for32 libraries/exoIIv2for32 PT OPTIONAL
Nemesis libraries/nemesis PT OPTIONAL
Ioss libraries/ioss PT REQUIRED
Ioss libraries/ioss PT OPTIONAL
Chaco libraries/chaco PT OPTIONAL
Aprepro_lib libraries/aprepro_lib PT OPTIONAL
Supes libraries/supes PT OPTIONAL
Expand Down
1 change: 1 addition & 0 deletions packages/seacas/libraries/exodus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ TRIBITS_ADD_LIBRARY(
)

set_property(TARGET exodus PROPERTY C_STANDARD 99)
set_property(TARGET exodus PROPERTY C_EXTENSIONS ON)

if (SEACASExodus_ENABLE_SHARED)
if (NOT BUILD_SHARED_LIBS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ library, the IOSS library, nem_slice, and nem_spread.
| | 64 | X | X | | |

Only the base topology name is required for the element type. For example, all
elements of a `hex` toplogy can be referred to by the name `hex` no
elements of a `hex` topology can be referred to by the name `hex` no
matter how many nodes there are. However, it is also correct to
append the node count to the topology type for the element name. For
example, a 20-node hex could be named `hex20`.
Expand Down
129 changes: 123 additions & 6 deletions packages/seacas/libraries/exodus/include/exodusII.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#include <stdint.h>
#include <stdlib.h>

/** Maximum length of name permitted by NetCDF */
#define EX_MAX_NAME NC_MAX_NAME

#ifndef NC_INT64
#error "NetCDF version 4.1.2 or later is required."
#endif
Expand Down Expand Up @@ -282,6 +285,98 @@ enum ex_entity_type {
};
typedef enum ex_entity_type ex_entity_type;

enum ex_field_type {
EX_FIELD_TYPE_INVALID = 0,
EX_FIELD_TYPE_USER_DEFINED,
EX_FIELD_TYPE_SEQUENCE,
EX_BASIS,
EX_QUADRATURE,
EX_SCALAR,
EX_VECTOR_1D,
EX_VECTOR_2D,
EX_VECTOR_3D,
EX_QUATERNION_2D,
EX_QUATERNION_3D,
EX_FULL_TENSOR_36,
EX_FULL_TENSOR_32,
EX_FULL_TENSOR_22,
EX_FULL_TENSOR_16,
EX_FULL_TENSOR_12,
EX_SYM_TENSOR_33,
EX_SYM_TENSOR_31,
EX_SYM_TENSOR_21,
EX_SYM_TENSOR_13,
EX_SYM_TENSOR_11,
EX_SYM_TENSOR_10,
EX_ASYM_TENSOR_03,
EX_ASYM_TENSOR_02,
EX_ASYM_TENSOR_01,
EX_MATRIX_2X2,
EX_MATRIX_3X3
};
typedef enum ex_field_type ex_field_type;

#define EX_MAX_FIELD_NESTING 2
typedef struct ex_field
{
ex_entity_type entity_type;
int64_t entity_id;
char name[EX_MAX_NAME + 1]; /* Name of the field */
/*
* For basis, user, quadrature -- what is name of the subtype. This
* is a comma-separated list of `nesting` names Use two consecutive
* commas for an empty type_name. Leave empty if no type_names
*/
int nesting; /* Number of composite fields (vector at each quadrature point = 2) */
char type_name[EX_MAX_NAME + 1];
ex_field_type type[EX_MAX_FIELD_NESTING]; /* ex_field_type of each nested field */
int cardinality[EX_MAX_FIELD_NESTING]; /* 0 to calculate based on type */
char component_separator[EX_MAX_FIELD_NESTING]; /* empty defaults to '_'; */
char suffices[EX_MAX_NAME + 1]; /* Optional comma-separated list of suffices if type is
EX_FIELD_TYPE_USER_DEFINED */
} ex_field;

typedef struct ex_basis
{
/*
clang-format off
*
* subc_dim: dimension of the subcell associated with the specified DoF ordinal
* -- 0 node, 1 edge, 2 face, 3 volume [Range: 0..3]
* subc_ordinal: ordinal of the subcell relative to its parent cell
* -- 0..n for each ordinal with the same subc dim [Range: <= DoF ordinal]
* subc_dof_ordinal: ordinal of the DoF relative to the subcell
* subc_num_dof: cardinality of the DoF set associated with this subcell.
* xi, eta, mu (ξ, η, ζ): Parametric coordinate location of the DoF
* -- (Only first ndim values are valid)
*
clang-format on
*/

char name[EX_MAX_NAME + 1];
int cardinality; /* number of `basis` points == dimension of non-null subc_*, xi, eta, mu */
int *subc_dim;
int *subc_ordinal;
int *subc_dof_ordinal;
int *subc_num_dof;
double *xi;
double *eta;
double *zeta;
} ex_basis;

typedef struct ex_quadrature
{
char name[EX_MAX_NAME + 1];
int cardinality; /* Number of quadrature points */
int dimension; /* 1,2,3 -- spatial dimension of points */
double *xi; /* xi (x) coordinate of points; dimension = cardinality or NULL */
double *
eta; /* eta (y) coordinate of points; dimension = cardinality if dimension = 2 or 3 or NULL */
double
*zeta; /* zeta (z) coordinate of points; dimension = cardinality if dimension == 3. or NULL */
double *weight; /* weights for each point; dimension = cardinality or NULL */
} ex_quadrature;

/*!
* ex_opts() function codes - codes are OR'ed into exopts
*/
Expand All @@ -305,9 +400,6 @@ typedef enum ex_options ex_options;
* @{
*/

/** Maximum length of name permitted by NetCDF */
#define EX_MAX_NAME NC_MAX_NAME

/** Maximum length of QA record, element type name */
#define MAX_STR_LENGTH 32L
/** Default maximum length of an entity name, attribute name, variable name.
Expand Down Expand Up @@ -368,10 +460,10 @@ typedef enum ex_type ex_type;
typedef struct ex_attribute
{
ex_entity_type entity_type;
ex_entity_id entity_id;
char name[NC_MAX_NAME + 1];
int64_t entity_id;
char name[EX_MAX_NAME + 1];
ex_type type; /* int, double, text */
size_t value_count;
int value_count;
void *values; /* not accessed if NULL */
} ex_attribute;

Expand Down Expand Up @@ -953,6 +1045,20 @@ EXODUS_EXPORT int ex_get_blob(int exoid, struct ex_blob *blob);
EXODUS_EXPORT int ex_put_blobs(int exoid, size_t count, const struct ex_blob *blobs);
EXODUS_EXPORT int ex_get_blobs(int exoid, struct ex_blob *blobs);

EXODUS_EXPORT int ex_put_field_metadata(int exoid, const ex_field field);
EXODUS_EXPORT int ex_put_field_suffices(int exoid, const ex_field field, const char *suffices);
EXODUS_EXPORT int ex_get_field_metadata(int exoid, ex_field *field);
EXODUS_EXPORT int ex_get_field_metadata_count(int exoid, ex_entity_type obj_type, ex_entity_id id);
EXODUS_EXPORT int ex_get_field_suffices(int exoid, const ex_field field, char *suffices);

EXODUS_EXPORT int ex_get_basis_count(int exoid);
EXODUS_EXPORT int ex_get_basis(int exoid, ex_basis **pbasis, int *num_basis);
EXODUS_EXPORT int ex_put_basis(int exoid, const ex_basis basis);

EXODUS_EXPORT int ex_get_quadrature_count(int exoid);
EXODUS_EXPORT int ex_get_quadrature(int exoid, ex_quadrature **pquad, int *num_quad);
EXODUS_EXPORT int ex_put_quadrature(int exoid, const ex_quadrature quad);

/* Write arbitrary integer, double, or text attributes on an entity */
EXODUS_EXPORT int ex_put_attribute(int exoid, const ex_attribute attributes);
EXODUS_EXPORT int ex_put_attributes(int exoid, size_t attr_count, const ex_attribute *attributes);
Expand Down Expand Up @@ -1202,6 +1308,17 @@ EXODUS_EXPORT int ex_put_elem_cmap(int exoid, /**< NetCDF/Exodus
int processor /**< This processor ID */
);

EXODUS_EXPORT int ex_initialize_basis_struct(ex_basis *basis, size_t num_basis, int mode);
EXODUS_EXPORT int ex_initialize_quadrature_struct(ex_quadrature *quad, size_t num_quad, int mode);

EXODUS_EXPORT const char *ex_component_field_name(ex_field *field,
int component[EX_MAX_FIELD_NESTING]);
EXODUS_EXPORT const char *ex_field_component_suffix(ex_field *field, int nest_level, int component);
EXODUS_EXPORT int ex_field_cardinality(const ex_field_type field_type);
EXODUS_EXPORT const char *ex_field_type_name(const ex_field_type field_type);
EXODUS_EXPORT ex_field_type ex_string_to_field_type_enum(const char *field_name);
EXODUS_EXPORT const char *ex_field_type_enum_to_string(const ex_field_type field_type);

/*! @} */

/* Deprecated Code Handling Options:
Expand Down
5 changes: 4 additions & 1 deletion packages/seacas/libraries/exodus/include/exodusII_int.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright(C) 1999-2020, 2022, 2023 National Technology & Engineering Solutions
* Copyright(C) 1999-2020, 2022, 2023, 2024 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.
*
Expand Down Expand Up @@ -88,6 +88,9 @@ extern "C" {
#define EX_FILE_ID_MASK (0xffff0000) /**< Must match FILE_ID_MASK in NetCDF nc4internal.h */
#define EX_GRP_ID_MASK (0x0000ffff) /**< Must match GRP_ID_MASK in NetCDF nc4internal.h */

/* Utility function to find variable to store entity attribute on */
int exi_get_varid(int exoid, ex_entity_type obj_type, ex_entity_id id);

void exi_reset_error_status(void);

#if defined(EXODUS_THREADSAFE)
Expand Down
Loading

0 comments on commit e260195

Please sign in to comment.