void lcFaceMaximumPluginFunction::doCellCalculation(volScalarField &field) { const cellList &cl=field.mesh().cells(); const surfaceScalarField &o=original_(); forAll(field,cellI) { scalar maxVal=-1e30; const cell &c=cl[cellI]; forAll(c,i) { const label faceI=c[i]; if(faceI<field.mesh().nInternalFaces()) { maxVal=max(maxVal,o[faceI]); } else { label patchID=field.mesh().boundaryMesh().whichPatch(faceI); label startI=field.mesh().boundaryMesh()[patchID].start(); maxVal=max( maxVal, o.boundaryField()[patchID][faceI-startI] ); } } field[cellI]=maxVal; }
void facEdgeCoeffLaplacianFunctionPlugin<T,GT>::doEvaluation() { IStringStream spec(specString_); const faMesh &aMesh=dynamicCast<FaFieldValueExpressionDriver>( parentDriver() ).aMesh(); tmp<fa::laplacianScheme<T> > scheme( fa::laplacianScheme<T>::New( aMesh, spec ) ); autoPtr<resultType> pInterpol( new resultType( IOobject( "facInterpolated"+this->original_->name(), mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), const_cast<fa::laplacianScheme<T>&>(scheme()).facLaplacian(coeff_(),original_()) ) ); result().setObjectResult(pInterpol); }
void fvcGradFunctionPlugin<T>::doEvaluation() { IStringStream spec(specString_); tmp<fv::gradScheme<T> > scheme( fv::gradScheme<T>::New( mesh(), spec ) ); autoPtr<resultType> pInterpol( new resultType( IOobject( "fvcGrad"+this->original_->name(), mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), scheme().grad(original_()) ) ); result().setObjectResult(pInterpol); }
void fvcCoeffLaplacianFunctionPlugin<T,GT>::doEvaluation() { IStringStream spec(specString_); tmp<fv::laplacianScheme<T,GT> > scheme( fv::laplacianScheme<T,GT>::New( mesh(), spec ) ); autoPtr<resultType> pInterpol( new resultType( IOobject( "fvcInterpolated"+this->original_->name(), mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), const_cast<fv::laplacianScheme<T,GT>&>(scheme()).fvcLaplacian(coeff_(),original_()) ) ); result().setObjectResult(pInterpol); }
void facConvectionDivFunctionPlugin<T>::doEvaluation() { IStringStream spec(specString_); const faMesh &aMesh=dynamicCast<FaFieldValueExpressionDriver>( parentDriver() ).aMesh(); tmp<fa::convectionScheme<T> > scheme( fa::convectionScheme<T>::New( aMesh, flow_(), spec ) ); autoPtr<resultType> pInterpol( new resultType( IOobject( "facInterpolated"+this->original_->name(), mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), scheme().facDiv(flow_(),original_()) ) ); result().setObjectResult(pInterpol); }