hemocell
Loading...
Searching...
No Matches
FluidHdf5IO.hh
Go to the documentation of this file.
1/*
2This file is part of the HemoCell library
3
4HemoCell is developed and maintained by the Computational Science Lab
5in the University of Amsterdam. Any questions or remarks regarding this library
6can be sent to: info@hemocell.eu
7
8When using the HemoCell library in scientific work please cite the
9corresponding paper: https://doi.org/10.3389/fphys.2017.00563
10
11The HemoCell library is free software: you can redistribute it and/or
12modify it under the terms of the GNU Affero General Public License as
13published by the Free Software Foundation, either version 3 of the
14License, or (at your option) any later version.
15
16The library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU Affero General Public License for more details.
20
21You should have received a copy of the GNU Affero General Public License
22along with this program. If not, see <http://www.gnu.org/licenses/>.
23*/
24#ifndef FLUID_HDF5_IO_HH
25#define FLUID_HDF5_IO_HH
26
27#include "hdf5Output.h"
28#include "xdmfOutput.h"
29#include "palabos3D.h"
30#include "palabos3D.hh"
31
32#include <hdf5.h>
33#include <hdf5_hl.h>
34
35#include <cmath>
36
37namespace hemo {
38
39// Write a 4D dataset (z, y, x, component), one chunk per block (up to 1000 nodes per direction).
40inline void outputHDF5(hsize_t * dim, hsize_t * chunk, hid_t & file_id, std::string & name, float * output) {
41 chunk[3] = dim[3];
42 writeCompressedDataset(file_id, name, H5T_NATIVE_FLOAT, 4, dim, chunk, output);
43}
44
50template <template <class U> class DD>
51class WriteFluidField : public plb::BoxProcessingFunctional3D {
52public:
56 WriteFluidField(HemoCellFields & cellfields_, plb::MultiBlock3D & fluid_, plint iter_, std::string identifier_, T dx_,
57 T dt_, std::vector<int> & outputVariables_, T densityToSI_, std::vector<XdmfBlockFile> * written_)
58 : cellfields(cellfields_), fluid(fluid_), iter(iter_), identifier(identifier_), dx(dx_), dt(dt_),
59 densityToSI(densityToSI_), written(written_), outputVariables(outputVariables_) {}
60
62
63 plb::BlockDomain::DomainT appliesTo() const { return plb::BlockDomain::bulk; }
64
65 WriteFluidField * clone() const { return new WriteFluidField(*this); }
66
67 void getTypeOfModification(std::vector<plb::modif::ModifT> & modified) const {
68 for (pluint i = 0; i < modified.size(); i++) { modified[i] = plb::modif::nothing; }
69 }
70
71 void processGenericBlocks(plb::Box3D domain, std::vector<plb::AtomicBlock3D *> blocks) {
72 int id = plb::global::mpi().getRank();
73 ablock = dynamic_cast<plb::BlockLattice3D<T, DD> *>(blocks[0]);
74 particlefield = dynamic_cast<HemoCellParticleField *>(blocks[1]);
76 ->atomicBlockId; //Nasty trick to prevent us from having to overload the fluid field ( palabos domain)
77
78 // Output functions access the domain and size through these pointers; they
79 // point to members, not to this function's locals, so they stay valid.
80 this->odomainStorage = domain;
81 this->odomain = &this->odomainStorage;
82 if (outputVariables.size() == 0) {
83 return; //No output needed? ok
84 }
85
86 XdmfBlockFile record;
87 record.identifier = identifier;
88 if (cellfields.hemocell.partOfpreInlet) { record.identifier += "_PRE"; }
89 record.blockId = blockid;
90 record.structured = true;
91 record.file = "hdf5/" + zeroPadNumber(iter) + '/' + record.identifier + "." + zeroPadNumber(iter) + ".p." +
92 std::to_string(blockid) + ".h5";
93 std::string fileName = plb::global::directories().getOutputDir() + "/" + record.file;
94 hid_t file_id;
95 file_id = H5Fcreate(fileName.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
96 H5LTset_attribute_double(file_id, "/", "dx", &dx, 1);
97 H5LTset_attribute_double(file_id, "/", "dt", &dt, 1);
98 long int iterHDF5 = iter;
99 H5LTset_attribute_long(file_id, "/", "iteration", &iterHDF5, 1);
100 H5LTset_attribute_int(file_id, "/", "processorId", &id, 1);
101
102 // The bulk nodes only: neighbouring blocks write disjoint nodes. Each node
103 // is the centre of a cell of size dx, so the blocks tile the domain.
104 hsize_t Nx = domain.x1 - domain.x0 + 1;
105 hsize_t Ny = domain.y1 - domain.y0 + 1;
106 hsize_t Nz = domain.z1 - domain.z0 + 1;
107 hsize_t nCells = Nx * Ny * Nz;
108 this->nCellsStorage = nCells;
109 this->nCells = &this->nCellsStorage;
110 int ncells = Nx * Ny * Nz;
111 plb::Dot3D rp_temp = blocks[0]->getLocation();
112 int subdomainSize[] = {int(Nz), int(Ny), int(Nx)}; //Reverse for paraview
113 // Lower corner of the first node's cell, z, y, x.
114 const double scale = cellfields.hemocell.outputInSiUnits ? double(param::dx) : 1.;
115 const double corner[3] = {(rp_temp.z + domain.z0 - 0.5) * scale, (rp_temp.y + domain.y0 - 0.5) * scale,
116 (rp_temp.x + domain.x0 - 0.5) * scale};
117 float dxdydz[3] = {float(scale), float(scale), float(scale)};
118 float relativePosition[3] = {float(corner[0]), float(corner[1]), float(corner[2])};
119 record.nodes[0] = Nz;
120 record.nodes[1] = Ny;
121 record.nodes[2] = Nx;
122 for (int i = 0; i < 3; i++) {
123 record.origin[i] = corner[i];
124 record.spacing[i] = scale;
125 }
126
127 H5LTset_attribute_int(file_id, "/", "numberOfCells", &ncells, 1);
128 H5LTset_attribute_int(file_id, "/", "subdomainSize", subdomainSize, 3);
129 H5LTset_attribute_float(file_id, "/", "relativePosition", relativePosition, 3);
130 H5LTset_attribute_float(file_id, "/", "dxdydz", dxdydz, 3);
131
132 //Also compute chunking here
133 hsize_t chunk[4];
134 chunk[2] = 1000 < Nx ? 1000 : Nx;
135 chunk[1] = 1000 < Ny ? 1000 : Ny;
136 chunk[0] = 1000 < Nz ? 1000 : Nz;
137
138 //I could do fancy schmancy function pointer lookup like with the particles, but it
139 //takes time, just do it here
140 for (int outputVariable : outputVariables) {
141 //These variables should be set by the functions:
142 float * output = 0;
143 hsize_t dim[4] = {Nz, Ny, Nx, 0};
144 std::string name;
145
146 switch (outputVariable) {
147 case OUTPUT_VELOCITY:
148 output = outputVelocity();
149 name = "Velocity";
150 dim[3] = 3;
151 break;
152 case OUTPUT_FORCE:
153 output = outputForce();
154 name = "Force";
155 dim[3] = 3;
156 break;
157 case OUTPUT_DENSITY:
158 output = outputDensity();
159 name = "Density";
160 dim[3] = 1;
161 break;
162 case OUTPUT_BOUNDARY:
163 output = outputBoundary();
164 name = "Boundary";
165 dim[3] = 1;
166 break;
168 output = outputBindingSites();
169 name = "BindingSites";
170 dim[3] = 1;
171 break;
173 output = outputInteriorPoints();
174 name = "InteriorPoints";
175 dim[3] = 1;
176 break;
177 case OUTPUT_OMEGA:
178 output = outputOmega();
179 name = "Omega";
180 dim[3] = 1;
181 break;
183 for (unsigned int i = 0; i < cellfields.size(); i++) {
184 output = outputCellDensity(cellfields[i]->name);
185 name = "CellDensity_" + cellfields[i]->getIdentifier();
186 dim[3] = 1;
187 outputHDF5(dim, chunk, file_id, name, output);
188 record.attributes.push_back(attribute(name, 1));
189 delete[] output;
190 }
191 continue;
193 output = outputShearStress();
194 name = "ShearStress";
195 dim[3] = 6;
196 break;
198 output = outputShearRate();
199 name = "ShearRate";
200 dim[3] = 9;
201 break;
203 output = outputStrainRate();
204 name = "StrainRate";
205 dim[3] = 6;
206 break;
207
208 default:
209
210 continue;
211 }
212
213
214 outputHDF5(dim, chunk, file_id, name, output);
215 record.attributes.push_back(attribute(name, dim[3]));
216 delete[] output;
217 }
218 H5Fclose(file_id);
219 written->push_back(record);
220 }
221
222private:
223 static XdmfAttribute attribute(const std::string & name, hsize_t components) {
225 a.name = name;
226 a.components = int(components);
227 return a;
228 }
229
230 float * outputVelocity() {
231 float * output = new float[(*nCells) * 3];
232 unsigned int n = 0;
233 plb::Array<T, 3> vel;
234 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
235 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
236 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
237 ablock->get(iX, iY, iZ).computeVelocity(vel);
238 output[n] = vel[0];
239 output[n + 1] = vel[1];
240 output[n + 2] = vel[2];
241 n += 3;
242 }
243 }
244 }
245
247 for (unsigned int i = 0; i < (*nCells) * 3; i++) { output[i] = output[i] * param::dx / param::dt; }
248 }
249
250 return output;
251 }
252
253 float * outputForce() {
254 float * output = new float[(*nCells) * 3];
255 unsigned int n = 0;
257 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
258 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
259 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
260 output[n] = ablock->get(iX, iY, iZ).external.data[0];
261 output[n + 1] = ablock->get(iX, iY, iZ).external.data[1];
262 output[n + 2] = ablock->get(iX, iY, iZ).external.data[2];
263 n += 3;
264 }
265 }
266 }
267
269 for (unsigned int i = 0; i < (*nCells) * 3; i++) { output[i] = output[i] * param::df; }
270 }
271
272 return output;
273 }
274
275 float * outputDensity() {
276 float * output = new float[(*nCells)];
277 unsigned int n = 0;
278 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
279 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
280 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
281 output[n] = ablock->get(iX, iY, iZ).computeDensity();
282 n++;
283 }
284 }
285 }
286
288 for (unsigned int i = 0; i < (*nCells); i++) { output[i] = output[i] * densityToSI; }
289 }
290
291 return output;
292 }
293
294 float * outputBoundary() {
295 float * output = new float[(*nCells)];
296 unsigned int n = 0;
297 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
298 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
299 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
300 if (ablock->get(iX, iY, iZ).getDynamics().isBoundary()) {
301 output[n] = 1;
302 } else {
303 output[n] = 0;
304 }
305 n++;
306 }
307 }
308 }
309 return output;
310 }
311
313 float * output = new float[(*nCells)];
315 plb::pcout
316 << "(FluidHdf5) (Error) OUTPUT_BINDING_SITES requested, but binding sites not used, outputting a zero field"
317 << std::endl;
318 for (hsize_t i = 0; i < *nCells; i++) { output[i] = 0; }
319 return output;
320 }
321 unsigned int n = 0;
322 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
323 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
324 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
325 if (particlefield->bindingField->get(iX, iY, iZ)) {
326 output[n] = 1;
327 } else {
328 output[n] = 0;
329 }
330 n++;
331 }
332 }
333 }
334 return output;
335 }
336
338 float * output = new float[(*nCells)];
340 plb::pcout
341 << "(FluidHdf5) (Error) OUTPUT_INTERIOR_POINTS requested, but interior viscosity not used, outputting a zero field"
342 << std::endl;
343 for (hsize_t i = 0; i < *nCells; i++) { output[i] = 0; }
344 return output;
345 }
346 unsigned int n = 0;
347 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
348 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
349 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
350 output[n] = (particlefield->interiorViscosityField->get(iX, iY, iZ));
351 n++;
352 }
353 }
354 }
355 return output;
356 }
357
358 float * outputOmega() {
359 float * output = new float[(*nCells)];
360 unsigned int n = 0;
361 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
362 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
363 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
364 output[n] = ablock->get(iX, iY, iZ).getDynamics().getOmega();
365 n++;
366 }
367 }
368 }
369 // omega = 1/tau is dimensionless: the same in SI and lattice units.
370
371 return output;
372 }
373
374 float * outputCellDensity(std::string name) {
375 float * output = new float[(*nCells)];
376 memset(output, 0, sizeof(float) * (*nCells));
377
378 std::vector<HemoCellParticle *> found;
380
381 const plint nx = odomain->x1 - odomain->x0 + 1;
382 const plint ny = odomain->y1 - odomain->y0 + 1;
383 const plint nz = odomain->z1 - odomain->z0 + 1;
384 const plb::Dot3D location = ablock->getLocation();
385
386 for (HemoCellParticle * particle : found) {
387 // Node whose cell (half a node in each direction, upper face included,
388 // as in isContainedABS()) holds the particle, relative to the first
389 // bulk node of this block.
390 const plint iX = plint(std::ceil(particle->sv.position[0] - location.x - 0.5)) - odomain->x0;
391 const plint iY = plint(std::ceil(particle->sv.position[1] - location.y - 0.5)) - odomain->y0;
392 const plint iZ = plint(std::ceil(particle->sv.position[2] - location.z - 0.5)) - odomain->z0;
393 if (iX < 0 || iX >= nx || iY < 0 || iY >= ny || iZ < 0 || iZ >= nz) { continue; }
394 output[iX + nx * (iY + ny * iZ)] += 1;
395 }
396
398 for (unsigned int i = 0; i < (*nCells); i++) { output[i] *= cellfields[name]->volumeFractionOfLspPerNode; }
399 }
400
401 return output;
402 }
403
405 float * output = new float[(*nCells) * 6];
406 unsigned int n = 0;
407 plb::Array<T, 6> stress;
408
409 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
410 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
411 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
412 ablock->get(iX, iY, iZ).computeShearStress(stress);
413 //Array<T,6> stress_vec = stress.get(iX,iY,iZ);
414 output[n] = stress[0];
415 output[n + 1] = stress[1];
416 output[n + 2] = stress[2];
417 output[n + 3] = stress[3];
418 output[n + 4] = stress[4];
419 output[n + 5] = stress[5];
420 n += 6;
421 }
422 }
423 }
424
426 for (unsigned int i = 0; i < (*nCells) * 6; i++) {
427 output[i] = output[i] * (param::df / (param::dx * param::dx));
428 }
429 }
430
431 return output;
432 }
433
434 float * outputShearRate() {
435 float * output = new float[(*nCells) * 9];
436 unsigned int n = 0;
437 plb::Array<T, 9> shearrate;
438 plb::Array<T, 3> velp1;
439 plb::Array<T, 3> veln1;
440 plb::Array<T, 3> velp2;
441 plb::Array<T, 3> veln2;
442 plb::Array<T, 3> velp3;
443 plb::Array<T, 3> veln3;
444
445 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
446 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
447 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
448 // velocity gradients in y-direction
449 ablock->get(iX + 1, iY, iZ).computeVelocity(velp1); //vel at cell+1
450 ablock->get(iX - 1, iY, iZ).computeVelocity(veln1); //vel at cell+1
451
452 // velocity gradients in y-direction
453 ablock->get(iX, iY + 1, iZ).computeVelocity(velp2); //vel at cell+1
454 ablock->get(iX, iY - 1, iZ).computeVelocity(veln2); //vel at cell+1
455
456 // velocity gradients in z-direction
457 ablock->get(iX, iY, iZ + 1).computeVelocity(velp3); //vel at cell+1
458 ablock->get(iX, iY, iZ - 1).computeVelocity(veln3); //vel at cell+1
459
460 shearrate[0] = (velp1[0] - veln1[0]) / 2; // dv_x /2*dx
461 shearrate[3] = (velp1[1] - veln1[1]) / 2; // dv_y/ 2*dx
462 shearrate[6] = (velp1[2] - veln1[2]) / 2; // dv_z /2*dx
463 shearrate[1] = (velp2[0] - veln2[0]) / 2; // dv_x / 2*dy
464 shearrate[4] = (velp2[1] - veln2[1]) / 2; // dv_y / 2*dy
465 shearrate[7] = (velp2[2] - veln2[2]) / 2; // dv_z / 2*dy
466 shearrate[2] = (velp3[0] - veln3[0]) / 2; // dv_x / 2*dz
467 shearrate[5] = (velp3[1] - veln3[1]) / 2; // dv_y / 2*dz
468 shearrate[8] = (velp3[2] - veln3[2]) / 2; // dv_z / 2*dz
469
470 output[n] = shearrate[0];
471 output[n + 1] = shearrate[1];
472 output[n + 2] = shearrate[2];
473 output[n + 3] = shearrate[3];
474 output[n + 4] = shearrate[4];
475 output[n + 5] = shearrate[5];
476 output[n + 6] = shearrate[6];
477 output[n + 7] = shearrate[7];
478 output[n + 8] = shearrate[8];
479 n += 9;
480 }
481 }
482 }
483
485 for (unsigned int i = 0; i < (*nCells) * 9; i++) { output[i] = output[i] * (1 / (param::dt)); }
486 }
487
488 return output;
489 }
490
492 float * output = new float[(*nCells) * 6];
493 unsigned int n = 0;
494 // calculate tensorfield strain rate
495 std::unique_ptr<plb::TensorField3D<T, 6>> strainrate(computeStrainRateFromStress(*ablock));
496 // calculate norm of tensorfield
497 std::unique_ptr<plb::ScalarField3D<T>> shearrate(computeSymmetricTensorNorm(*strainrate));
498
499 //strainrate.get()
500
501 for (plint iZ = odomain->z0; iZ <= odomain->z1; ++iZ) {
502 for (plint iY = odomain->y0; iY <= odomain->y1; ++iY) {
503 for (plint iX = odomain->x0; iX <= odomain->x1; ++iX) {
504 if ((iX < fluid.getBoundingBox().x0 - 2) || (iX > fluid.getBoundingBox().x1 + 2) ||
505 (iY < fluid.getBoundingBox().y0 - 2) || (iY > fluid.getBoundingBox().y1 + 2) ||
506 (iZ < fluid.getBoundingBox().z0 - 2) || (iZ > fluid.getBoundingBox().z1 + 2)) {
507 output[n] = 0;
508 output[n + 1] = 0;
509 output[n + 2] = 0;
510 output[n + 3] = 0;
511 output[n + 4] = 0;
512 output[n + 5] = 0;
513 n += 6;
514 } else {
515 output[n] = strainrate->get(iX, iY, iZ)[0];
516 output[n + 1] = strainrate->get(iX, iY, iZ)[1];
517 output[n + 2] = strainrate->get(iX, iY, iZ)[2];
518 output[n + 3] = strainrate->get(iX, iY, iZ)[3];
519 output[n + 4] = strainrate->get(iX, iY, iZ)[4];
520 output[n + 5] = strainrate->get(iX, iY, iZ)[5];
521 n += 6;
522 }
523 }
524 }
525 }
526
528 for (unsigned int i = 0; i < (*nCells) * 6; i++) { output[i] = output[i] * (1 / (param::dt)); }
529 }
530
531 return output;
532 }
533
534
536 plb::MultiBlock3D & fluid;
538 std::string identifier;
539 double dx;
540 double dt;
542 std::vector<XdmfBlockFile> * written;
543 plb::Box3D * odomain;
544 plb::Box3D odomainStorage;
545 plb::BlockLattice3D<T, DD> * ablock;
548 hsize_t * nCells;
549 hsize_t nCellsStorage = 0;
550 std::vector<int> & outputVariables;
551};
552}
553#endif
Definition hemoCellFields.h:54
unsigned int size()
Get the number of celltypes.
Definition hemoCellFields.cpp:146
HemoCell & hemocell
Reference to parent.
Definition hemoCellFields.h:229
Definition hemoCellParticleField.h:39
plb::ScalarField3D< bool > * bindingField
Definition hemoCellParticleField.h:248
pluint atomicBlockId
Definition hemoCellParticleField.h:171
virtual void findParticles(plb::Box3D domain, std::vector< HemoCellParticle * > &found)
Definition hemoCellParticleField.cpp:323
plb::ScalarField3D< T > * interiorViscosityField
Definition hemoCellParticleField.h:233
plb::Box3D localDomain
Definition hemoCellParticleField.h:244
Definition hemoCellParticle.h:44
bool outputInSiUnits
Write output in SI units (default) or in lattice units.
Definition hemocell.h:277
bool partOfpreInlet
Definition hemocell.h:337
static T dt
Definition constantConversion.h:35
static T df
Definition constantConversion.h:35
static T dx
Definition constantConversion.h:35
Definition FluidHdf5IO.hh:51
float * outputShearStress()
Definition FluidHdf5IO.hh:404
plb::Box3D * odomain
Definition FluidHdf5IO.hh:543
HemoCellParticleField * particlefield
Definition FluidHdf5IO.hh:546
double dx
Definition FluidHdf5IO.hh:539
void processGenericBlocks(plb::Box3D domain, std::vector< plb::AtomicBlock3D * > blocks)
Definition FluidHdf5IO.hh:71
plint iter
Definition FluidHdf5IO.hh:537
std::vector< XdmfBlockFile > * written
Definition FluidHdf5IO.hh:542
plb::MultiBlock3D & fluid
Definition FluidHdf5IO.hh:536
float * outputInteriorPoints()
Definition FluidHdf5IO.hh:337
hsize_t nCellsStorage
Definition FluidHdf5IO.hh:549
plb::BlockDomain::DomainT appliesTo() const
Definition FluidHdf5IO.hh:63
WriteFluidField(HemoCellFields &cellfields_, plb::MultiBlock3D &fluid_, plint iter_, std::string identifier_, T dx_, T dt_, std::vector< int > &outputVariables_, T densityToSI_, std::vector< XdmfBlockFile > *written_)
Definition FluidHdf5IO.hh:56
float * outputCellDensity(std::string name)
Definition FluidHdf5IO.hh:374
WriteFluidField * clone() const
Definition FluidHdf5IO.hh:65
double dt
Definition FluidHdf5IO.hh:540
float * outputShearRate()
Definition FluidHdf5IO.hh:434
hsize_t * nCells
Definition FluidHdf5IO.hh:548
HemoCellFields & cellfields
Definition FluidHdf5IO.hh:535
std::vector< int > & outputVariables
Definition FluidHdf5IO.hh:550
float * outputOmega()
Definition FluidHdf5IO.hh:358
float * outputStrainRate()
Definition FluidHdf5IO.hh:491
~WriteFluidField()
Definition FluidHdf5IO.hh:61
float * outputDensity()
Definition FluidHdf5IO.hh:275
float * outputBoundary()
Definition FluidHdf5IO.hh:294
plb::BlockLattice3D< T, DD > * ablock
Definition FluidHdf5IO.hh:545
std::string identifier
Definition FluidHdf5IO.hh:538
float * outputForce()
Definition FluidHdf5IO.hh:253
static XdmfAttribute attribute(const std::string &name, hsize_t components)
Definition FluidHdf5IO.hh:223
T densityToSI
Definition FluidHdf5IO.hh:541
int blockid
Definition FluidHdf5IO.hh:547
float * outputBindingSites()
Definition FluidHdf5IO.hh:312
float * outputVelocity()
Definition FluidHdf5IO.hh:230
void getTypeOfModification(std::vector< plb::modif::ModifT > &modified) const
Definition FluidHdf5IO.hh:67
plb::Box3D odomainStorage
Definition FluidHdf5IO.hh:544
double T
Definition constant_defaults.h:137
long int plint
Definition constant_defaults.h:149
long unsigned int pluint
Definition constant_defaults.h:152
Definition config.cpp:37
constexpr int OUTPUT_VELOCITY
Definition constant_defaults.h:120
void writeCompressedDataset(hid_t file, const std::string &name, hid_t type, int rank, const hsize_t *dims, const hsize_t *chunk, const void *data)
Create the dataset name in file and write data to it, chunked, byte-shuffled and deflate-compressed.
Definition hdf5Output.cpp:28
constexpr int OUTPUT_SHEAR_RATE
Definition constant_defaults.h:131
std::string zeroPadNumber(int num, int w)
Definition genericFunctions.cpp:103
constexpr int OUTPUT_DENSITY
Definition constant_defaults.h:121
constexpr int OUTPUT_FORCE
Definition constant_defaults.h:111
constexpr int OUTPUT_BOUNDARY
Definition constant_defaults.h:128
constexpr int OUTPUT_CELL_DENSITY
Definition constant_defaults.h:124
constexpr int OUTPUT_BINDING_SITES
Definition constant_defaults.h:129
void outputHDF5(hsize_t *dim, hsize_t *chunk, hid_t &file_id, std::string &name, float *output)
Definition FluidHdf5IO.hh:40
constexpr int OUTPUT_SHEAR_STRESS
Definition constant_defaults.h:125
constexpr int OUTPUT_OMEGA
Definition constant_defaults.h:127
constexpr int OUTPUT_STRAIN_RATE
Definition constant_defaults.h:132
constexpr int OUTPUT_INTERIOR_POINTS
Definition constant_defaults.h:130
Definition array.h:40
A dataset of a block file that is listed as an XDMF attribute.
Definition xdmfOutput.h:35
int components
Values per vertex (cells) or per lattice node (fluid).
Definition xdmfOutput.h:37
std::string name
HDF5 dataset name, also the attribute name.
Definition xdmfOutput.h:36
What one atomic block wrote to its HDF5 file in one output step.
Definition xdmfOutput.h:51
long blockId
Atomic block ID; blocks are listed in ascending ID.
Definition xdmfOutput.h:54
double origin[3]
Structured: lower corner of the first node's cell, z, y, x.
Definition xdmfOutput.h:58
long nodes[3]
Structured: number of nodes in z, y, x (dataset dimensions).
Definition xdmfOutput.h:57
std::vector< XdmfAttribute > attributes
Datasets listed as attributes.
Definition xdmfOutput.h:65
std::string file
HDF5 file, relative to the output directory.
Definition xdmfOutput.h:53
double spacing[3]
Structured: node spacing, z, y, x.
Definition xdmfOutput.h:59
std::string identifier
Output name: cell type, "Fluid" or "CEPAC"; "_PRE" appended in the pre-inlet.
Definition xdmfOutput.h:52
bool structured
Regular grid (fluid) or surface mesh (cells).
Definition xdmfOutput.h:55