MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / main

Function main

applications/test/mappedPatch/Test-MappedPatch.C:50–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48// Main program:
49
50int main(int argc, char *argv[])
51{
52 #include "addTimeOptions.H"
53 #include "setRootCase.H"
54 #include "createTime.H"
55 #include "createMesh.H"
56
57 wordList patchFieldTypes
58 (
59 mesh.boundaryMesh().size(),
60 calculatedFvPatchVectorField::typeName
61 );
62
63 forAll(mesh.boundaryMesh(), patchi)
64 {
65 if (isA<mappedPolyPatch>(mesh.boundaryMesh()[patchi]))
66 {
67 patchFieldTypes[patchi] =
68 mappedFixedValueFvPatchVectorField::typeName;
69 }
70 }
71
72 Pout<< "patchFieldTypes:" << patchFieldTypes << endl;
73
74 volVectorField cc
75 (
76 IOobject
77 (
78 "cc",
79 runTime.timeName(),
80 mesh,
81 IOobject::NO_READ,
82 IOobject::AUTO_WRITE
83 ),
84 mesh,
85 dimensionedVector("zero", dimLength, Zero),
86 patchFieldTypes
87 );
88
89 cc.primitiveFieldRef() = mesh.C().primitiveField();
90 cc.boundaryFieldRef().updateCoeffs();
91
92 forAll(cc.boundaryField(), patchi)
93 {
94 if
95 (
96 isA<mappedFixedValueFvPatchVectorField>
97 (
98 cc.boundaryField()[patchi]
99 )
100 )
101 {
102 Pout<< "Detected a mapped patch:" << patchi << endl;
103
104 OFstream str(mesh.boundaryMesh()[patchi].name() + ".obj");
105 Pout<< "Writing mapped values to " << str.name() << endl;
106
107 label vertI = 0;

Callers

nothing calls this directly

Calls 7

sizeFunction · 0.85
primitiveFieldMethod · 0.80
patchMethod · 0.80
forAllFunction · 0.50
writeOBJFunction · 0.50
boundaryFieldMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected