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

problem of interpolation<vector> in parallel

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By tomislav_maric

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2014, 07:27
Default problem of interpolation<vector> in parallel
  #1
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 14
ooo is on a distinguished road
Hi,

Interpolating a volVectorField to a vector, works fine in serial, but not in parallel.
Do you know what would be the solution?
Code:
dictionary interpolationDict = mesh.solutionDict().subDict("interpolationSchemes");
autoPtr<interpolation<vector> > Uinterp = interpolation<vector>::New(interpolationDict, U);
forAll (vector1, i)
vector1[i] = Uinterp->interpolate(coordinates[i], cellI) ;
Tnx
ooo is offline   Reply With Quote

Old   May 5, 2014, 07:51
Default
  #2
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Don't roll your own for loops for field operations that are already implemented in OF. 99% of the field operations, such as the surface interpolations are already parallelized.

Use the member function:

Code:
virtual tmp< GeometricField
 < Type, fvsPatchField, 
 surfaceMesh > > interpolate (const GeometricField< Type, fvPatchField, volMesh > &) const
to interpolate from one field to another. If you interpolate a volVectorField to a volVector field, it will work fine in parallel as well.
__________________
When asking a question, prepare a SSCCE.
tomislav_maric is offline   Reply With Quote

Old   May 5, 2014, 08:51
Default
  #3
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 14
ooo is on a distinguished road
Quote:
Originally Posted by tomislav_maric View Post
Don't roll your own for loops for field operations that are already implemented in OF. 99% of the field operations, such as the surface interpolations are already parallelized.

Use the member function:

Code:
virtual tmp< GeometricField
 < Type, fvsPatchField, 
 surfaceMesh > > interpolate (const GeometricField< Type, fvPatchField, volMesh > &) const
to interpolate from one field to another. If you interpolate a volVectorField to a volVector field, it will work fine in parallel as well.
Thank you for your reply.
I didn't get your point exactly, because i'm using the interpolation function of OF which is supposed to be parallelized...
If you mean merging the third and fourth line of my code to :
Code:
vector1 = Uinterp->interpolate(coordinates,mesh.findCell(coordinates));
it gives my the compilation error of "no matching function..."
ooo is offline   Reply With Quote

Old   May 5, 2014, 09:15
Default
  #4
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Np. As allways the question is what you actually want to achieve.

My answer stated that if you want to interpolate a vector field onto a vector (it was not clear if your 'vector' is a position in space to me), you should do the interpolation from one field to the other like this:
Code:
volVectorField result = fvc::interpolate(input, "schemeName");
in which case you are using the member function I mentioned before.

However, if you want to interpolate a field onto a point that is located somewhere in the cell, use cell to point interpolation (see "interpolationCellPoint.H"). This gives you a field value at some point in space.

Both should be parallel automatically. In that you are right...
ooo likes this.
__________________
When asking a question, prepare a SSCCE.
tomislav_maric is offline   Reply With Quote

Old   October 6, 2022, 06:54
Default
  #5
New Member
 
Join Date: Oct 2020
Posts: 1
Rep Power: 0
cfd-bird is on a distinguished road
I had the same problem,Did you solve the problem?
cfd-bird 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
Parallel running of 3D multiphase turbulence model (unknown problem!!) MOHAMMAD67 OpenFOAM Running, Solving & CFD 7 November 23, 2015 10:53
fluent parallel problem in win7 x64 system dunga82 FLUENT 8 April 19, 2012 20:23
problem with running in parallel dhruv OpenFOAM 3 November 25, 2011 05:06
[snappyHexMesh] processorWeights problem with snappyhexmesh in parallel oskar OpenFOAM Meshing & Mesh Conversion 0 July 7, 2011 10:05
Parallel UDF problem, hello world version pilou FLUENT 0 March 10, 2011 08:20


All times are GMT -4. The time now is 00:43.