| 1 |
// Copyright(C) 1999-2020, 2022, 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 |
#pragma once |
| 7 |
|
| 8 |
#include "exo_entity.h" |
| 9 |
#include "util.h" |
| 10 |
|
| 11 |
template <typename INT> class Exo_Read; |
| 12 |
|
| 13 |
template <typename INT> class Node_Set : public Exo_Entity |
| 14 |
{ |
| 15 |
public: |
| 16 |
Node_Set(); |
| 17 |
Node_Set(int file_id, size_t id); |
| 18 |
Node_Set(int file_id, size_t id, size_t nnodes, size_t ndfs = 0); |
| 19 |
Node_Set(const Node_Set &) = delete; |
| 20 |
const Node_Set &operator=(const Node_Set &) = delete; |
| 21 |
|
| 22 |
~Node_Set() override; |
| 23 |
|
| 24 |
void apply_map(const std::vector<INT> &node_map); |
| 25 |
const INT *Nodes() const; |
| 26 |
size_t Node_Id(size_t position) const; |
| 27 |
size_t Node_Index(size_t position) const; |
| 28 |
|
| 29 |
const double *Distribution_Factors() const; |
| 30 |
void Free_Distribution_Factors() const; |
| 31 |
|
| 32 |
private: |
| 33 |
int Check_State() const override; |
| 34 |
void entity_load_params() override; |
| 35 |
|
| 36 |
EXOTYPE exodus_type() const override; |
| 37 |
const char *label() const override { return "Nodeset"; } |
| 38 |
const char *short_label() const override { return "nodeset"; } |
| 39 |
|
| 40 |
void load_nodes(const std::vector<INT> &node_map) const; |
| 41 |
|
| 42 |
size_t num_dist_factors{0}; |
| 43 |
|
| 44 |
mutable INT *nodes{nullptr}; // Array. |
| 45 |
mutable INT *nodeIndex{nullptr}; // An index array which orders the nodelist in sorted order. |
| 46 |
mutable double *dist_factors{nullptr}; // Array. |
| 47 |
|
| 48 |
friend class Exo_Read<INT>; |
| 49 |
}; |