Example #1
0
void Filter::init() {
	_F_
	// construct the union mesh, if necessary
	Mesh *meshes[4] = {
		sln[0]->get_mesh(),
		(num >= 2) ? sln[1]->get_mesh() : NULL,
		(num >= 3) ? sln[2]->get_mesh() : NULL,
		(num >= 4) ? sln[3]->get_mesh() : NULL
	};

	mesh = meshes[0];
	unimesh = false;

	// FIXME: better detection of same meshes
	for (int i = 1; i < num; i++)
		if (meshes[0] != meshes[1]) unimesh = true;

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

	refmap->set_mesh(mesh);

	// misc init
	num_components = 1;
	memset(tables, 0, sizeof(tables));
	memset(sln_sub, 0, sizeof(sln_sub));
}
Example #2
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;
    }
Example #3
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);
}