|
[Sponsors] |
April 16, 2018, 16:33 |
protected scalarList
|
#1 |
Member
Joaquín Neira
Join Date: Oct 2017
Posts: 38
Rep Power: 9 |
Hello, I'm trying to add a new member to KinematicParcel class of type List<scalar> to store all (or a defined number) the previous dt.
for this, I added, in file KinematicParcel.H: Code:
... protected: //- dt storage [s] List<scalar> dtList_; public: //- Return const access to the dtList inline List<scalar> dtList() const; //- Return access to the dtList inline List<scalar>& dtList(); ... Code:
... template<class ParcelType> inline Foam::List<Foam::scalar> Foam::KinematicParcel<ParcelType>::dtList() const { return dtList_; } template<class ParcelType> inline Foam::List<Foam::scalar>& Foam::KinematicParcel<ParcelType>::dtList() { return dtList_; } ... Code:
... if (p.onBoundaryFace() && td.keepParticle) { if (isA<processorPolyPatch>(pbMesh[p.patch()])) { td.switchProcessor = true; std::cout << "cambio de procesador" << std::endl; } } p.age() += dt; p.dtList().append(dt); td.cloud().functions().postMove(p, celli, dt, start, td.keepParticle); } return td.keepParticle; ... How should I include dtList in the constructors so that it works as I expect and doesn't reset and crash when running in parallel? Also, how can I set a fixed sized based on variable NB (shown on files attached)? thank you! |
|
Tags |
list, parallel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Failure to start from latest time when BC stores scalarlist | Phicau | OpenFOAM Bugs | 4 | April 13, 2023 05:19 |
[snappyHexMesh] snappyHexMesh <-> dynamicMeshDict problem with protected cells | Billy_16 | OpenFOAM Meshing & Mesh Conversion | 2 | November 21, 2020 04:34 |
defining a protected variable blows the solution | anishtain4 | OpenFOAM Programming & Development | 1 | June 28, 2016 15:39 |
Combining 2 scalarList into scalarListList? | CKH | OpenFOAM Programming & Development | 1 | May 30, 2013 10:39 |