void Set(const std::string & ename, const T &entry, const FactoryBase* factory = NoFactory::get()) { const FactoryBase* fac = GetFactory(ename, factory); if (fac == NoFactory::get()) { // user defined data // keep data AddKeepFlag(ename, NoFactory::get(), MueLu::UserData); } needs_.Set<T>(ename, entry, fac); } // Set
void Set(const std::string& ename, const T& entry, const FactoryBase* factory = NoFactory::get()) { const FactoryBase* fac = GetFactory(ename, factory); if (fac == NoFactory::get()) { // Any data set with a NoFactory gets UserData keep flag by default AddKeepFlag(ename, NoFactory::get(), MueLu::UserData); } // Store entry only if data have been requested (or any keep flag) if (IsRequested(ename, factory) || GetKeepFlag(ename, factory) != 0) { TEUCHOS_TEST_FOR_EXCEPTION(!IsKey(factory, ename), Exceptions::RuntimeError, "" + ename + " not found in"); map_[factory][ename]->SetData(entry); } else { GetOStream(Warnings0) << "Level::Set: unable to store \"" << ename << "\" generated by factory " << factory << " on level " << toString(GetLevelID()) << ", as it has not been requested and no keep flags were set for it" << std::endl; } } // Set
//! Request to keep variable 'ename' generated by 'factory' after the setup phase. // This method is intented to be used by user drivers for printing, debugging or to keep some computed data for a next run of the setup phase. // // This method is an alias for: AddKeepFlag(ename, factory, MueLu::Keep) // See also the description of KeepEnum for more information. // // To undo a keep request, one can use: // - Delete(ename, factory) to delete the data and remove the "Keep" flag // - or RemoveKeepFlag(ename, factory, MueLu::Keep) to go back to previous condition (data are kept only if internal MueLu logic need so). // // Note: Level variables tagged using this methods are also keep on the levels built using this.Build(). // This means that is you request to keep a specific variable on a fine level, all the coarser level that are created automatically during the setup phase will also retain the same variable. void Keep(const std::string & ename, const FactoryBase* factory) { AddKeepFlag(ename, factory, MueLu::Keep); } // Note: do not add default value for input parameter 'factory'