|
[Sponsors] |
May 5, 2014, 07:27 |
problem of interpolation<vector> in parallel
|
#1 |
Member
Join Date: Feb 2012
Posts: 49
Rep Power: 14 |
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) ; |
|
May 5, 2014, 07:51 |
|
#2 |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
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
__________________
When asking a question, prepare a SSCCE. |
|
May 5, 2014, 08:51 |
|
#3 | |
Member
Join Date: Feb 2012
Posts: 49
Rep Power: 14 |
Quote:
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)); |
||
May 5, 2014, 09:15 |
|
#4 |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
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"); 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...
__________________
When asking a question, prepare a SSCCE. |
|
October 6, 2022, 06:54 |
|
#5 |
New Member
Join Date: Oct 2020
Posts: 1
Rep Power: 0 |
I had the same problem,Did you solve the problem?
|
|
|
|
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 |