|
[Sponsors] |
Interpolation from several volscalarfield named Y[i] |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 27, 2020, 08:25 |
Interpolation from several volscalarfield named Y[i]
|
#1 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
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 |
|
January 27, 2020, 09:58 |
|
#2 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21 |
I think you can try and make a PtrList of your interpolators which can be recalled for each element by [] operator.
|
|
January 27, 2020, 10:46 |
|
#3 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
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() ) ), |
|
January 27, 2020, 11:32 |
|
#4 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21 |
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. |
|
January 27, 2020, 12:37 |
|
#5 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Thanks Daniel. I will try the way you suggested and let you know.
Farzad |
|
January 27, 2020, 13:05 |
|
#6 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21 |
||
Tags |
ptrlist, volscalarfield list |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ and u+ values with low-Re RANS turbulence models: utility + testcase | florian_krause | OpenFOAM | 114 | August 23, 2023 06:37 |
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 |