CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

what happened to pointVolInterpolation?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2011, 08:35
Default what happened to pointVolInterpolation?
  #1
New Member
 
Oskar
Join Date: May 2011
Posts: 6
Rep Power: 14
oskarb is on a distinguished road
How can I interpolate a pointScalarField to a volScalarField?

The forum thread http://www.cfd-online.com/Forums/ope...alarfield.html and http://openfoamwiki.net/index.php/PointVolInterpolation say that the pointVolInterpolation class can be used.

But I can't find pointVolInterpolation in OpenFoam 1.6.

Oskar
oskarb is offline   Reply With Quote

Old   May 19, 2011, 05:49
Default
  #2
New Member
 
Oskar
Join Date: May 2011
Posts: 6
Rep Power: 14
oskarb is on a distinguished road
As there seems to be no reply on this issue, I think I will mark pointVolInterpolation as broken for versions newer than 1.5 in http://openfoamwiki.net/index.php/Op...%28OpenFOAM%29 and http://openfoamwiki.net/index.php/Op...lInterpolation. Any objections?

I do appreciate recommendations how to replace the pointVolInterpolation functionality.

thx
Oskar
oskarb is offline   Reply With Quote

Old   May 19, 2011, 18:43
Default
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Works beautifully in 1.6-ext.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 1, 2012, 15:43
Default How does it work?
  #4
New Member
 
Jorge Meneses
Join Date: Feb 2012
Posts: 6
Rep Power: 14
Goab is on a distinguished road
Good Morning Dr. Jasak

I know it's been a while since you answered this thread, however since you've used pointVolInterpolation I'm sure you can help me.

I've been reading thoroughly pointVolInterpolation.H, pointVolInterpolation.C and pointVolInterpolate.C and, unfortunately I'm still unable to use the function. Possibly is a silly mistake due to my lack of knowledge but still is giving me a hard time.

What I'm trying to do is to interpolate a volVectorField to points, change the values with simple arithmetic and interpolate them back to a volVectorField (whether the same or a different one).

What I have this far is:
Code:
pointField alphaP = interpVolPoint.interpolate(alpha); 
point& pt = alphaP[pointI] 

forAll(alphaP, pointI)         
{             
    double px=3.0*pt.x()+15;             
    double py=2.0pt.y()+16;            
    double pz=pt.z()+14;         
}
pointField pt = pointVolInterpolation interpPointVol (mesh); 
beta = interpPointVol.interpolate(pt);
Whenever I try with this code it gives me an error, apparently it was not the right definition or use.

In an attempt to make it work, I wrote:

Code:
const pointMesh pMesh(mesh);    
const volMesh vMesh(mesh);
pointField betaP (mesh.points());

pointVolInterpolation pointToVol (pMesh,mesh);

**beta=pointToVol.interpolate(betaP);
And it seem so recognize waht I'm trynig to do, I mean, it compiles, however when I add the last line (**), it gives me an error:

