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

problem of interpolation<vector> in parallel

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By tomislav_maric

Reply
 
LinkBack Thread Tools 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: 5
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: 259
Blog Entries: 5
Rep Power: 11
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.
__________________
Blog: sourceflux.de/blog

"The OpenFOAM Technology Primer": sourceflux.de/book

Twitter: @sourceflux_de

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: 5
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: 259
Blog Entries: 5
Rep Power: 11
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.
__________________
Blog: sourceflux.de/blog

"The OpenFOAM Technology Primer": sourceflux.de/book

Twitter: @sourceflux_de

When asking a question, prepare a SSCCE.
tomislav_maric is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 06:06
Parallel running of 3D multiphase turbulence model (unknown problem!!) MOHAMMAD67 OpenFOAM Running, Solving & CFD 5 November 11, 2011 01:12
processorWeights problem with snappyhexmesh in parallel oskar OpenFOAM Native Meshers: snappyHexMesh and Others 0 July 7, 2011 10:05
Parallel UDF problem, hello world version pilou FLUENT 0 March 10, 2011 09:20


All times are GMT -4. The time now is 05:03.