FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5B.c File Reference
#include "F5B.h"
#include "F5X.h"
#include "F5F.h"
#include "F5defs.h"
#include "F5coordinates.h"
#include "F5private.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  mkDomain

Functions

ChartDomain_IDsF5FB_read_global_chart (F5Path *f)
void F5Bincrement_domain_refs (ChartDomain_IDs *ChartDomain)
F5PathF5Bopen_coordinate_domain (hid_t File_id, ChartDomain_IDs *ChartDomain)
F5PathF5Binitialize_path (hid_t File_id)
void F5close (F5Path *f)
void F5closep (F5Path **f)
void F5Bswap_dims (int dimensions, const hsize_t *in, hsize_t *out)
 Swap from C array order to Fortran array order and back.

Function Documentation

◆ F5Bincrement_domain_refs()

void F5Bincrement_domain_refs ( ChartDomain_IDs * ChartDomain)

Definition at line 68 of file F5B.c.

69{
70 if (ChartDomain)
71 ChartDomain->refs++;
72}
unsigned refs
Definition F5Bchart.h:114

References ChartDomain_IDs::refs.

◆ F5Bopen_coordinate_domain()

F5Path * F5Bopen_coordinate_domain ( hid_t File_id,
ChartDomain_IDs * ChartDomain )

Definition at line 74 of file F5B.c.

76{
77F5Path *f;
78 if (File_id<1)
79 {
80 F5printf(10, "*F5Bopen_coordinate_domain(): Invalid file ID given!");
81 return NULL;
82 }
83
84 f = newF5Path(File_id);
85
86 F5printf(30, "F5Bopen_coordinate_domain()");
87
88 H5E_BEGIN_TRY
89 f->ContentsGroup_hid = H5Gopen2(File_id, FIBER_CONTENTS,H5P_DEFAULT);
90
91 if (f->ContentsGroup_hid<=0)
92 F5printf(10, "File contains no "FIBER_CONTENTS" contents group (old F5 file?).");
93
94 /* NOTE: This should actually retrieve the enum types plus
95 field versioning information from the file!
96 */
97 if (f->ContentsGroup_hid>=0)
98 {
99 f->field_enum_type_hid = H5Topen2(f->ContentsGroup_hid, FIBER_ARRAY_TYPE_ENUM, H5P_DEFAULT);
100 if (f->field_enum_type_hid < 0)
101 F5printf(10, "File Contents group contains no field enumeration type (old F5 file?)");
102 }
103 H5E_END_TRY
104
105 f->Slice_hid = 0;
106 f->Grid_hid = 0;
107 f->Charts_hid = 0;
108 f->Chart_hid = 0;
109 f->Topology_hid = 0;
110 f->Representation_hid = 0;
111
112 /* preparing chart */
113
115 if (f->GlobalChart_hid<0)
116 {
117 F5printf(10, "File contains no "FIBER_HDF5_GLOBAL_CHARTS" entry (invalid F5 file?)");
118 deleteF5Path(f);
119 F5printf(30, "~F5Bopen_coordinate_domain() failed");
120 return NULL;
121 }
122
123 assert(ChartDomain);
124 {
125 f->myChart = ChartDomain;
126 f->myChart->refs++;
127 }
128
129 /* Creates an entry in the "global charts" group for all cartesian charts,
130 this is the place to store the named types of cartesian charts.
131
132 NOTE: This coordinate/chart reference stuff is planned to be replaced by shared
133 types. This revision will work without links.
134 */
136 {
138 F5printf(30, "~F5Bopen_coordinate_domain() is ok");
139 return f;
140 }
141#if 1
142 F5printf(10, "F5Bopen_coordinate_domain() failed, but still trying to make sense out of this file.");
143 f->FileIDs = 0;
144 return f;
145#else
147 deleteF5Path(f);
148
149 F5printf(30, "~F5Bopen_coordinate_domain() failed");
150 return NULL;
151#endif
152}
ChartDomain_IDs * F5FB_read_global_chart(F5Path *f)
Definition F5B.c:14
F5Path * newF5Path(hid_t File_id)
Definition F5Path.c:5
void deleteF5Path(F5Path *f)
Definition F5Path.c:18
#define FIBER_HDF5_GLOBAL_CHARTS
Definition F5defs.h:109
#define FIBER_CONTENTS
Definition F5defs.h:23
#define FIBER_ARRAY_TYPE_ENUM
Definition F5defs.h:293
#define F5printf(verbosity,...)
Definition F5private.h:60
#define H5Gclose(x)
Definition F5X.h:144
int F5Gexist(hid_t location, const char *name)
Definition F5X.c:307
hid_t F5Gtry_to_open(hid_t location, const char *name)
Definition F5X.c:297
const char * domain_name
Definition F5Bchart.h:112
hid_t GlobalChart_hid
Definition F5Path.h:54
hid_t Grid_hid
Definition F5Path.h:53
ChartDomain_IDs * FileIDs
Definition F5Path.h:35
hid_t field_enum_type_hid
Definition F5Path.h:48
hid_t Charts_hid
Definition F5Path.h:55
hid_t Representation_hid
Definition F5Path.h:58
hid_t ContentsGroup_hid
Definition F5Path.h:51
hid_t Slice_hid
Definition F5Path.h:52
hid_t Topology_hid
Definition F5Path.h:57
hid_t Chart_hid
Definition F5Path.h:56
ChartDomain_IDs * myChart
Definition F5Path.h:33