Code:
no matching function for call to ‘Foam::pointVolInterpolation::interpolate(Foam::pointField&)’
simpleRBCFoam.C:180:30: note: candidates are:
pointVolInterpolation.H:142:14: note: template<class Type> void Foam::pointVolInterpolation::interpolate(const Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const
pointVolInterpolation.H:151:59: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::pointVolInterpolation::interpolate(const Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>&) const
pointVolInterpolation.H:159:59: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::pointVolInterpolation::interpolate(const Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> >&) const
make: *** [Make/linux64GccDPOpt/simpleRBCFoam.o] Error 1
I'm really sorry about bothering you with this old threat, I'm sure you have more challenging projects at hand, however, since I started to work on this field I've seen your name on many, (fantastic, by the way) articles and research, as a result, I'm sure that if there's someone who can help me is you.

Thank you very much.

Jorge.
Goab is offline   Reply With Quote

Old   June 5, 2012, 08:49
Default
  #5
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Quote:
Originally Posted by Goab View Post
What I'm trying to do is to interpolate a volVectorField to points, change the values with simple arithmetic and interpolate them back to a volVectorField (whether the same or a different one).
Hi Jorge,

pointVolInterpolation interpolates values from mesh points to mesh cell centres.

I think you should use volPointInterpolation which interpolates from cell centres to points.
You can use volPointInterpolation like this:
Code:
    // Create point mesh                                                                                                                                      
    pointMesh pMesh(mesh);

    // Create point interpolation                                                                                                                             
    volPointInterpolation pointInterpolation(mesh);

    pointVectorField pointField
      (
       IOobject
       (
        "pointDU",
        runTime.timeName(),
        mesh
        ),
       pMesh,
       dimensionedVector("zero", dimLength, vector::zero)
       );

    // Calculate mesh points displacement                                                                                                                     
    pointInterpolation.interpolate(volField, pointField);

Best regards,
Philip
bigphil is offline   Reply With Quote

Old   June 5, 2012, 09:11
Default Fantastic
  #6
New Member
 
Jorge Meneses
Join Date: Feb 2012
Posts: 6
Rep Power: 14
Goab is on a distinguished road
Hello Philip,

Thank you so much for you reply, I was getting worried.

Regarding volPointInterpolation, I agree with you, that was the first part of my problem and I had it almost solved, of course, what you sent me will help me to enhance my solution, however, my real problem is with pointVolInterpolation, as you said, to interpolate mesh points to mesh cells.

Hope you know and can help me.

Regards,
Jorge
Goab is offline   Reply With Quote

Old   September 8, 2012, 17:56
Default
  #7
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17
Arnoldinho is on a distinguished road
Hi Jorge,

I ran into the same trouble when trying to interpolate from point to volume values. As your last post is rather old, you might already have found the solution. If not, here we go:

Your "betaP" is defined as a pointField, but is has to be a pointScalarField or pointVectorField, defined in the way already described by bigphil. Then you can use it in the same way as the volume->point interpolation - although I had to use a "temporary" copy field as the solver otherwise complained about incompatible meshes.

The following snippet interpolates vol->points and back points->vol.
Code:
scalarField gP = interpolateVolToPoints.interpolate(gammaM);
gammaP.internalField() = gP;
gammaM = interpolatePointsToVol.interpolate(gammaP);
Greetings,
Arne
Arnoldinho is offline   Reply With Quote

Old   November 20, 2014, 09:53
Default
  #8
Member
 
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12
Fanfei is on a distinguished road
Quote:
Originally Posted by bigphil View Post
Hi Jorge,

pointVolInterpolation interpolates values from mesh points to mesh cell centres.

I think you should use volPointInterpolation which interpolates from cell centres to points.
You can use volPointInterpolation like this:
Code:
    // Create point mesh                                                                                                                                      
    pointMesh pMesh(mesh);

    // Create point interpolation                                                                                                                             
    volPointInterpolation pointInterpolation(mesh);

    pointVectorField pointField
      (
       IOobject
       (
        "pointDU",
        runTime.timeName(),
        mesh
        ),
       pMesh,
       dimensionedVector("zero", dimLength, vector::zero)
       );

    // Calculate mesh points displacement                                                                                                                     
    pointInterpolation.interpolate(volField, pointField);

Best regards,
Philip
Hi Philip:
I want to interpolated from face to point . when i create point mesh with
pointMesh pMesh(mesh);
the error occured as below:
pFoam.C:141:31: error: variable ‘const Foam:ointMesh pMesh’ has initializer but incomplete type
const pointMesh pMesh(mesh);
what's the matter with it?

Best regards
Fan Fei
Fanfei is offline   Reply With Quote

Old   November 24, 2014, 04:28
Default
  #9
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi Fan Fei,

You must include the pointMesh.H header file at the top of your solver in order to use it:
Code:
#include "fvCFD.H"

// put it here
#include "pointMesh.H"
However, volPointInterpolation interpolates from cell centres to points; it does not interpolate from faces to points.
You may have to write your own interpolator.

Philip
bigphil is offline   Reply With Quote

Old   November 24, 2014, 04:45
Default
  #10
Member
 
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12
Fanfei is on a distinguished road
Quote:
Originally Posted by bigphil View Post
Hi Fan Fei,

You must include the pointMesh.H header file at the top of your solver in order to use it:
Code:
#include "fvCFD.H"

// put it here
#include "pointMesh.H"
However, volPointInterpolation interpolates from cell centres to points; it does not interpolate from faces to points.
You may have to write your own interpolator.

Philip
Hi Philip
Thank you for your reply, this problem has been solved now. I use primitivePatchInterpolation for interpolated from face to point. As i set pointScalarFiled. There're some errors as
/home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/GeometricField.H: In constructor ‘Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = Foam::Vector<double>; PatchField = Foam:ointPatchField; GeoMesh = Foam:ointMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam:ointMesh]’:
/home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/GeometricField.H:304:73: error: incomplete type ‘Foam:ointPatchField<Foam::Vector<double> >’ used in nested name specifier
const word& patchFieldType=PatchField<Type>::calculatedType()
^
pFoam.C:154:5: note: when instantiating default argument for call to Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = Foam::Vector<double>; PatchField = Foam:ointPatchField; GeoMesh = Foam:ointMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam:ointMesh]
);
^
Is it lack of the pointFields.H, or some another mistake? [/SIZE]

