|
[Sponsors] |
Accessing sprayCloud functions from parcelCloud read from objectRegistry |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 26, 2022, 16:34 |
Accessing sprayCloud functions from parcelCloud read from objectRegistry
|
#1 |
Member
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10 |
Hey all,
In cloudInfo functionObject the cloud is read from the object registry as a base class parcelCloud, and some information is printed out. I want to extend this functionObject to print out more information about my cloud, which is a SprayCloud, a child class of parcelCloud. There are functions and methods defined only in the child class, and I cannot access them from the parent object. I tried dynamic casting to a SprayCloud type but it did not work. How can I access the methods and functions of a child cloud type by using the parent cloud type object I read from the objectRegistry? https://github.com/OpenFOAM/OpenFOAM...gian/cloudInfo Thanks! Bulut |
|
September 27, 2022, 12:28 |
|
#2 |
Member
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10 |
Dear all,
Quick update. Following dynamic_cast assignment did the trick: Code:
const sprayCloud& cloud = dynamic_cast<const sprayCloud&>(obr_.lookupObject<parcelCloud>(cloudName)); Bulut |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to calculate mass flow rate on patches and summation of that during the run? | immortality | OpenFOAM Post-Processing | 104 | February 16, 2021 08:46 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 10:52 |
999999 (../../src/mpsystem.c@1123):mpt_read: failed:errno = 11 | UDS_rambler | FLUENT | 2 | November 22, 2011 09:46 |
Problem in running ICEM grid in Openfoam | Tarak | OpenFOAM | 6 | September 9, 2011 17:51 |
Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 14:37 |