|
[Sponsors] |
Interpolation from several volscalarfield named Y[i] |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 169
Rep Power: 5 ![]() |
Dear friends
I have defined several volScalarField as below; Code:
label N = 2; PtrList<volScalarField> Y(N); Code:
UInterp_ ( interpolation<vector>::New ( cloud.solution().interpolationSchemes(), cloud.U() ) ), Thanks, Farzad |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 19 ![]() |
I think you can try and make a PtrList of your interpolators which can be recalled for each element by [] operator.
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 169
Rep Power: 5 ![]() |
Thank you for your response dear Daniel. So what are you saying is this(could you please confirm that);
Code:
YiInterp_[1] ( interpolation<scalar>::New //scalarField ( cloud.solution().interpolationSchemes(), cloud.Yi() ) ), Code:
YiInterp_[2] ( interpolation<scalar>::New //scalarField ( cloud.solution().interpolationSchemes(), cloud.Yi() ) ), |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 19 ![]() |
Well I'm writing this on the fly without knowing what your trying to do exactly, it seems that you are trying to implement this at constructor level:
1- You can create a PtrList without knowing its size and elements by using the null constructor provided by class PtrList. step #1 Initialize your list with null constructor at initializer list level as follow: Code:
YiInterp_() Code:
YiInterp_(list_size_here) Now inside the constructor body just loop over the element, but if you have used the null constructor you need to set a size before starting to access elements: Code:
YiInterp_.setSize(list_size_here); // skip this if you have set the size before forAll(YiInterp_, i) { YiInterp_.set ( i, interpolation<scalar>::New ( cloud.solution().interpolationSchemes(), cloud.Yi()[i] ) ); } Last edited by Daniel_Khazaei; January 27, 2020 at 13:03. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 169
Rep Power: 5 ![]() |
Thanks Daniel. I will try the way you suggested and let you know.
Farzad |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 19 ![]() |
||
![]() |
![]() |
![]() |
Tags |
ptrlist, volscalarfield list |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ and u+ values with low-Re RANS turbulence models: utility + testcase | florian_krause | OpenFOAM | 113 | June 25, 2019 01:58 |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 12:39 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 07:16 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |