切结边界网格命名问题
-
我想将我的边界根据边界条件的不同类型划分为不同的类型场,以便以后调用,但是现在的代码报错
const GeometricField<vector, fvPatchField, volMesh>::Boundary& uBCs = U.boundaryField(); forAll(uBCs, patchi) { if (uBCs[patchi].type() == "farField") //inlet { gSurf_.boundaryField().set ( patchi, fvsPatchField<scalar>::New ( "farField", mesh.boundary()[patchi], gSurf_ ) ); } else if (uBCs[patchi].type() == "bounceBack") //maxwellWall { gSurf_.boundaryField().set ( patchi, fvsPatchField<scalar>::New ( "bounceBack", mesh.boundary()[patchi], gSurf_ ) ); } }
错误原因是
createFields.H: In function ‘int main(int, char**)’: createFields.H:160:13: error: passing ‘const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary’ as ‘this’ argument discards qualifiers [-fpermissive] );
求解我这问题在哪啊
-
@李东岳 相关的
createField.H
volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh );
surfaceScalarField gSurf_ ( IOobject ( "gSurf", mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar ( "0", dimMass/pow3(dimLength), 0.0 ) );
应该就这些了吧