18 F5printf(1,
"F5Rset_timestep(,%ld): got invalid grid", timestep);
23 if (have_timestep==timestep)
26 F5printf(1,
"F5Rset_timestep(%ld): invalid timestep specified, "
27 "grid is already bound to %ld!", timestep, have_timestep);
31 space_id= H5Screate(H5S_SCALAR);
35 H5P_DEFAULT, H5P_DEFAULT);
37 H5Awrite(attr_id, H5T_NATIVE_LONG, ×tep);
49 if (!path || path->
Grid_hid<0 || !timestep)
51 F5printf(1,
"F5Rget_timestep(): got invalid grid or parameter.");
62 space_id = H5Aget_space(attr_id);
63 assert( space_id >0);;
64 if (H5Sget_simple_extent_npoints(space_id) != 1)
82 const char*coordinate_system,
84 int IndexDepth,
int SkeletonDimensionality,
86 const hsize_t*refinement)
107 SkeletonDimensionality, Dimensionality,
119 const char*coordinate_system)
122 F5printf(3,
" ---- F5Rcreate_cartesian(T=%g, grid=`%s', coordinates=`%s')",
123 time, gridname, (coordinate_system?coordinate_system:
"Default coordinates"));
137 const char*coordinate_system)
140 gridname, 3, coordinate_system);
147 const char*coordinate_system)
149 F5printf(30,
"F5Rcreate_static_cartesian(grid=`%s')\n", gridname);
200 F5B_standard_faces_cells(),
201 F5B_new_global_faces_cells,
256F5Path*F5Rcreate_cell_topology3D(hid_t File_id,
const double*time,
258 const char*coordinate_system,
263char FullTargetTname[2048];
283 (FullTargetTname,
sizeof(FullTargetTname),
301 const hsize_t*level,
int Centering,
int dims)
311 strcpy(buf,
"VertexLevel");
315 strcpy(buf,
"CellCentering");
316 for(i=0; i<dims; i++)
318 if (Centering & (1<<i))
321 buf[13+i] = i[
"XYZ"];
334 for(i=0; i<dims; i++)
342 (
name,nlength,
"%s_%dx%dx%d", buf, L[0], L[1], L[2]);
348 const hsize_t refinement[3],
349 const char*coordinate_system)
359 0, 3, 3, refinement);
371 const hsize_t current_refinement[3],
373 const hsize_t target_refinement[3])
375char CurrentTname[1024];
376char TargetTname[1024];
379char FullTargetTname[2048];
380 assert(current_refinement);
381 assert(target_refinement);
382 TopologyName(CurrentTname,
sizeof(CurrentTname), current_refinement, 0,3);
383 TopologyName(TargetTname ,
sizeof(TargetTname) , target_refinement, 0,3);
385 F5printf(30,
"F5Rcreate_relative_vertex_Qrefinement3D()\n");
398 F5printf(30,
"F5Rcreate_relative_vertex_Qrefinement3D() - timegroup\n");
405 (FullTargetTname,
sizeof(FullTargetTname),
407 timename, gridname, TargetTname );
412 F5printf(30,
"~F5Rcreate_relative_vertex_Qrefinement3D()\n");
425 const hsize_t current_refinement[3],
427 const hsize_t target_refinement[3])
429char CurrentTname[1024];
430char TargetTname[1024];
433char FullTargetTname[2048];
434 assert(current_refinement);
435 assert(target_refinement);
436 TopologyName(CurrentTname,
sizeof(CurrentTname), current_refinement, 0,3);
437 TopologyName(TargetTname ,
sizeof(TargetTname) , target_refinement, 0,3);
457 (FullTargetTname,
sizeof(FullTargetTname),
459 timename, gridname, TargetTname );
479 const hsize_t target_refinement[3])
481char TargetTname[1024];
482 if (!grid)
return -1;
484 if (!target_refinement)
return -3;
485 TopologyName(TargetTname,
sizeof(TargetTname), target_refinement, 0,3);
508void F5Rcreate_sampling(
F5Path*Topology,
const hsize_t*downsampling,
509 int IndexDepthChange,
512char oldTopologyName[2048], newTopologyName[2048];
514hid_t Top_id, space_id, Rep_id, F_id, pos_fieldtype;
523 IndexDepth += IndexDepthChange;
525 H5Iget_name(Topology->
Topology_hid, oldTopologyName,
sizeof(oldTopologyName) );
526 strcpy(newTopologyName, oldTopologyName);
527 sep = strrchr(newTopologyName, NameSeparator);
529 sep = newTopologyName + strlen(newTopologyName);
535 puts(
"void F5Rcreate_sampling(): not a regular topology");
539 rank = H5Sget_simple_extent_dims(space_id, extent, NULL);
544 pos_fieldtype = H5Tcreate(H5T_COMPOUND, rank*
sizeof(
int) );
546 for(i=0; i<rank; i++)
550 component_map[i] = i;
551 polynom_order[i] = 1;
552 total_refinement[i] = refinement[i]*downsampling[i];
553 extent[i] /= downsampling[i];
555 refinement_coeffs[i][0] = 0;
556 refinement_coeffs[i][1] = downsampling[i];
557 refinement_coeffs_ptr[i] = refinement_coeffs[i];
559 rank_name[0] =
'0' + i;
561 H5Tinsert(pos_fieldtype, rank_name, i*
sizeof(
int), H5T_NATIVE_INT);
563 sprintf(sep,
"%u", (
unsigned)(total_refinement[i]) );
565 if (i<rank-1) *sep++ =
'x';
570 IndexDepth, rank, rank, total_refinement);
572 Rep_id =
F5Gappend(Top_id, oldTopologyName);
574 pos_fieldtype, pos_fieldtype,
575 refinement_coeffs_ptr, polynom_order,
592 F5Rcreate_sampling(Topology, downsampling, +1,
'@');
609 F5Rcreate_sampling(Topology, subsampling, 0,
':');
F5_API ChartDomain_IDs * F5B_new_global_cartesian_chart3D()
hid_t F5LTmake_enum_type(F5Path *fpath)
hid_t F5LwriteX(hid_t R_id, const char *fieldname, int rank, const hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *const *dataPtr, const int *polynom_order, const int component_map[], hid_t property_id, hid_t ProcIDLocation)
F5Path * F5Rcreate_static_cartesian_3D(hid_t File_id, const char *gridname, const char *coordinate_system)
void TopologyName(char *name, int nlength, const hsize_t *level, int Centering, int dims)
ChartDomain_IDs * F5B_new_global_triangle_cells()
ChartDomain_IDs * F5B_new_global_tetrahedral_cells()
ChartDomain_IDs * F5B_new_global_hexahedral_cells()
ChartDomain_IDs * F5B_new_global_edge_cells()
F5_API ChartDomain_IDs * F5B_standard_tetrahedral_cells()
F5_API ChartDomain_IDs * F5B_standard_hexahedral_cells()
F5_API ChartDomain_IDs * F5B_standard_triangle_cells()
F5_API ChartDomain_IDs * F5B_standard_edge_cells()
#define FIBER_HDF5_REPRESENTER
#define FIBER_HDF5_DEFAULT_CHART
#define FIBER_HDF5_TIMESTEP_ATTRIB
#define FIBER_HDF5_POINTS
#define FIBER_HDF5_REFINEMENT_INFO
#define FIBER_HDF5_POSITIONS_STRING
herr_t F_H5Aread(hid_t attr_id, hid_t mem_type_id, void *buf, const char *name)
herr_t F5Glink(hid_t loc_id, H5G_link_t link_type, const char *current_name, const char *new_name)
#define F5printf(verbosity,...)
hid_t F5Tget_space(F5Path *f)
int F5LAget_dimensions(hid_t Field_id, const char *aname, hsize_t dims[FIBER_MAX_RANK])
F5_API hid_t F5LTcreate_topology(hid_t Grid_hid, const char *TopologyName, int IndexDepth, int SkeletonDimensionality, int DataspaceDimensionality, const hsize_t *refinement)
F5_API int F5LTget_index_depth(hid_t Top_hid)
F5Path * F5LTcreate(hid_t File_id, const double *time, const char *gridname, ChartDomain_IDs *ChartDomain, ChartDomain_IDs *coord_creator(), const char *coordinate_system, const char *TopologyName, int IndexDepth, int SkeletonDimensionality, int Dimensionality, const hsize_t *refinement)
F5Path * F5Rcreate_relative_vertex_Qrefinement3D(hid_t File_id, double time, const char *gridname, const hsize_t current_refinement[3], double target_time, const hsize_t target_refinement[3])
F5Path * F5Rcreate_vertex_refinement3D(hid_t File_id, double time, const char *gridname, const hsize_t refinement[3], const char *coordinate_system)
F5Path * F5Rcreate_coordinate_topology(hid_t File_id, const double *time, const char *gridname, const char *coordinate_system, const char *TopologyName, int IndexDepth, int SkeletonDimensionality, int Dimensionality, const hsize_t *refinement)
F5_API F5Path * F5Rcreate_faces_as_vertices_topology(hid_t File_id, double time, const char *gridname)
F5Path * F5Rcreate_triangles_as_vertices_topology(hid_t File_id, double time, const char *gridname)
F5Path * F5Rcreate_cartesian_nD(hid_t File_id, double time, const char *gridname, int Dims, const char *coordinate_system)
void F5Rcreate_subsampling(F5Path *Topology, const hsize_t *subsampling)
F5Path * F5Rcreate_hexaedrons_as_vertices_topology(hid_t File_id, double time, const char *gridname)
void F5Rcreate_downsampling(F5Path *Topology, const hsize_t *downsampling)
long * F5Rget_timestep(F5Path *path, long *timestep)
F5Path * F5Rcreate_relative_vertex_Irefinement3D(hid_t File_id, double time, const char *gridname, const hsize_t current_refinement[3], double target_time, const hsize_t target_refinement[3])
F5Path * F5Rcreate_tetrahedrons_as_vertices_topology(hid_t File_id, double time, const char *gridname)
F5Path * F5Rcreate_edges_as_vertices_topology(hid_t File_id, double time, const char *gridname)
int F5Rlink_default_vertex_topology(F5Path *grid, const hsize_t target_refinement[3])
int F5Rset_timestep(F5Path *path, long timestep)
F5Path * F5Rcreate_cartesian_3D(hid_t File_id, double time, const char *gridname, const char *coordinate_system)
hid_t F5Aopen_name(hid_t location, const char *name)
F5_API char * F5I_timegroup(const double *time, char *destbuf, size_t len)
ChartDomain_IDs * F5B_new_rational_regular_domain3D()
ChartDomain_IDs * F5B_standard_cartesian_chart3D()
ChartDomain_IDs * F5B_new_integer_regular_domain3D()
hid_t F5Gappend(hid_t loc_id, const char *name)