[Top][All Lists]

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

Re: [Getfem-users] mesh_deformation

From: Zhenghuai Guo
Subject: Re: [Getfem-users] mesh_deformation
Date: Mon, 18 Mar 2019 09:11:04 +0000

Hi Andriy,


Thank you for the advice. I am having a look at it.


In the meantime, I would like to show you what I do and hope you can help me solve one more related problem.


To get the displacement values is easy as

plain_vector U(mf_u.nb_dof());

gmm::copy(model.real_variable("u"), U);


I then get the total dof of the mesh_fem mfu by

size_type mfudof = mf_u.nb_dof();


Then I think I can get the coordinates of each dof by

for (scalar_type ndof = 0.; ndof < mfudof; ndof += 1){

                coordinate= mf_u.point_of_dof(ndof);



Then I can relate the displacement values to the geometrical coordinates, because I know which dofs corresponding to which the geometrical coordinates.


Could you please help and advise to me about the following


  1. Is the values in the vector U storing the displacement value ā€œuā€, the same order as the dofs? Say the first value in the vector U corresponds to dof 0 and the 100th value in the U corresponds to dof 99.
  2. When I do

  for (scalar_type ndof = 0.; ndof < mfudof; ndof += 1){

                coordinate= mf_u.point_of_dof(ndof);

                cout << coordinate <<endl ;


It shows that


             It appears that it show duplicated coordinates as you can see every two coordinates are the same. Is this because that the mesh is two dimension and each node has two dofs ā€“ one for x and the other for y?


  1. What is the different between dof and basic_dof? I can see there are basic_dof_on_region() and dof_on_region() for the mesh_fem mfu.


Thank you very much.


Zhenghuai Guo



From: Andriy Andreykiv <address@hidden>
Sent: Monday, March 18, 2019 7:26 PM
To: Zhenghuai Guo <address@hidden>
Cc: address@hidden
Subject: Re: [Getfem-users] mesh_deformation


Dear Zhenghuai Guo,


Probably you can try to do this with the methods from

In particular, have a look at 

Interpolation on a cloud of points:

void getfem::ga_interpolation_mti(md, expr, mti, result, extrapolation = 0, rg=mesh_region::all_convexes(), nbpoints = size_type(-1));

I assume you can create a cloud of points from a single point.


But the above is a "heavy" tool which involves interpolation. Of course if you know that you have a node in that specific location, you can extract the degrees of freedom from the displacement vector.

So, let me know what you're using it for.


Best regards,




On Sat, 16 Mar 2019 at 10:27, Zhenghuai Guo <address@hidden> wrote:

Hi Andriy,


I have calculated a displacement field u on a meshfem mfu. For some analysis, I would like to


  1. Obtain the displacement values on certain geometrical locations based on the geometrical coordinates.


Could you please advise me to how to do this?


Thank you very much


Zhenghuai Guo

reply via email to

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