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