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 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 Foam::seulex::extrapolate ( const label k, scalarRectangularMatrix& table, scalarField& y ) const { for (int j=k-1; j>0; j--) { for (label i=0; i<n_; i++) { table[j-1][i] = table(j, i) + coeff_(k, j)*(table(j, i) - table[j-1][i]); } } for (int i=0; i<n_; i++) { y[i] = table(0, i) + coeff_(k, 0)*(table(0, i) - y[i]); } }
Foam::seulex::seulex(const ODESystem& ode, const dictionary& dict) : ODESolver(ode, dict), jacRedo_(min(1e-4, min(relTol_))), nSeq_(iMaxx_), cpu_(iMaxx_), coeff_(iMaxx_, iMaxx_), theta_(2*jacRedo_), table_(kMaxx_, n_), dfdx_(n_), dfdy_(n_), a_(n_), pivotIndices_(n_), dxOpt_(iMaxx_), temp_(iMaxx_), y0_(n_), ySequence_(n_), scale_(n_), dy_(n_), yTemp_(n_), dydx_(n_) { // The CPU time factors for the major parts of the algorithm const scalar cpuFunc = 1, cpuJac = 5, cpuLU = 1, cpuSolve = 1; nSeq_[0] = 2; nSeq_[1] = 3; for (int i=2; i<iMaxx_; i++) { nSeq_[i] = 2*nSeq_[i-2]; } cpu_[0] = cpuJac + cpuLU + nSeq_[0]*(cpuFunc + cpuSolve); for (int k=0; k<kMaxx_; k++) { cpu_[k+1] = cpu_[k] + (nSeq_[k+1]-1)*(cpuFunc + cpuSolve) + cpuLU; } // Set the extrapolation coefficients array for (int k=0; k<iMaxx_; k++) { for (int l=0; l<k; l++) { scalar ratio = scalar(nSeq_[k])/nSeq_[l]; coeff_(k, l) = 1/(ratio - 1); } } }