References F5Path::Chart_hid, F5Path::Charts_hid, F5Path::ContentsGroup_hid, deleteF5Path(), ChartDomain_IDs::domain_name, F5FB_read_global_chart(), F5Gexist(), F5Gtry_to_open(), F5printf, FIBER_ARRAY_TYPE_ENUM, FIBER_CONTENTS, FIBER_HDF5_GLOBAL_CHARTS, F5Path::field_enum_type_hid, F5Path::FileIDs, F5Path::GlobalChart_hid, F5Path::Grid_hid, H5Gclose, F5Path::myChart, newF5Path(), ChartDomain_IDs::refs, F5Path::Representation_hid, F5Path::Slice_hid, and F5Path::Topology_hid.

Referenced by F5Binitialize_path().

◆ F5Bswap_dims()

void F5Bswap_dims ( int dimensions,
const hsize_t * in,
hsize_t * out )

Swap from C array order to Fortran array order and back.

Parameters
dimensionsNumber of dimensions.
inInput vector.
outOutput vector.

Use it like

hsize_t c_dims[FIBER_MAX_RANK];
F5order_swap (3, dims, c_dims);
id = F5Screate_simple (...);
#define FIBER_MAX_RANK
Definition F5defs.h:105

Definition at line 230 of file F5B.c.

231{
232int i;
233
234 for (i = 0; i < dimensions; i++) {
235 out[i] = in[dimensions - 1 - i];
236 }
237}

◆ F5closep()

void F5closep ( F5Path ** f)

Definition at line 222 of file F5B.c.

223{
224 if (!f) return;
225 if (!*f) return;
226 F5close(*f);
227 *f = NULL;
228}
void F5close(F5Path *f)
Definition F5B.c:186

References F5close().

◆ F5FB_read_global_chart()

ChartDomain_IDs * F5FB_read_global_chart ( F5Path * f)

Definition at line 14 of file F5B.c.

15{
17}
ChartDomain_IDs * F5B_read_global_chart(hid_t ChartsID, const char *name)
Definition F5Bchart.c:696

References ChartDomain_IDs::domain_name, F5B_read_global_chart(), F5Path::GlobalChart_hid, and F5Path::myChart.

Referenced by F5Bopen_coordinate_domain(), and F5LTcreateV().