2 zoneToZoneInterpolation* interpolatorFluidSolidPtr = NULL;
3 zoneToZoneInterpolation* interpolatorSolidFluidPtr = NULL;
6 if(!interpolatorFluidSolidPtr || !interpolatorSolidFluidPtr)
8 deleteDemandDrivenData(interpolatorFluidSolidPtr);
9 deleteDemandDrivenData(interpolatorSolidFluidPtr);
11 Info << "Create fluid-to-solid and solid-to-fluid interpolators" << endl;
13 interpolatorFluidSolidPtr = new zoneToZoneInterpolation
15 mesh.faceZones()[fluidZoneID](),
16 stressMesh.faceZones()[solidZoneID](),
20 interpolatorSolidFluidPtr = new zoneToZoneInterpolation
22 stressMesh.faceZones()[solidZoneID](),
23 mesh.faceZones()[fluidZoneID](),
27 Info << "Check fluid-to-solid and solid-to-fluid interpolators" << endl;
30 vectorField fluidPatchFaceCentres =
31 vectorField(mesh.boundaryMesh()[fluidPatchID].faceCentres());
33 vectorField fluidZoneFaceCentres
35 mesh.faceZones()[fluidZoneID].size(),
40 const label fluidPatchStart =
41 mesh.boundaryMesh()[fluidPatchID].start();
43 forAll (fluidPatchFaceCentres, i)
47 mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
49 fluidPatchFaceCentres[i];
52 // Parallel data exchange: collect faceCentres field on all processors
53 reduce(fluidZoneFaceCentres, sumOp<vectorField>());
55 vectorField solidZoneFaceCentres =
56 interpolatorFluidSolidPtr->faceInterpolate
61 vectorField solidPatchFaceCentres
63 stressMesh.boundaryMesh()[solidPatchID].size(),
67 const label solidPatchStart =
68 stressMesh.boundaryMesh()[solidPatchID].start();
70 forAll(solidPatchFaceCentres, i)
72 solidPatchFaceCentres[i] =
75 stressMesh.faceZones()[solidZoneID]
76 .whichFace(solidPatchStart + i)
85 - stressMesh.boundaryMesh()[solidPatchID].faceCentres()
89 Info << "Fluid-to-solid face interpolation error: " << maxDist
96 vectorField solidPatchFaceCentres =
97 vectorField(stressMesh.boundaryMesh()[solidPatchID].faceCentres());
99 vectorField solidZoneFaceCentres
101 stressMesh.faceZones()[solidZoneID].size(),
105 const label solidPatchStart =
106 stressMesh.boundaryMesh()[solidPatchID].start();
108 forAll (solidPatchFaceCentres, i)
112 stressMesh.faceZones()[solidZoneID]
113 .whichFace(solidPatchStart + i)
115 solidPatchFaceCentres[i];
118 // Parallel data exchange: collect faceCentres field on all processors
119 reduce(solidZoneFaceCentres, sumOp<vectorField>());
121 vectorField fluidZoneFaceCentres =
122 interpolatorSolidFluidPtr->faceInterpolate
127 vectorField fluidPatchFaceCentres
129 mesh.boundaryMesh()[fluidPatchID].size(),
133 const label fluidPatchStart =
134 mesh.boundaryMesh()[fluidPatchID].start();
136 forAll(fluidPatchFaceCentres, i)
138 fluidPatchFaceCentres[i] =
141 mesh.faceZones()[fluidZoneID]
142 .whichFace(fluidPatchStart + i)
146 scalar maxDist = gMax
150 fluidPatchFaceCentres
151 - mesh.boundaryMesh()[fluidPatchID].faceCentres()
155 Info << "Solid-to-fluid face interpolation error: " << maxDist
160 zoneToZoneInterpolation& interpolatorFluidSolid =
161 *interpolatorFluidSolidPtr;
163 zoneToZoneInterpolation& interpolatorSolidFluid =
164 *interpolatorSolidFluidPtr;