CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   GGIInterpolation (

r2d2 July 16, 2009 04:18

Hi All,
I am trying to use the GGI interpolation tools to do a better job at interpolating scalar/vector fields inbetween two non-conformal patches.
I am stuck with the syntax.

Before I did,( e.g in a two mesh case setup).

label label1 = mesh1.boundaryMesh().findPatchID("patch1");
vectorField &Up1 = U1.boundaryField()[label1];

label label2 = mesh2.boundaryMesh().findPatchID("patch2");
vectorField &Up2 = U2.boundaryField()[label2];

patchToPatchInterpolation p1_to_p2

vectorField Uinterp_p1_to_P2 = p1_to_p2.faceInterpolate(Up1);
...etc (say compare with Up2...and do other stuff)

What would be the equivalent using GGIInterpolation?

It doesn´t seem to like:

GGIInterpolation p1_to_p2

vectorField Uinterp_p1_to_P2 = p1_to_p2.masterToSlave(Up1);


brent_craven January 5, 2011 17:05

Hi Radu,
Did you ever get this to work? I am trying to do something similar.


hjasak January 7, 2011 07:20

Hello Radu,

Just like in PatchToPatch, GGI has also got 2 levels:
- a template level, with the patch type as argument (capital letters)
- a typedef for patches

This allows me to do the interpolation either between stand-alone patches (which are face lists) or between boundary patches (which are slices). Thus, if you do:

ggiInterpolation p1_to_p2

vectorField Uinterp_p1_to_P2 = p1_to_p2.masterToSlave(Up1);

it will work. Watch out for lowercase.


brent_craven January 7, 2011 09:19

Thanks for the reply - that is quite useful. Thanks, Hrv!


brent_craven January 11, 2011 00:15

ggiInterpolation Problem
Hi Hrv,
There is something wrong here. In 1.6-ext I am implementing GGI interpolation (as you suggest above) in a boundary condition as follows:

const fvMesh& neighbourMesh = db().lookupObject<fvMesh>("Mesh2");
const label& neightbourPatchID = neighbourMesh.boundaryMesh().findPatchID("iPatch") ;

const fvMesh& thisMesh = db().lookupObject<fvMesh>("Mesh1");
const label& thisPatchID = thisMesh.boundaryMesh().findPatchID("iPatch");

ggiInterpolation neighbourToThisPatch

Note that if I replace "ggiInterpolation" with "patchToPatchInterpolation" it works.

I have also tried the templated form of "GGIInterpolation" with no more success. For example:

GGIInterpolation<polyPatch,polyPatch> neighbourToThisPatch

Note that this also works if I replace "GGIInterpolation" with "PatchToPatchInterpolation"

hjasak January 11, 2011 04:27

You are missing half of the arguments of the constructor - have a look at GGIInterpolation.H:

//- Construct from components
const MasterPatch& masterPatch,
const SlavePatch& slavePatch,
const tensorField& forwardT,
const tensorField& reverseT,
const vectorField& forwardSep,
const scalar masterFaceNonOverlapFaceTol = 0.0,
const scalar slaveFaceNonOverlapFaceTol = 0.0,
const bool rescaleGGIWeightingFactors = true,
const quickReject reject = AABB

or the way ggiPolyPatch does it:

// Create interpolation for zones
patchToPatchPtr_ =
new ggiZoneInterpolation
shadow().separation(), // Slave-to-master separation. Bug fix
0, // Non-overlapping face tolerances
0, // HJ, 24/Oct/2008
true, // Rescale weighting factors. Bug fix, MB.

I would have thought this is an obvious place to look (find-grep?).


Peter Müller November 14, 2011 05:44

Hello together

I try to instantiate an object of the class ggiZoneInterpolation. Until now I created a new polyPatch, called mpPolyPatch, derived from polyPatch. Inside of this mpPolyPatch I created an algorithm which is able to generate a structured mesh inside of the surrounding edges of the existing boundary patch. Based on this new vertexes and a corresponding list of faces I created an object of the class primitivePatch, called virtualPrimitivePatch.

Until here everthing works and I can see that the algorithm worked properly by using the writeVTK function and opening the two meshes with pvFoam.

I now tried to create an object of ggiZoneInterpolation with:

ggiZoneInterpolation myGgiZoneInterpolation((*this),virtualPrimitivePat ch);

But this gave me the error that there is no matching function to my call.
I'm quite new in OpenFoam. I thought ggiZoneInterpolation only needs two primitivePatches to calculate the weightings.

Thanks a lot

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