getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] visitor for points of a mesh region


From: CC Tsai
Subject: Re: [Getfem-users] visitor for points of a mesh region
Date: Tue, 10 Jul 2012 09:19:46 +0800

 
Dear Yves,
 
Sorry for my disturb. Right now, I can accomplish what I want by the code I in the last of the email.
 
Second, you have memtioned that do not use the copy constructor for getfem::mesh. Then, what will you suggest for the situation in my code II? I tried the code III which however has some problems.
 
sincerely
Tsai 
 
code I:
 
dal::bit_vector MeshRegion_points_index(const getfem::mesh_fem& meshFem,const getfem::mesh_im& meshIm,unsigned int rg_id)
 {
  unsigned int nb_dof=meshFem.nb_dof();
  dal::bit_vector temp;
  vector<REAL> Btemp(nb_dof);
  gmm::resize(Btemp,nb_dof);  gmm::clear(Btemp);
  getfem::generic_assembly assem;
  assem.push_mi(meshIm);
  assem.push_mf(meshFem);
  assem.push_vec(Btemp);
  assem.set("V(#1)+=comp(Base(#1))(:)");
  assem.assembly(rg_id);
  for(unsigned int i=0;i<nb_dof;i++)
   if(Btemp[i])temp[i]=true;
  return temp;
 }

code II:
 
class FemModel
{
 mesh msh; 
 mesh_fem mf;
 mesh_im mim;
 FemModel(mesh MSH,mesh_fem MF, mesh_im MIM):msh(MSH),mf(MF),min(MIM){}
}
 
code III:
 
class FemModel
{
 mesh msh; 
 mesh_fem mf;
 mesh_im mim;
 FemModel(mesh MSH,mesh_fem MF, mesh_im MIM) {
  msh.copy_from(MSH);
  mim.init_with_mesh(msh);
  mf_u.init_with_mesh(msh);
 }
}
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]