Beispiel #1
0
// DEPRECATED
H1Space::H1Space(Mesh* mesh, BCTypes* bc_types, scalar (*bc_value_callback_by_coord)(int, double, double), Ord2 p_init, Shapeset* shapeset)
    : Space(mesh, shapeset, bc_types, bc_value_callback_by_coord, p_init)
{
  _F_
  if (shapeset == NULL) 
  {
    this->shapeset = new H1Shapeset;
    own_shapeset = true;
  }

  if (!h1_proj_ref++)
  {
    // FIXME: separate projection matrices for different shapesets
    precalculate_projection_matrix(2, h1_proj_mat, h1_chol_p);
  }
  proj_mat = h1_proj_mat;
  chol_p   = h1_chol_p;

  // set uniform poly order in elements
  if (p_init.order_h < 1 || p_init.order_v < 1) error("P_INIT must be >=  1 in an H1 space.");
  else this->set_uniform_order_internal(p_init);

  // enumerate basis functions
  this->assign_dofs();
}
Beispiel #2
0
// the following constructors are DEPRECATED.
HdivSpace::HdivSpace(Mesh* mesh, BCTypes* bc_types,
                 scalar (*bc_value_callback_by_coord)(int, double, double), int p_init, 
                 Shapeset* shapeset) : Space(mesh, shapeset, bc_types, bc_value_callback_by_coord, Ord2(p_init, p_init))
{
  if (shapeset == NULL)
  {
    this->shapeset = new HdivShapeset;
    own_shapeset = true;
  }
  if (this->shapeset->get_num_components() < 2) error("HdivSpace requires a vector shapeset.");

  if (!hdiv_proj_ref++)
  {
    precalculate_projection_matrix(0, hdiv_proj_mat, hdiv_chol_p);
  }

  proj_mat = hdiv_proj_mat;
  chol_p   = hdiv_chol_p;

  // set uniform poly order in elements
  if (p_init < 0) error("P_INIT must be >= 0 in an Hdiv space.");
  else this->set_uniform_order_internal(Ord2(p_init, p_init));

  // enumerate basis functions
  this->assign_dofs();
}
Beispiel #3
0
HcurlSpace::HcurlSpace(Mesh* mesh, Shapeset* shapeset)
          : Space(mesh, shapeset)
{
  if (shapeset->get_num_components() < 2) error("HcurlSpace requires a vector shapeset.");

  if (!hcurl_proj_ref++)
  {
    precalculate_projection_matrix(0, hcurl_proj_mat, hcurl_chol_p);
  }

  proj_mat = hcurl_proj_mat;
  chol_p   = hcurl_chol_p;
}
Beispiel #4
0
void H1Space::init(Shapeset* shapeset, Ord2 p_init)
{
  if (shapeset == NULL) 
  {
    this->shapeset = new H1Shapeset;
    own_shapeset = true;
  }

  if (!h1_proj_ref++)
  {
    // FIXME: separate projection matrices for different shapesets
    precalculate_projection_matrix(2, h1_proj_mat, h1_chol_p);
  }
  proj_mat = h1_proj_mat;
  chol_p   = h1_chol_p;

  // set uniform poly order in elements
  if (p_init.order_h < 1 || p_init.order_v < 1) error("P_INIT must be >=  1 in an H1 space.");
  else this->set_uniform_order_internal(p_init);

  // enumerate basis functions
  this->assign_dofs();
}
Beispiel #5
0
void HcurlSpace::init(Shapeset* shapeset, Ord2 p_init)
{
  if (shapeset == NULL)
  {
    this->shapeset = new HcurlShapeset;
    own_shapeset = true;
  }
  if (this->shapeset->get_num_components() < 2) error("HcurlSpace requires a vector shapeset.");

  if (!hcurl_proj_ref++)
  {
    precalculate_projection_matrix(0, hcurl_proj_mat, hcurl_chol_p);
  }

  proj_mat = hcurl_proj_mat;
  chol_p   = hcurl_chol_p;

  // set uniform poly order in elements
  if (p_init.order_h < 0 || p_init.order_v < 0) error("P_INIT must be >= 0 in an Hcurl space.");
  else this->set_uniform_order_internal(p_init, HERMES_ANY_INT);

  // enumerate basis functions
  this->assign_dofs();
}