Пример #1
0
void RBEIMConstruction::initialize_rb_construction()
{
  Parent::initialize_rb_construction();

  // initialize a serial vector that we will use for MeshFunction evaluations
  _ghosted_meshfunction_vector = NumericVector<Number>::build(this->comm());
  _ghosted_meshfunction_vector->init (this->n_dofs(), this->n_local_dofs(),
                                      this->get_dof_map().get_send_list(), false,
                                      GHOSTED);

  // Initialize the MeshFunction for interpolating the
  // solution vector at quadrature points
  std::vector<unsigned int> vars;
  get_all_variable_numbers(vars);
  _mesh_function = new MeshFunction(get_equation_systems(),
                                    *_ghosted_meshfunction_vector,
                                    get_dof_map(),
                                    vars);
  _mesh_function->init();

  // Load up the inner product matrix
  // We only need one matrix in this class, so we
  // can set matrix to inner_product_matrix here
  if(!single_matrix_mode)
  {
    matrix->zero();
    matrix->close();
    matrix->add(1., *inner_product_matrix);
  }
  else
  {
    assemble_inner_product_matrix(matrix);
  }

}
Пример #2
0
void RBEIMConstruction::initialize_rb_construction(bool skip_matrix_assembly,
                                                   bool skip_vector_assembly)
{
  Parent::initialize_rb_construction(skip_matrix_assembly, skip_vector_assembly);

  // initialize a serial vector that we will use for MeshFunction evaluations
  _ghosted_meshfunction_vector = NumericVector<Number>::build(this->comm());
  _ghosted_meshfunction_vector->init (this->n_dofs(), this->n_local_dofs(),
                                      this->get_dof_map().get_send_list(), false,
                                      GHOSTED);

  // Initialize the MeshFunction for interpolating the
  // solution vector at quadrature points
  std::vector<unsigned int> vars;
  get_all_variable_numbers(vars);
  _mesh_function = new MeshFunction(get_equation_systems(),
                                    *_ghosted_meshfunction_vector,
                                    get_dof_map(),
                                    vars);
  _mesh_function->init();

  // inner_product_solver performs solves with the same matrix every time
  // hence we can set reuse_preconditioner(true).
  inner_product_solver->reuse_preconditioner(true);
}