getfem-users
[Top][All Lists]
Advanced

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

[Getfem-users] Interpolation


From: Giovani
Subject: [Getfem-users] Interpolation
Date: Mon, 05 Mar 2007 16:35:25 -0300
User-agent: Thunderbird 1.5.0.9 (X11/20070106)

Dear getfem++ users:

I'm working on a dynamic problem that involves 2 different meshes:

Mesh "S" (for Small), whose nodes equations of movement I'm solving in a non-standard way, and

Mesh "L" (for Large), which is both coarser and larger than mesh S. The mesh S is 'inside' the mesh L. By inside I do not mean that mesh L has holes; the purpose of mesh S is to represent extra degrees of freedom of the same structure that's also represented by mesh L.

What I need to do is interpolate the accelerations from the nodes of mesh S (which are known quantities) to the nodes of mesh L. This interpolated data is used to calculate the movement of mesh L.

One important detail here is that the interpolation should be applied in a consistent way across space. That means that in regions where S and L overlap the interpolation would be applied; in places where only L exists, no interpolation should be done, and those nodes of L would have no movement.


The following piece of code is being used to achieve this

      ////////////////////////START OF CODE////////////////////////
(here comes a function that updates the data on the S_ax, S_ay and S_az vectors )

      //Declaring the matrix N that evaluates the shape functions of L
      //in the coordinates of the nodes of S:

      gmm::dense_matrix< double > N ( S_fem->nb_dof(), L_fem->nb_dof()  );
      getfem::interpolation( *L_fem, *S_fem, N);
//Now for each direction, interpolate the data from mesh S to mesh L:

       gmm::mult( gmm::transposed(N), S_ax , L_ax);
       gmm::mult( gmm::transposed(N), S_ay , L_ay);
       gmm::mult( gmm::transposed(N), S_az , L_az);

(here comes a function that uses the values in L_ax, L_ay and L_az to calculate L's movement)
      ////////////////////////END OF CODE////////////////////////

In the code, S_fem and L_fem are getfem::mesh_fem objects that are attached to the S and L meshes; S_ax is a std::vector that holds the acceleration of the nodes of the S mesh in the x direction, and so on for
the other data containers: S_ay, S_az, L_ax, L_ay, L_az.

The code compiles fine and when the simulation is executed no warnings are printed. However, it seens that somehow the interpolation gets twisted: some nodes far away from the mesh overlapping regions move (which they should not!), while some nodes inside the overlapping zone do not get any movement. I've posted a small video (4.8 MB) that shows the meshes moving in this weird way I've described; the link is this:

http://www.ifi.unicamp.br/~gfaccin/download/movie.avi

In the movie, the orange mesh is the one I call "S", and only it's nodes (which are inside the structure) are shown; the green one is the "L" mesh. Notice that even some of the outermost nodes of "L" are moving, while these same nodes neighbours stand still; it is as if the mapping matrix (N) is transfering data to the wrong places in the destination vector. If that's the case, how could I do this mapping correctly?

To make sure that the error is not somewhere else in the code, I've also tried to prescribe the acceleration of the L nodes manually and tested the program; it worked as expected in every test. Also, I'm completely sure that the original data that's interpolated (known accelerations from the S mesh) is correct. So I'm inclined to believe that somehow the problem is in this piece of code. Any ideas on what's wrong?

Thank you very much!


Best regards,

Giovani






reply via email to

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