Best regards
Fan Fei
Fanfei is offline   Reply With Quote

Old   November 24, 2014, 04:59
Default
  #11
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi Fan Fei,

Can you post your code segment that does not compile and then post the compilation error, please.

Also be careful of the format of your post; you can use
Code:
 ... code here ...
to helps make things readable, as outlined here.

Philip

Last edited by bigphil; November 24, 2014 at 05:00. Reason: Added link
bigphil is offline   Reply With Quote

Old   November 24, 2014, 06:16
Default
  #12
Member
 
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12
Fanfei is on a distinguished road
Quote:
Originally Posted by bigphil View Post
Hi Fan Fei,

Can you post your code segment that does not compile and then post the compilation error, please.

Also be careful of the format of your post; you can use
Code:
 ... code here ...
to helps make things readable, as outlined here.

Philip
Hi Philip:
Code
----------------------------------
pointMesh pMesh(mesh);
pointVectorField pointField
(
IOobject
(
"wallpoint",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
pMesh,
dimensionedVector("q_bed",sqr(dimLength)/sqr(dimTime),vector::zero)
);
-----------------------------------------------------
the error is too long, it's about 502KB, and it can't be upload.
----------------------------------
GeometricField.H: In constructor ‘Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = Foam::Vector<double>; PatchField = Foam:ointPatchField; GeoMesh = Foam:ointMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam:ointMesh]’
GeometricField.H:304:73: error: incomplete type ‘Foam:ointPatchField<Foam::Vector<double> >’ used in nested name specifier
const word& patchFieldType=PatchField<Type>::calculatedType()
-------------------------------------------------------------

Best regards
FanFei
Fanfei is offline   Reply With Quote

Old   November 26, 2014, 04:06
Default
  #13
Member
 
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12
Fanfei is on a distinguished road
Quote:
Originally Posted by Fanfei View Post
Hi Philip:
Code
----------------------------------
pointMesh pMesh(mesh);
pointVectorField pointField
(
IOobject
(
"wallpoint",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
pMesh,
dimensionedVector("q_bed",sqr(dimLength)/sqr(dimTime),vector::zero)
);
-----------------------------------------------------
the error is too long, it's about 502KB, and it can't be upload.
----------------------------------
GeometricField.H: In constructor ‘Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = Foam::Vector<double>; PatchField = Foam:ointPatchField; GeoMesh = Foam:ointMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam:ointMesh]’
GeometricField.H:304:73: error: incomplete type ‘Foam:ointPatchField<Foam::Vector<double> >’ used in nested name specifier
const word& patchFieldType=PatchField<Type>::calculatedType()
-------------------------------------------------------------

Best regards
FanFei
Hi Fomers:
The problem has solved now. it's need to added the # include "pointFields.H" after the # include "fvCFD.H".

Best Regards
Fanfei
Fanfei is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
patch: nothing happened..! sheila FLUENT 4 October 26, 2007 00:13
What happened to Nekton? jefe Main CFD Forum 0 July 31, 2005 20:39
SOS why this happened? whai FLUENT 0 June 27, 2003 11:38
What happened to Fluent??! moiami FLUENT 0 July 23, 2002 00:53
What happened to EXA Dr. Hrvoje Jasak Main CFD Forum 0 February 29, 2000 05:28


All times are GMT -4. The time now is 09:23.