IOSS 2.0
Loading...
Searching...
No Matches
Iofaodel_FieldSerialization.h
Go to the documentation of this file.
1// Copyright(C) 1999-2022, 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#pragma once
8
9#include "iofaodel_export.h"
10
11#include "Iofaodel_Utils.h"
12
13#include "Ioss_CommSet.h"
14#include "Ioss_DatabaseIO.h"
15#include "Ioss_DatabaseIO.h" // for DatabaseIO
16#include "Ioss_EdgeBlock.h"
17#include "Ioss_EdgeSet.h"
18#include "Ioss_ElementBlock.h"
19#include "Ioss_ElementSet.h"
20#include "Ioss_FaceBlock.h"
21#include "Ioss_FaceSet.h"
22#include "Ioss_Field.h" // for Region
23#include "Ioss_GroupingEntity.h"
24#include "Ioss_IOFactory.h"
25#include "Ioss_NodeBlock.h"
26#include "Ioss_NodeSet.h"
27#include "Ioss_Property.h" // for Region
28#include "Ioss_Region.h"
29#include "Ioss_Region.h" // for Region
30#include "Ioss_SideBlock.h"
31#include "Ioss_SideSet.h"
32#include "Ioss_State.h" // for State
34
35#include <string>
36#include <vector>
37
38namespace Iofaodel {
39
40 IOFAODEL_EXPORT size_t data_size(const Ioss::Field &f);
41
42 // Caller should write their own version of this
43 // FieldFunction should return a function or a lambda that matches the
44 // signature below. The function it returns may or may not capture variables
45 // that are given to the user-defined function.
46 // Some examples are given in this file and are also useful
47 //
49 std::function<void(const Ioss::Region &, const Ioss::GroupingEntity &, const Ioss::Field &)>;
50
51 // Applies FieldFunction 'op' to all fields encountered in the
52 // Ioss::Region and it's various Ioss::GroupingEntities
53 IOFAODEL_EXPORT void map_fields(const Ioss::Region &region, FieldFunction op);
54
55 // Applies FieldFunction 'op' to all fields encountered in the
56 // Ioss::GroupingEntity
57 IOFAODEL_EXPORT void map_fields(const Ioss::Region &region,
58 const Ioss::GroupingEntity &grouping_entity, FieldFunction op);
59
60 IOFAODEL_EXPORT lunasa::DataObject pack_field(const Ioss::Region &region,
61 const Ioss::GroupingEntity &entity,
62 const Ioss::Field &field);
63
64 IOFAODEL_EXPORT lunasa::DataObject pack_field(const Ioss::Region &r,
65 const Ioss::GroupingEntity &e, const Ioss::Field &f,
66 void *data, size_t data_size);
67
68 // Put this in the meta data section of the LDO
69 struct IOFAODEL_EXPORT field_entry_t
70 {
75 size_t raw_count;
76
77 // value_entry_t storage;
81 size_t data_size; // Total size of data stored in LDO data section
82
83 char data[0];
84
85 explicit field_entry_t(const Ioss::Field &field, const size_t start = 0);
86 };
87
88} // namespace Iofaodel
Holds metadata for bulk data associated with a GroupingEntity.
Definition Ioss_Field.h:25
BasicType
The basic data type held in the field.
Definition Ioss_Field.h:29
RoleType
Definition Ioss_Field.h:69
Base class for all 'grouping' entities. The following derived classes are typical:
Definition Ioss_GroupingEntity.h:67
A grouping entity that contains other grouping entities.
Definition Ioss_Region.h:93
A namespace for the pamgen database format.
Definition Iofaodel_DatabaseIO.C:46
size_t data_size(const Ioss::Field &f)
Definition Iofaodel_FieldSerialization.C:17
std::function< void(const Ioss::Region &, const Ioss::GroupingEntity &, const Ioss::Field &)> FieldFunction
Definition Iofaodel_FieldSerialization.h:48
void map_fields(const Ioss::Region &region, const Ioss::GroupingEntity &entity, FieldFunction op)
Definition Iofaodel_FieldSerialization.C:19
lunasa::DataObject pack_field(const Ioss::Region &region, const Ioss::GroupingEntity &entity, const Ioss::Field &field)
Definition Iofaodel_FieldSerialization.C:77
Definition Iofaodel_FieldSerialization.h:70
value_entry_t name
Definition Iofaodel_FieldSerialization.h:78
size_t data_size
Definition Iofaodel_FieldSerialization.h:81
bool is_implicit
Definition Iofaodel_FieldSerialization.h:73
bool is_valid
Definition Iofaodel_FieldSerialization.h:74
value_entry_t storage
Definition Iofaodel_FieldSerialization.h:80
value_entry_t value
Definition Iofaodel_FieldSerialization.h:79
Ioss::Field::BasicType basic_type
Definition Iofaodel_FieldSerialization.h:71
Ioss::Field::RoleType role_type
Definition Iofaodel_FieldSerialization.h:72
size_t raw_count
Definition Iofaodel_FieldSerialization.h:75
Definition Iofaodel_Utils.h:26