目标:与refinemesh类似,但Agglomeration是多重网格算法中对网格进行聚合也就是加粗。我想调用GAMGAgglomeration对已有网格进行聚合操作,并生成polymesh下的point、face等网格文件,最好是不覆盖原来的polymesh文件,最终能分别在旧网格和新网格上进行计算。
问题1:如何调用聚合网格的函数?
我发现application/test自带有一个Test-GAMGAgglomeration,但他只是在时间文件夹下生成一个volScalarField,没有生成实际的网格。
// Write agglomeration
{
volScalarField scalarAgglomeration
(
IOobject
(
"agglomeration",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(dimless, 0)
);
scalarField& fld = scalarAgglomeration.primitiveFieldRef();
forAll(fld, celli)
{
fld[celli] = cellToCoarse[celli];
}
if (normalise)
{
fld /= max(fld);
}
scalarAgglomeration.correctBoundaryConditions();
scalarAgglomeration.write();
}
问题2:如何生成新的polymesh文件,并且不覆盖原来的polymesh?
我在blockmesh源代码里面找write polymesh的代码,但不知道是否下面这些。
Info<< nl << "Creating polyMesh from blockMesh" << endl;
word defaultFacesName = "defaultFaces";
word defaultFacesType = emptyPolyPatch::typeName;
polyMesh mesh
(
IOobject
(
regionName,
runTime.constant(),
runTime
),
clone(blocks.points()), // could we re-use space?
blocks.cells(),
blocks.patches(),
blocks.patchNames(),
blocks.patchDicts(),
defaultFacesName,
defaultFacesType
);
在校学生,请各位前辈指导!