|
[Sponsors] |
Object inside PtrList does not update when its target does |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 14, 2020, 15:00 |
Object inside PtrList does not update when its target does
|
#1 |
Member
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 10 |
Hello Foamers,
I need help on a PtrList object, My goal is to create a solver that has the capabilities of interFoam with multiregion physics. So I convert interFoam Code:
volScalarField& alpha1(mixture.alpha1()); Code:
PtrList<volScalarField> l_alpha1(fluidRegions.size()); l_alpha1.set ( i, l_mixture[i].alpha1() ); The l_alpha1[i] does not update and both fields are thus different. Reciprocally, when I modify l_alpha1[i], l_mixture[i].alpha1() is not updated. Maybe I'm wrong, but I order to mimic the interFoam behavior, both fields are in fact one, and should behave as such? Thank you a lot for your help |
|
January 17, 2020, 15:03 |
|
#2 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Please correct me if I'm wrong, but from what I understand,
Code:
volScalarField& alpha1(mixture.alpha1()); When you write Code:
l_alpha1.set ( i, l_mixture[i].alpha1() ); |
|
January 21, 2020, 05:28 |
|
#3 | |
Member
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 10 |
Quote:
Yes, This is what happens, but as l_alpha1 is a list of pointers (PtrList), I thought that l_alpha1[i] would point to the l_mixture[i].alpha1(). Maybe it is the normal behavior, but then I don't understand the name of the structure : "PtrList"... Otherwise, is there a way to obtain l_alpha1[i] => l_mixture[i].alpha1(). Thanks a lot for your help! |
||
Tags |
mixture, pointer, pointers, ptrlist |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Instructions to install OpenFOAM-2.4.x on CentOS-6.10 | redbullah | OpenFOAM Installation | 9 | September 7, 2019 18:18 |
ParaView 3.8.0 problem on debian | Unseen | OpenFOAM Installation | 4 | August 16, 2010 11:26 |
Compilation error OF1.5-dev on Suse10.3 | darenyang | OpenFOAM Installation | 0 | April 29, 2009 05:55 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
OpenFOAM141dev linking error on IBM AIX 52 | matthias | OpenFOAM Installation | 24 | April 28, 2008 16:49 |