void Foam::fv::matrixChangeBeforeFvOption::setResidual( const fvMatrix<T>& matrix, autoPtr<GeometricField<T,fvPatchField,volMesh> >& val ) { Info << this->name() << " setting residual for " << matrix.psi().name() << " to " << this->fieldName() << endl; if(!val.valid()) { val.set( new GeometricField<T,fvPatchField,volMesh>( IOobject( this->fieldName(), matrix.psi().mesh().time().timeName(), matrix.psi().mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), matrix.psi().mesh(), dimensioned<T>( "no", matrix.dimensions()/dimVolume, pTraits<T>::zero ) ) ); } val()=this->calcResiduum(matrix); }
void CloudRepository::addCloud( autoPtr<cloud> c ) { const word &name=c->name(); if(updateableClouds_.found(name)) { FatalErrorIn("CloudRepository::addCloud") << "There is already a cloud " << name << " in the updateable clouds. I guess there is a mistake" << endl << exit(FatalError); } if(clouds_.found(name)) { WarningIn("CloudRepository::addCloud") << "Repository of clouds already has an entry " << name <<". Overwriting. Expect strange behaviour" << endl; clouds_.set( name, c.ptr() ); } else { clouds_.insert( name, c.ptr() ); } }
void CloudRepository::addUpdateableCloud( autoPtr<ReaderParticleCloud> c ) { const word &name=c->name(); if(clouds_.found(name)) { FatalErrorIn("CloudRepository::addCloud") << "There is already a cloud " << name << " in the non-updateable clouds. I guess there is a mistake" << endl << exit(FatalError); } if(updateableClouds_.found(name)) { FatalErrorIn("CloudRepository::addCloud") << "Repository of updateable clouds already has an entry " << name << ". This can't be right" << endl << exit(FatalError); } else { updateableClouds_.insert( name, c.ptr() ); } }
void Foam::expressionField::storeField( const T &data, autoPtr<T> &store ) { if(store.empty()) { store.reset( new T( IOobject( name_, obr_.time().timeName(), obr_, IOobject::NO_READ, autowrite_ ? IOobject::AUTO_WRITE : IOobject::NO_WRITE ), data ) ); } else { store()==data; } }
// transfer p1 as autoPtr void test1(autoPtr<myLib> p1) { // display name Info << nl << "name: " << p1->name() << endl; }