Esempio n. 1
0
ModelAlgebraic::ModelAlgebraic( std::string _theprefix,
                                          WorldComm const& _worldComm,
                                          std::string const& subPrefix,
                                          std::string const& rootRepository )
    :
    super_type( _theprefix,_worldComm,subPrefix,rootRepository),
    M_verboseSolverTimer( boption(_name="verbose_solvertimer",_prefix=this->prefix()) ),
    M_verboseSolverTimerAllProc( boption(_name="verbose_solvertimer_allproc",_prefix=this->prefix()) ),
    M_rebuildCstPartInLinearSystem( boption(_name="linearsystem-cst-update",_prefix=this->prefix()) ),
    M_useLinearJacobianInResidual( boption(_name="residual-uselinearjac",_prefix=this->prefix()) ),
    M_rebuildLinearPartInJacobian( boption(_name="jacobian-linear-update",_prefix=this->prefix()) ),
    M_rebuildCstPartInResidual(true), // not an option (just opitmisation with semi-implicit)
    M_useCstMatrix( boption(_name="use-cst-matrix",_prefix=this->prefix()) ),
    M_useCstVector( boption(_name="use-cst-vector",_prefix=this->prefix()) ),
    M_needToRebuildCstPart( false ),
    M_errorIfSolverNotConverged( boption(_name="error-if-solver-not-converged",_prefix=this->prefix()) ),
    M_printGraph( boption(_name="graph-print-python",_prefix=this->prefix()) )
{

    //-----------------------------------------------------------------------//
    //-----------------------------------------------------------------------//
    if (Environment::vm().count(prefixvm(this->prefix(),"graph-print-python-filename")))
        M_printGraphFileName = Environment::vm()[prefixvm(this->prefix(),"graph-print-python-filename")].as< std::string >();
    else
        M_printGraphFileName = this->prefix()+".graphPython.py";

}
Esempio n. 2
0
std::pair<bool,T>
getOptionIfAvalaible( std::string const& name, std::string const& prefix, std::string const& sub, std::vector<std::string> const& prefixOverwrite,
                      po::variables_map vm = Environment::vm() )
{
    bool hasOption=false;
    T res;
    std::string optctx = (sub.empty())? "": sub+"-";
    if ( vm.count( prefixvm(prefix,optctx+name) ) )
    {
        hasOption = true;
        res = option(_name=name,_prefix=prefix,_sub=sub,_vm=vm).template as<T>();
    }
    for ( std::string const& prefixAdded : prefixOverwrite )
        if ( vm.count( prefixvm(prefixAdded,optctx+name) ) )
        {
            hasOption = true;
            res = option(_name=name,_prefix=prefixAdded,_sub=sub,_vm=vm).template as<T>();
        }

    return std::make_pair(hasOption,res);
}
Esempio n. 3
0
T
getOption( std::string const& name, std::string const& prefix, std::string const& sub, std::vector<std::string> const& prefixOverwrite,
           po::variables_map vm = Environment::vm() )
{
    T res = option(_name=name,_prefix=prefix,_sub=sub,_vm=vm).template as<T>();
    std::string optctx = (sub.empty())? "": sub+"-";
    for ( std::string const& prefixAdded : prefixOverwrite )
        if ( /*Environment::vm()*/vm.count( prefixvm(prefixAdded,optctx+name) ) )
            res = option(_name=name,_prefix=prefixAdded,_sub=sub,_vm=vm).template as<T>();

    return res;
}
Esempio n. 4
0
 //@{
 ErrorBase( po::variables_map const& vm, std::string const& prefix)
     :
     M_exact( vm[prefixvm( prefix, "error.exact" )].as<std::string>() ),
     M_exact_params( vm[prefixvm( prefix, "error.params" )].as<std::string>() ),
     M_rhs( vm[prefixvm( prefix, "error.rhs" )].as<std::string>() ),
     M_rhs_computed(vm[prefixvm( prefix, "error.rhs.computed" )].as<bool>() ),
     M_convergence(vm[prefixvm( prefix, "error.convergence" )].as<bool>() ),
     M_convergence_max(vm[prefixvm( prefix, "error.convergence.steps" )].as<int>() )
 {
 }
Esempio n. 5
0
 std::string fileNameMeshPath() const { return prefixvm(this->prefix(),"ThermoDynamicsMesh.path"); }
Esempio n. 6
0
bool
ModelAlgebraic::buildMatrixPrecond() const
{
    return !( Environment::vm()[prefixvm(this->prefix(),"preconditioner.contribution")].as<std::string>() == "same_matrix" );
}