| 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 "Ioss_CodeTypes.h" // for IntVector |
| 8 |
#include "Ioss_DatabaseIO.h" |
| 9 |
#include "Ioss_EdgeBlock.h" |
| 10 |
#include "Ioss_ElementTopology.h" |
| 11 |
#include "Ioss_Property.h" |
| 12 |
#include <cstddef> |
| 13 |
#include <string> |
| 14 |
|
| 15 |
#include "Ioss_EntityBlock.h" |
| 16 |
#include "Ioss_PropertyManager.h" |
| 17 |
|
| 18 |
namespace Ioss { |
| 19 |
class Field; |
| 20 |
} // namespace Ioss |
| 21 |
|
| 22 |
/** \brief Create an edge block. |
| 23 |
* |
| 24 |
* \param[in] io_database The database associated with the region containing the edge block. |
| 25 |
* \param[in] my_name The edge block's name. |
| 26 |
* \param[in] edge_type The name of the edge topology type for the edge block. |
| 27 |
* \param[in] number_edges The number of edges in the edge block. |
| 28 |
*/ |
| 29 |
Ioss::EdgeBlock::EdgeBlock(Ioss::DatabaseIO *io_database, const std::string &my_name, |
| 30 |
const std::string &edge_type, int64_t number_edges) |
| 31 |
: Ioss::EntityBlock(io_database, my_name, edge_type, number_edges) |
| 32 |
{ |
| 33 |
if (topology()->master_element_name() != edge_type && topology()->name() != edge_type) { |
| 34 |
// Maintain original edge type on output database if possible. |
| 35 |
properties.add(Ioss::Property("original_edge_type", edge_type)); |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
Ioss::Property Ioss::EdgeBlock::get_implicit_property(const std::string &my_name) const |
| 40 |
{ |
| 41 |
return Ioss::EntityBlock::get_implicit_property(my_name); |
| 42 |
} |
| 43 |
|
| 44 |
int64_t Ioss::EdgeBlock::internal_get_field_data(const Ioss::Field &field, void *data, |
| 45 |
size_t data_size) const |
| 46 |
{ |
| 47 |
return get_database()->get_field(this, field, data, data_size); |
| 48 |
} |
| 49 |
|
| 50 |
int64_t Ioss::EdgeBlock::internal_put_field_data(const Ioss::Field &field, void *data, |
| 51 |
size_t data_size) const |
| 52 |
{ |
| 53 |
return get_database()->put_field(this, field, data, data_size); |
| 54 |
} |
| 55 |
|
| 56 |
int64_t Ioss::EdgeBlock::internal_get_zc_field_data(const Field &field, void **data, |
| 57 |
size_t *data_size) const |
| 58 |
{ |
| 59 |
return get_database()->get_zc_field(this, field, data, data_size); |
| 60 |
} |