Fixed URL for libccmio-2.6.1 (bug report #5 by Thomas Oliveira)
[foam-extend-3.2.git] / applications / solvers / solidMechanics / icoFsiElasticNonLinULSolidFoam / calcFsiResidual.H
blobf85627e60a6358266a0bf732751c35a736ba339c
2     const vectorField& solidPatchDisplacement =
3         DU.boundaryField()[solidPatchID];
5     vectorField solidZoneDisplacement
6         (
7             stressMesh.faceZones()[solidZoneID]().size(),
8             vector::zero
9         );
11     const label solidPatchStart =
12         stressMesh.boundaryMesh()[solidPatchID].start();
14     forAll(solidPatchDisplacement, i)
15     {
16         solidZoneDisplacement
17         [
18             stressMesh.faceZones()[solidZoneID]
19            .whichFace(solidPatchStart + i)
20         ] =
21             solidPatchDisplacement[i];
22     }
24     // Parallel data exchange: collect displacement field on all processors
25     reduce(solidZoneDisplacement, sumOp<vectorField>());
27     vectorField fluidZoneDisplacement =
28         interpolatorSolidFluid.faceInterpolate
29         (
30             solidZoneDisplacement
31         );
33     vectorField fluidPatchDisplacement
34         (
35             mesh.boundary()[fluidPatchID].size(),
36             vector::zero
37         );
39     const label fluidPatchStart =
40         mesh.boundaryMesh()[fluidPatchID].start();
42     forAll(fluidPatchDisplacement, i)
43     {
44         fluidPatchDisplacement[i] =
45             fluidZoneDisplacement
46             [
47                 mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
48             ];
49     }
51     primitivePatchInterpolation fluidPatchInterpolator
52         (
53             mesh.boundaryMesh()[fluidPatchID]
54         );
56     solidPatchPointsDispl =
57         fluidPatchInterpolator.faceToPointInterpolate
58         (
59             fluidPatchDisplacement
60         );
62     fsiResidualOld = fsiResidual;
64     fsiResidual = solidPatchPointsDispl - fluidPatchPointsDispl;
66 //     maxFsiResidual =
67 //        gMax
68 //         (
69 //             mag(fsiResidual)
70 //            /(mag(solidPatchPointsDispl) + SMALL)
71 //         );
73 //     Info << "Maximal fsi residual: " << maxFsiResidual << endl;
75     fsiResidualNorm = ::sqrt(gSum(magSqr(fsiResidual)));
77     if (outerCorr == 1)
78     {
79         initialFsiResidualNorm = fsiResidualNorm;
80     }
82     fsiResidualNorm /= initialFsiResidualNorm + SMALL;
84     Info << "Current fsi residual norm: " << fsiResidualNorm << endl;