57 const DynamicList<List<point>>& faces,
62 OBJstream
os(fileName +
".obj");
64 if (Pstream::parRun())
67 List<DynamicList<List<point>>> allProcFaces(Pstream::nProcs());
68 allProcFaces[Pstream::myProcNo()] = faces;
69 Pstream::gatherList(allProcFaces);
71 if (Pstream::master())
73 Info<<
"Writing file: " << fileName <<
endl;
75 for (
const DynamicList<List<point>>& procFaces : allProcFaces)
77 for (
const List<point>& facePts : procFaces)
79 os.write(face(
identity(facePts.size())), facePts);
86 Info<<
"Writing file: " << fileName <<
endl;
88 for (
const List<point>& facePts : faces)
90 os.write(face(
identity(facePts.size())), facePts);
98 DynamicList<List<point>>& facePts,
104 cutCellIso cutCell(
mesh,
f);
105 cutFaceIso cutFace(
mesh,
f);
109 cutCell.calcSubCell(cellI, 0.0);
111 alpha1[cellI] =
max(
min(cutCell.VolumeOfFluid(), 1), 0);
115 facePts.append(cutCell.facePoints());
122 if (
mesh.boundary()[patchi].size() > 0)
124 const label start =
mesh.boundary()[patchi].patch().start();
128 forAll(alphap, patchFacei)
130 const label facei = patchFacei + start;
131 cutFace.calcSubFace(facei, 0.0);
133 mag(cutFace.subFaceArea())/magSfp[patchFacei];
140 int main(
int argc,
char *argv[])
144 "Uses cutCellIso to create a volume fraction field from an "
154 const word
dictName(
"setAlphaFieldDict");
157 IOdictionary setAlphaFieldDict(
dictIO);
159 Info<<
"Reading " << setAlphaFieldDict.name() <<
endl;
161 const word fieldName = setAlphaFieldDict.get<word>(
"field");
162 const bool invert = setAlphaFieldDict.getOrDefault(
"invert",
false);
163 const bool writeOBJ = setAlphaFieldDict.getOrDefault(
"writeOBJ",
false);
165 Info<<
"Reading field " << fieldName <<
nl <<
endl;
181 setAlphaFieldDict.get<word>(
"type"),
192 DynamicList<List<point>> facePts;
198 isoFacesToFile(facePts, fieldName +
"0");
201 ISstream::defaultPrecision(18);
214 <<
", 1-max(alpha1): " << 1 -
gMax(
alpha)