Skip to main content

Rocky Solver SDK 2024 R2

rocky_output_collections_api

Last update: 17.07.2025
1#pragma once
2
3// Includes ========================================================================================
4#include "rocky_time_curve_data.hpp"
5#include "rocky_output_properties.h"
6
7// =================================================================================================
8// IRockyCurveCollectionData
9// =================================================================================================
10
30{
43 void create_particles_dataset(const std::string& name, const std::string& unit);
44
58 void create_geometry_dataset(int geometry_id, const std::string& name, const std::string& unit);
59
73 void create_dataset(const std::string& owner_name, const std::string& name, const std::string& unit);
74
84 const std::string& domain_dataset, const std::string& image_dataset);
85
97 int geometry_id, const std::string& domain_dataset, const std::string& image_dataset);
98
109 void add_curve(
110 const std::string& owner_name, const std::string& domain_dataset, const std::string& image_dataset);
111
122 void setup_particles_dataset_dimension(const std::string& name, double dimension);
123
137 int geometry_id, const std::string& name, double dimension);
138
152 const std::string& owner_name, const std::string& name, double dimension);
153
167 void update_particles_dataset(const std::string& name, const double* dataset, size_t size);
168
185 int geometry_id, const std::string& name, const double* dataset, size_t size);
186
202 void update_dataset(
203 const std::string& owner_name, const std::string& name, const double* dataset, size_t size);
204
216 void create_particles_time_curve(const std::string& name, const std::string& unit);
217
230 void create_geometry_time_curve(int geometry_id, const std::string& name, const std::string& unit);
231
244 void create_time_curve(const std::string& owner_name, const std::string& name, const std::string& unit);
245
256 void setup_particles_time_curve_dimension(const std::string& name, double dimension);
257
270 void setup_geometry_time_curve_dimension(int geometry_id, const std::string& name, double dimension);
271
284 void setup_time_curve_dimension(const std::string& owner_name, const std::string& name, double dimension);
285
297 void update_particles_time_curve(const std::string& name, double value);
298
312 void update_geometry_time_curve(int geometry_id, const std::string& name, double value);
313
327 void update_time_curve(const std::string& owner_name, const std::string& name, double value);
328
331 std::shared_ptr<rocky20::RockyAddinCurvesWriter> datasets_writer, bool is_setup_stage);
332
333 RockyCurveCollectionData _impl;
334 bool _is_setup_stage;
336};
337
338inline IRockyCurveCollectionData::IRockyCurveCollectionData(
339 std::shared_ptr<rocky20::RockyAddinCurvesWriter> datasets_writer, bool is_setup_stage)
340 : _impl(datasets_writer)
341 , _is_setup_stage(is_setup_stage)
342{
343}
344
345// create ------------------------------------------------------------------------------------------
346
348 const std::string& name, const std::string& unit)
349{
350 if (this->_is_setup_stage)
351 this->_impl.create_particles_dataset(name, unit);
352 else
353 ROCKY_RUNTIME_ERROR("Curve collection datasets must be created before a simulation starts.")
354}
355
357 int geometry_id, const std::string& name, const std::string& unit)
358{
359 if (this->_is_setup_stage)
360 this->_impl.create_geometry_dataset(name, unit, geometry_id);
361 else
362 ROCKY_RUNTIME_ERROR("Curve collection datasets must be created before a simulation starts.")
363}
364
366 const std::string& owner_name, const std::string& name, const std::string& unit)
367{
368 if (this->_is_setup_stage)
369 this->_impl.create_custom_dataset(name, unit, owner_name);
370 else
371 ROCKY_RUNTIME_ERROR("Curve collection datasets must be created before a simulation starts.")
372}
373
375 const std::string& domain_dataset, const std::string& image_dataset)
376{
377 if (this->_is_setup_stage)
378 this->_impl.create_particles_curve(domain_dataset, image_dataset);
379 else
380 ROCKY_RUNTIME_ERROR("Curve collection curves must be created before a simulation starts.")
381}
382
384 int geometry_id, const std::string& domain_dataset, const std::string& image_dataset)
385{
386 if (this->_is_setup_stage)
387 this->_impl.create_geometry_curve(domain_dataset, image_dataset, geometry_id);
388 else
389 ROCKY_RUNTIME_ERROR("Curve collection curves must be created before a simulation starts.")
390}
391
393 const std::string& owner_name, const std::string& domain_dataset, const std::string& image_dataset)
394{
395 if (this->_is_setup_stage)
396 this->_impl.create_custom_curve(domain_dataset, image_dataset, owner_name);
397 else
398 ROCKY_RUNTIME_ERROR("Curve collection curves must be created before a simulation starts.")
399}
400
401inline void IRockyCurveCollectionData::create_particles_time_curve(const std::string& name, const std::string& unit)
402{
403 if (this->_is_setup_stage)
404 this->_impl.create_particles_time_curve(name, unit);
405 else
406 ROCKY_RUNTIME_ERROR("Curve collection curves must be created before a simulation starts.")
407}
408
409inline void IRockyCurveCollectionData::create_geometry_time_curve(int geometry_id, const std::string& name, const std::string& unit)
410{
411 if (this->_is_setup_stage)
412 this->_impl.create_geometry_time_curve(name, unit, geometry_id);
413 else
414 ROCKY_RUNTIME_ERROR("Curve collection curves must be created before a simulation starts.")
415}
416
418 const std::string &owner_name, const std::string &name, const std::string &unit)
419{
420 if (this->_is_setup_stage)
421 this->_impl.create_custom_time_curve(name, unit, owner_name);
422 else
423 ROCKY_RUNTIME_ERROR("Curve collection curves must be created before a simulation starts.")
424}
425
426// dimensions --------------------------------------------------------------------------------------
428 const std::string& name, double dimension)
429{
430 if (this->_is_setup_stage)
431 this->_impl.setup_particles_dataset_dimension(name, dimension);
432 else
433 ROCKY_RUNTIME_ERROR(
434 "The dimension associated to a dataset must be set before a simulation starts.")
435}
436
438 int geometry_id, const std::string& name, double dimension)
439{
440 if (this->_is_setup_stage)
441 this->_impl.setup_geometry_dataset_dimension(name, dimension, geometry_id);
442 else
443 ROCKY_RUNTIME_ERROR(
444 "The dimension associated to a dataset must be set before a simulation starts.")
445}
446
448 const std::string &owner_name, const std::string &name, double dimension)
449{
450 if (this->_is_setup_stage)
451 this->_impl.setup_custom_dataset_dimension(name, dimension, owner_name);
452 else
453 ROCKY_RUNTIME_ERROR("The dimension associated to a dataset must be set before a simulation starts.")
454}
455
457 const std::string& name, double dimension)
458{
459 if (this->_is_setup_stage)
460 this->_impl.setup_particles_dataset_dimension(name, dimension);
461 else
462 ROCKY_RUNTIME_ERROR(
463 "The dimension associated to a time curve must be set before a simulation starts.")
464}
465
467 int geometry_id, const std::string& name, double dimension)
468{
469 if (this->_is_setup_stage)
470 this->_impl.setup_geometry_dataset_dimension(name, dimension, geometry_id);
471 else
472 ROCKY_RUNTIME_ERROR(
473 "The dimension associated to a time curve must be set before a simulation starts.")
474}
475
477 const std::string& owner_name, const std::string& name, double dimension)
478{
479 if (this->_is_setup_stage)
480 this->_impl.setup_custom_dataset_dimension(name, dimension, owner_name);
481 else
482 ROCKY_RUNTIME_ERROR(
483 "The dimension associated to a time curve must be set before a simulation starts.")
484}
485
486// update ------------------------------------------------------------------------------------------
487
489 const std::string& name, const double* dataset, size_t size)
490{
491 if (!this->_is_setup_stage)
492 this->_impl.update_particles_dataset(name, dataset, size);
493 else
494 ROCKY_RUNTIME_ERROR(
495 "Curve collection datasets must be updated during the simulation iterative process.")
496}
497
499 int geometry_id, const std::string& name, const double* dataset, size_t size)
500{
501 if (!this->_is_setup_stage)
502 this->_impl.update_geometry_dataset(name, dataset, size, geometry_id);
503 else
504 ROCKY_RUNTIME_ERROR(
505 "Curve collection datasets must be updated during the simulation iterative process.")
506}
507
509 const std::string& owner_name, const std::string& name, const double* dataset, size_t size)
510{
511 if (!this->_is_setup_stage)
512 this->_impl.update_custom_dataset(name, dataset, size, owner_name);
513 else
514 ROCKY_RUNTIME_ERROR(
515 "Curve collection datasets must be updated during the simulation iterative process.")
516}
517
518inline void IRockyCurveCollectionData::update_particles_time_curve(const std::string& name, double value)
519{
520 if (!this->_is_setup_stage)
521 this->_impl.update_particles_dataset(name, &value, 1);
522 else
523 ROCKY_RUNTIME_ERROR(
524 "Curve collection datasets must be updated during the simulation iterative process.")
525}
526
527inline void IRockyCurveCollectionData::update_geometry_time_curve(int geometry_id, const std::string& name, double value)
528{
529 if (!this->_is_setup_stage)
530 this->_impl.update_geometry_dataset(name, &value, 1, geometry_id);
531 else
532 ROCKY_RUNTIME_ERROR(
533 "Curve collection datasets must be updated during the simulation iterative process.")
534}
535
537 const std::string &owner_name, const std::string &name, double value)
538{
539 if (!this->_is_setup_stage)
540 this->_impl.update_custom_dataset(name, &value, 1, owner_name);
541 else
542 ROCKY_RUNTIME_ERROR("Curve collection datasets must be updated during the simulation iterative process.")
543}
544
545// =================================================================================================
546// IRockyOutputPropertyCollection
547// =================================================================================================
548
555{
564 int create_particles_instantaneous_property(const std::string& name, const std::string& unit, double dimension = 1.0);
565
575 int create_particles_statistical_property(const std::string& name, const std::string& unit, double dimension = 1.0);
576
585 int create_triangles_instantaneous_property(const std::string& name, const std::string& unit, double dimension = 1.0);
586
596 int create_triangles_statistical_property(const std::string& name, const std::string& unit, double dimension = 1.0);
597
606 int create_vertex_triangles_instantaneous_property(const std::string& name, const std::string& unit, double dimension = 1.0);
607
617 int create_vertex_triangles_statistical_property(const std::string& name, const std::string& unit, double dimension = 1.0);
618
620 IRockyOutputPropertyCollection(std::shared_ptr<OutputPropertiesSetup> properties_setup);
621
622 std::shared_ptr<OutputPropertiesSetup> _impl;
624};
625
626inline IRockyOutputPropertyCollection::IRockyOutputPropertyCollection(
627 std::shared_ptr<OutputPropertiesSetup> properties_setup)
628 : _impl(properties_setup)
629{}
630
632 const std::string& name, const std::string& unit, double dimension)
633{
634 return this->_impl->create_particles_instantaneous_property(name, unit, dimension);
635}
636
638 const std::string& name, const std::string& unit, double dimension)
639{
640 return this->_impl->create_particles_statistical_property(name, unit, dimension);
641}
642
644 const std::string& name, const std::string& unit, double dimension)
645{
646 return this->_impl->create_triangles_instantaneous_property(name, unit, dimension);
647}
648
650 const std::string& name, const std::string& unit, double dimension)
651{
652 return this->_impl->create_triangles_statistical_property(name, unit, dimension);
653}
654
656 const std::string& name, const std::string& unit, double dimension)
657{
658 return this->_impl->create_vertex_triangles_instantaneous_property(name, unit, dimension);
659}
660
662 const std::string& name, const std::string& unit, double dimension)
663{
664 return this->_impl->create_vertex_triangles_statistical_property(name, unit, dimension);
665}
Definition rocky_output_collections_api.hpp:30
void update_time_curve(const std::string &owner_name, const std::string &name, double value)
Definition rocky_output_collections_api.hpp:536
void setup_particles_time_curve_dimension(const std::string &name, double dimension)
Definition rocky_output_collections_api.hpp:456
void update_geometry_time_curve(int geometry_id, const std::string &name, double value)
Definition rocky_output_collections_api.hpp:527
void setup_dataset_dimension(const std::string &owner_name, const std::string &name, double dimension)
Definition rocky_output_collections_api.hpp:447
void create_time_curve(const std::string &owner_name, const std::string &name, const std::string &unit)
Definition rocky_output_collections_api.hpp:417
void update_particles_time_curve(const std::string &name, double value)
Definition rocky_output_collections_api.hpp:518
void update_dataset(const std::string &owner_name, const std::string &name, const double *dataset, size_t size)
Definition rocky_output_collections_api.hpp:508
void setup_particles_dataset_dimension(const std::string &name, double dimension)
Definition rocky_output_collections_api.hpp:427
void update_particles_dataset(const std::string &name, const double *dataset, size_t size)
Definition rocky_output_collections_api.hpp:488
void create_particles_curve(const std::string &domain_dataset, const std::string &image_dataset)
Definition rocky_output_collections_api.hpp:374
void add_curve(const std::string &owner_name, const std::string &domain_dataset, const std::string &image_dataset)
Definition rocky_output_collections_api.hpp:392
void create_dataset(const std::string &owner_name, const std::string &name, const std::string &unit)
Definition rocky_output_collections_api.hpp:365
void create_particles_dataset(const std::string &name, const std::string &unit)
Definition rocky_output_collections_api.hpp:347
void setup_geometry_time_curve_dimension(int geometry_id, const std::string &name, double dimension)
Definition rocky_output_collections_api.hpp:466
void create_geometry_time_curve(int geometry_id, const std::string &name, const std::string &unit)
Definition rocky_output_collections_api.hpp:409
void create_geometry_dataset(int geometry_id, const std::string &name, const std::string &unit)
Definition rocky_output_collections_api.hpp:356
void setup_geometry_dataset_dimension(int geometry_id, const std::string &name, double dimension)
Definition rocky_output_collections_api.hpp:437
void setup_time_curve_dimension(const std::string &owner_name, const std::string &name, double dimension)
Definition rocky_output_collections_api.hpp:476
void create_geometry_curve(int geometry_id, const std::string &domain_dataset, const std::string &image_dataset)
Definition rocky_output_collections_api.hpp:383
void create_particles_time_curve(const std::string &name, const std::string &unit)
Definition rocky_output_collections_api.hpp:401
void update_geometry_dataset(int geometry_id, const std::string &name, const double *dataset, size_t size)
Definition rocky_output_collections_api.hpp:498
Definition rocky_output_collections_api.hpp:555
int create_particles_statistical_property(const std::string &name, const std::string &unit, double dimension=1.0)
Definition rocky_output_collections_api.hpp:637
int create_particles_instantaneous_property(const std::string &name, const std::string &unit, double dimension=1.0)
Definition rocky_output_collections_api.hpp:631
int create_triangles_instantaneous_property(const std::string &name, const std::string &unit, double dimension=1.0)
Definition rocky_output_collections_api.hpp:643
int create_triangles_statistical_property(const std::string &name, const std::string &unit, double dimension=1.0)
Definition rocky_output_collections_api.hpp:649
int create_vertex_triangles_statistical_property(const std::string &name, const std::string &unit, double dimension=1.0)
Definition rocky_output_collections_api.hpp:661
int create_vertex_triangles_instantaneous_property(const std::string &name, const std::string &unit, double dimension=1.0)
Definition rocky_output_collections_api.hpp:655

Connect with Ansys