getfem-users
[Top][All Lists]
Advanced

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

Re: [Getfem-users] Structured mesh coordinate values


From: Yves Renard
Subject: Re: [Getfem-users] Structured mesh coordinate values
Date: Fri, 24 Sep 2010 12:46:27 +0200
User-agent: KMail/1.13.2 (Linux/2.6.32-24-server; KDE/4.4.2; x86_64; ; )


Ok, I understand now. The function wich allows to have a mesh on a unit cube 
is

void regular_unit_mesh(mesh& m, std::vector<size_type> nsubdiv,
                       bgeot::pgeometric_trans pgt, bool noised = false);


the function 

getfem::parallelepiped_regular_simplex_mesh(mymesh, 3, org, vect.begin(), 
ref.begin());

can also be used, but the array vect contains the elementary parallelepidedic 
cell. So the right call is


getfem::mesh mymesh;

bgeot::base_node org(0.0, 0.0, 0.0);
 
std::vector<bgeot::base_small_vector> vect(3);
vect[0] = bgeot::base_small_vector(0.1, 0.0, 0.0);
vect[1] = bgeot::base_small_vector(0.0, 0.1, 0.0);
vect[2] = bgeot::base_small_vector(0.0, 0.0, 0.1);

std::vector<int> ref(3); ref[0] = ref[1] = ref[2] = 10;
 
getfem::parallelepiped_regular_simplex_mesh(mymesh, 3, org, vect.begin(),
ref.begin());
 
const int numPoints = mymesh.points_index().size();
 


I will make the correction  in the documentation.

Yves.





On vendredi 24 septembre 2010, Torquil Macdonald Sørensen wrote:
> Hi! I'm not using a mesh.transformation(M), this is a complete test program
> that reproduces it (copied from the documentation):
> 
> ************************
> getfem::mesh mymesh;
> 
> bgeot::base_node org(0.0, 0.0, 0.0);
> 
> std::vector<bgeot::base_small_vector> vect(3);
> vect[0] = bgeot::base_small_vector(1.0, 0.0, 0.0);
> vect[1] = bgeot::base_small_vector(0.0, 1.0, 0.0);
> vect[2] = bgeot::base_small_vector(0.0, 0.0, 1.0);
> 
> std::vector<int> ref(3); ref[0] = ref[1] = ref[2] = 10;
> 
> getfem::parallelepiped_regular_simplex_mesh(mymesh, 3, org, vect.begin(),
> ref.begin());
> 
> const int numPoints = mymesh.points_index().size();
> 
> std::cout << mymesh.points()[numPoints-1] << std::endl;
> *************************
> 
> At the end it prints the coordinates of the last point, which I expected to
> be [1, 1, 1] since those are the limits set in 'vect', but I get:
> 
> [10, 10, 10]
> 
> I compile it with g++ 4.4.4 (no compilation warnings):
> 
> g++ Test.cpp -o Test.elf -Wall -Wextra -O3  -lgetfem
> 
> and use GetFEM++ 4.1 in the current Debian Sid OS, and a 64bit computer
> with a Intel T4400 dual core processor.
> 
> - Torquil
> 
> On 24/09/10 09:14, Yves Renard wrote:
> > Dear Torquil,
> > 
> > No, this really generates a mesh on the cube [0,1]^3. Are you sure you do
> > not have an instruction
> > 
> > mesh.transformation(M);
> > 
> > after the mesh generation  (like in tests/laplacian.cc) ?
> > 
> > On jeudi 23 septembre 2010, Torquil Macdonald Sørensen wrote:
> >> Hi!
> >> 
> >> In the "Short User Documentation" it is written that to generate a
> >> 10x10x10 mesh on the unit cube [0,1]^3, the following code would work:
> >> 
> >> getfem::mesh mymesh;
> >> bgeot::base_node org(0.0, 0.0, 0.0);
> >> std::vector<bgeot::base_small_vector>  vect(3);
> >> vect[0] = bgeot::base_small_vector(1.0, 0.0, 0.0);
> >> vect[1] = bgeot::base_small_vector(0.0, 1.0, 0.0);
> >> vect[2] = bgeot::base_small_vector(0.0, 0.0, 1.0);
> >> std::vector<int>  ref(3);
> >> ref[0] = ref[1] = ref[2] = 10;
> >> getfem::parallelepiped_regular_simplex_mesh(mymesh, 3, org,
> >> vect.begin(), ref.begin());
> >> 
> >> But when I print the coordinates of the points in this mesh, i.e.
> >> mymesh.points(), I get component values not within [0,1], but in [0,10].
> >> 
> >> Is this a mistake in the documentation, or do these values not represent
> >> the coordinates of the points (but instead "scaled coordinates")?
> >> 
> >> Thanks!
> >> Torquil
> >> 
> >> _______________________________________________
> >> Getfem-users mailing list
> >> address@hidden
> >> https://mail.gna.org/listinfo/getfem-users


-- 

  Yves Renard (address@hidden)       tel : (33) 04.72.43.87.08
  Pole de Mathematiques, INSA-Lyon             fax : (33) 04.72.43.85.29
  20, rue Albert Einstein
  69621 Villeurbanne Cedex, FRANCE
  http://math.univ-lyon1.fr/~renard

---------



reply via email to

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