Fixed URL for libccmio-2.6.1 (bug report #5 by Thomas Oliveira)
[foam-extend-3.2.git] / applications / solvers / solidMechanics / icoFsiElasticNonLinULSolidFoam / readCouplingProperties.H
blob26f76ed67456a02a53d8f4dbd7422d3fbaca946a
1     Info << "\nReading coupling properties" << endl;
2     IOdictionary couplingProperties
3     (
4         IOobject
5         (
6             "couplingProperties",
7             runTime.constant(),
8             mesh,
9             IOobject::MUST_READ,
10             IOobject::NO_WRITE
11         )
12     );
15     // Read solid patch data
16     word solidPatchName(couplingProperties.lookup("solidPatch"));
18     label solidPatchID
19     (
20         stressMesh.boundaryMesh().findPatchID(solidPatchName)
21     );
23     if (solidPatchID < 0)
24     {
25         FatalErrorIn(args.executable())
26             << "Problem with finding solid patch"
27                 << abort(FatalError);
28     }
30     word solidZoneName(couplingProperties.lookup("solidZone"));
32     label solidZoneID =
33         stressMesh.faceZones().findZoneID(solidZoneName);
35     if (solidZoneID < 0)
36     {
37         FatalErrorIn(args.executable())
38             << "Problem with finding solid zone"
39                 << abort(FatalError);
40     }
42 //     const label solidPatchStart =
43 //         stressMesh.boundaryMesh()[solidPatchID].start();
45 //     const faceZone& solidZone = stressMesh.faceZones()[solidZoneID];
48     // Read fluid patch data
49     word fluidPatchName(couplingProperties.lookup("fluidPatch"));
51     label fluidPatchID =
52         mesh.boundaryMesh().findPatchID(fluidPatchName);
54     if (fluidPatchID < 0)
55     {
56         FatalErrorIn(args.executable())
57             << "Problem with finding fluid patch"
58             << abort(FatalError);
59     }
61     word fluidZoneName(couplingProperties.lookup("fluidZone"));
63     label fluidZoneID =
64         mesh.faceZones().findZoneID(fluidZoneName);
66     if (fluidZoneID < 0)
67     {
68         FatalErrorIn(args.executable())
69             << "Problem with finding fluid zone"
70                 << abort(FatalError);
71     }
73 //     const label fluidPatchStart =
74 //         mesh.boundaryMesh()[fluidPatchID].start();
76 //     const faceZone& fluidZone = mesh.faceZones()[fluidZoneID];
79     // Check mesh motion solver type
80     bool feMotionSolver =
81         mesh.objectRegistry::foundObject<tetPointVectorField>
82         (
83             "motionU"
84         );
85     bool fvMotionSolver =
86         mesh.objectRegistry::foundObject<pointVectorField>
87         (
88             "pointMotionU"
89         );
92     // Grab solid patch field
93     if
94     (
95         DU.boundaryField()[solidPatchID].type()
96      != solidTractionFvPatchVectorField::typeName
97     //!= tractionDisplacementIncrementFvPatchVectorField::typeName
98     )
99     {
100         FatalErrorIn(args.executable())
101             << "Bounary condition on " << DU.name()
102                 <<  " is "
103                 << DU.boundaryField()[solidPatchID].type()
104                 << "for fluid -solid interface patch, instead "
105             << solidTractionFvPatchVectorField::typeName
106             //<< tractionDisplacementIncrementFvPatchVectorField::typeName
107                 << abort(FatalError);
108     }
110     //tractionDisplacementIncrementFvPatchVectorField& tForce =
111     //      refCast<tractionDisplacementIncrementFvPatchVectorField>
112     solidTractionFvPatchVectorField& tForce =
113         refCast<solidTractionFvPatchVectorField>
114         (
115             DU.boundaryField()[solidPatchID]
116         );
119     // Accumulated fluid interface displacement
120     IOobject accumulatedFluidInterfaceDisplacementHeader
121     (
122         "accumulatedFluidInterfaceDisplacement",
123         runTime.timeName(),
124         mesh,
125         IOobject::MUST_READ
126     );
128     vectorField* accumulatedFluidInterfaceDisplacementPtr = NULL;
130     if(accumulatedFluidInterfaceDisplacementHeader.headerOk())
131     {
132         Pout << "Reading accumulated fluid interface displacement" << endl;
134         accumulatedFluidInterfaceDisplacementPtr =
135             new vectorIOField
136             (
137                 IOobject
138                 (
139                     "accumulatedFluidInterfaceDisplacement",
140                     runTime.timeName(),
141                     mesh,
142                     IOobject::MUST_READ,
143                     IOobject::AUTO_WRITE
144                 )
145             );
146     }
147     else
148     {
149         accumulatedFluidInterfaceDisplacementPtr =
150             new vectorIOField
151             (
152                 IOobject
153                 (
154                     "accumulatedFluidInterfaceDisplacement",
155                     runTime.timeName(),
156                     mesh,
157                     IOobject::NO_READ,
158                     IOobject::AUTO_WRITE
159                 ),
160                 vectorField
161                 (
162                     mesh.boundaryMesh()[fluidPatchID].nPoints(),
163                     vector::zero
164                 )
165             );
166     }
168     vectorField& accumulatedFluidInterfaceDisplacement
169         = *accumulatedFluidInterfaceDisplacementPtr;