Beispiel #1
0
void RBSCMConstruction::print_info()
{
  // Print out info that describes the current setup
  libMesh::out << std::endl << "RBSCMConstruction parameters:" << std::endl;
  libMesh::out << "system name: " << this->name() << std::endl;
  libMesh::out << "SCM Greedy tolerance: " << get_SCM_training_tolerance() << std::endl;
  if(rb_scm_eval)
  {
    libMesh::out << "A_q operators attached: " << get_rb_theta_expansion().get_n_A_terms() << std::endl;
    libMesh::out << "Number of parameters: "   << get_n_params() << std::endl;
  }
  else
  {
    libMesh::out << "RBThetaExpansion member is not set yet" << std::endl;
  }
  RBParameters::const_iterator it     = get_parameters().begin();
  RBParameters::const_iterator it_end = get_parameters().end();
  for( ; it != it_end; ++it)
  {
    std::string param_name = it->first;
    libMesh::out <<   "Parameter " << param_name
                 << ": Min = " << get_parameter_min(param_name)
                 << ", Max = " << get_parameter_max(param_name)
                 << ", value = " << get_parameters().get_value(param_name) << std::endl;
  }
  libMesh::out << "n_training_samples: " << get_n_training_samples() << std::endl;
  libMesh::out << std::endl;
}
Beispiel #2
0
bool RBParametrized::valid_params(const RBParameters& params)
{
  if(params.n_parameters() != get_n_params())
  {
    libMesh::out << "Error: Number of parameters don't match" << std::endl;
    libmesh_error();
    return false;
  }
  else
  {
    bool valid = true;
    RBParameters::const_iterator it     = params.begin();
    RBParameters::const_iterator it_end = params.end();
    for( ; it != it_end; ++it)
    {
      std::string param_name = it->first;
      valid = valid && ( (get_parameter_min(param_name) <= params.get_value(param_name)) &&
                         (params.get_value(param_name) <= get_parameter_max(param_name)) );
    }

    if(!valid && verbose_mode)
    {
      libMesh::out << "Warning: parameter is outside parameter range" << std::endl;
    }

    return valid;
  }
}