Пример #1
0
RefMap::RefMap()
{
  quad_2d = NULL;
  num_tables = 0;
  nodes = NULL;
  cur_node = NULL;
  overflow = NULL;
  set_quad_2d(&g_quad_2d_std); // default quadrature
}
Пример #2
0
PrecalcShapeset::PrecalcShapeset(PrecalcShapeset* pss)
               : RealFunction()
{
  while (pss->is_slave())
    pss = pss->master_pss;
  master_pss = pss;
  shapeset = pss->shapeset;
  num_components = pss->num_components;
  update_max_index();
  set_quad_2d(&g_quad_2d_std);
}
Пример #3
0
PrecalcShapeset::PrecalcShapeset(Shapeset* shapeset)
               : RealFunction()
{
  assert_msg(shapeset != NULL, "Shapeset cannot be NULL.");
  this->shapeset = shapeset;
  master_pss = NULL;
  num_components = shapeset->get_num_components();
  assert(num_components == 1 || num_components == 2);
  update_max_index();
  set_quad_2d(&g_quad_2d_std);
}
Пример #4
0
    void Filter<Scalar>::init()
    {
      // construct the union mesh, if necessary
      MeshSharedPtr meshes[H2D_MAX_COMPONENTS];
      for(int i = 0; i < this->num; i++)
        meshes[i] = this->sln[i]->get_mesh();
      this->mesh = meshes[0];
      
      Solution<Scalar>* sln = dynamic_cast<Solution<Scalar>*>(this->sln[0].get());
      if (sln == nullptr)
        this->space_type = HERMES_INVALID_SPACE;
      else
        this->space_type = sln->get_space_type();
      
      unimesh = false;

      for (int i = 1; i < num; i++)

      {
        if(meshes[i] == nullptr)
        {
          this->warn("You may be initializing a Filter with Solution that is missing a Mesh.");
          throw Hermes::Exceptions::Exception("this->meshes[%d] is nullptr in Filter<Scalar>::init().", i);
        }
        if(meshes[i]->get_seq() != this->mesh->get_seq())
        {
          unimesh = true;
          break;
        }
        
        sln = dynamic_cast<Solution<Scalar>*>(this->sln[i].get());
        if(sln == nullptr || sln->get_space_type() != this->space_type)
          this->space_type = HERMES_INVALID_SPACE;
      }

      if(unimesh)
      {
        Traverse trav(this->num);
        this->mesh = MeshSharedPtr(new Mesh);
        unidata = trav.construct_union_mesh(num, meshes, this->mesh);
        trav.finish();
      }

      // misc init
      this->num_components = 1;
      this->order = 0;

      memset(sln_sub, 0, sizeof(sln_sub));
      set_quad_2d(&g_quad_2d_std);
    }
Пример #5
0
    void Filter<Scalar>::init()
    {
      // construct the union mesh, if necessary
      const Mesh* meshes[10];
      for(int i = 0; i < this->num; i++)
        meshes[i] = this->sln[i]->get_mesh();
      this->mesh = meshes[0];
      unimesh = false;

      for (int i = 1; i < num; i++)

      {
        if(meshes[i] == NULL)
        {
          this->warn("You may be initializing a Filter with Solution that is missing a Mesh.");
          throw Hermes::Exceptions::Exception("this->meshes[%d] is NULL in Filter<Scalar>::init().", i);
        }
        if(meshes[i]->get_seq() != this->mesh->get_seq())
        {
          unimesh = true;
          break;
        }
      }

      if(unimesh)
      {
        Traverse trav;
        trav.begin(num, meshes);
        this->mesh = new Mesh;
        unidata = trav.construct_union_mesh(const_cast<Hermes2D::Mesh*>(this->mesh));
        trav.finish();
      }

      // misc init
      this->num_components = 1;
      this->order = 0;

      memset(sln_sub, 0, sizeof(sln_sub));
      set_quad_2d(&g_quad_2d_std);

      this->deleteSolutions = false;
    }
Пример #6
0
void Filter::init()
{
  // construct the union mesh, if necessary
  Mesh* meshes[10];
	for(int i = 0; i < this->num; i++)
		meshes[i] = this->sln[i]->get_mesh();
  mesh = meshes[0];
  unimesh = false;

  for (int i = 1; i < num; i++)
	{
    if (meshes[i] == NULL) {
      warn("You may be initializing a Filter with Solution that is missing a Mesh.");
      error("this->meshes[%d] is NULL in Filter::init().", i);
    }
    if (meshes[i]->get_seq() != mesh->get_seq())
    {
			unimesh = true;
			break;
		}
  }

  if (unimesh)
  {
    Traverse trav;
    trav.begin(num, meshes);
    mesh = new Mesh;
    unidata = trav.construct_union_mesh(mesh);
    trav.finish();
  }

  // misc init
  num_components = 1;
  order = 0;

  for(int i = 0; i < 10; i++)
      tables[i] = new LightArray<LightArray<Node*>*>;

  memset(sln_sub, 0, sizeof(sln_sub));
  set_quad_2d(&g_quad_2d_std);
}
Пример #7
0
void Solution::init()
{
  memset(tables, 0, sizeof(tables));
  memset(elems,  0, sizeof(elems));
  memset(oldest, 0, sizeof(oldest));
  transform = true;
  type = HERMES_UNDEF;
  own_mesh = false;
  num_components = 0;
  e_last = NULL;
  exact_mult = 1.0;

  mono_coefs = NULL;
  elem_coefs[0] = elem_coefs[1] = NULL;
  elem_orders = NULL;
  dxdy_buffer = NULL;
  num_coefs = num_elems = 0;
  num_dofs = -1;

  set_quad_2d(&g_quad_2d_std);
}