# problem of interpolation<vector> in parallel

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

 May 5, 2014, 07:27 problem of interpolation in parallel #1 Member   Join Date: Feb 2012 Posts: 49 Rep Power: 5 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 > Uinterp = interpolation::New(interpolationDict, U); forAll (vector1, i) vector1[i] = Uinterp->interpolate(coordinates[i], cellI) ;``` Tnx

 May 5, 2014, 07:51 #2 Senior Member   Tomislav Maric Join Date: Mar 2009 Location: Darmstadt, Germany Posts: 259 Blog Entries: 5 Rep Power: 11 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.

May 5, 2014, 08:51
#3
Member

Join Date: Feb 2012
Posts: 49
Rep Power: 5
Quote:
 Originally Posted by tomislav_maric 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.
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..."

 May 5, 2014, 09:15 #4 Senior Member   Tomislav Maric Join Date: Mar 2009 Location: Darmstadt, Germany Posts: 259 Blog Entries: 5 Rep Power: 11 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.

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post dunga82 FLUENT 8 April 19, 2012 20:23 dhruv OpenFOAM 3 November 25, 2011 06:06 MOHAMMAD67 OpenFOAM Running, Solving & CFD 5 November 11, 2011 01:12 oskar OpenFOAM Native Meshers: snappyHexMesh and Others 0 July 7, 2011 10:05 pilou FLUENT 0 March 10, 2011 09:20

All times are GMT -4. The time now is 02:49.