[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Getfem-users] Interpolation
From: |
Renard Yves |
Subject: |
Re: [Getfem-users] Interpolation |
Date: |
Thu, 08 Mar 2007 20:56:55 +0100 |
User-agent: |
Internet Messaging Program (IMP) 3.2.2 |
Selon Giovani <address@hidden>:
> Yves:
>
> Thank you very much for the quick reply!
>
> I've prepared a simplified version of the program, which I've posted here:
>
> http://www.ifi.unicamp.br/~gfaccin/download/interpolation.tar.gz
>
Using a sparse matrix, the following piece of code allows to see the
correspondance between nodes of the small mesh and node of the large mesh:
gmm::row_matrix< gmm::rsvector<double> >
N( S_meshfem.nb_dof(), L_meshfem.nb_dof() );
getfem::interpolation( L_meshfem, S_meshfem, N);
for (unsigned i = 0; i < S_meshfem.nb_dof(); ++i) {
gmm::linalg_traits<gmm::rsvector<double> >::const_iterator
it = gmm::vect_const_begin(N[i]),
ite = gmm::vect_const_end(N[i]);
for (; it != ite; ++it) {
cout << "S dof " << i << " localized at " << S_meshfem.point_of_dof(i)
<< " influenced by L dof " << it.index() << " localized at "
<< L_meshfem.point_of_dof(it.index()) << endl;
}
}
I tried and the result is normal. I did not detect some correspondance between
nodes that are far away from each other.
> This version will load 2 meshes from the disk (which are also provided
> in the file) and solve their movement equations with a central
> difference scheme. The calculation's output is sent to the disk in
> opendx format, and can be viewed using an opendx program that's also
> provided in the file.
>
> I've also added the resulting movies for the default situation (happens
> if you simply compile the program and run, without changing anything),
> in avi format.
>
> One curiosity: you said that "gmm::mult( gmm::transposed(N), S_ax ,
> L_ax); is not strictly speaking an interpolation of the solution on the
> fine mesh onto the coarse mesh". If I were to build an interpolation
> matrix, which I call here "N" that strictly speaking does the
> interpolation, how should I proceed in order to do it?
the function getfem::interpolation( L_meshfem, S_meshfem, N) gives you the
matrix with allows to compute the interpolation of a solution on the large mesh
on the small mesh. i.e. gmm::mult( N, L_az , S_az) really does this
interpolation. The meaning of gmm::mult( gmm::transposed(N), S_az , L_az) is
not strictly speaking speaking an interpolation. If fact, in your case, this
operation will sum the contribution of a lot of point of the small mesh without
making a mean of this contributions. I think you would better use
getfem::interpolation( S_meshfem, L_meshfem, N). (even if there is some
warnings ... ! you can suppress the warning by invoking
dal::set_warning_level(0))
Best,
Yves.
-------------------------------------------------------------------------
Yves Renard (address@hidden) tel : (33) 04.72.43.80.11
Pole de Mathematiques, INSA de Lyon fax : (33) 04.72.43.85.29
Institut Camille Jordan - CNRS UMR 5208
20, rue Albert Einstein
69621 Villeurbanne Cedex, FRANCE
http://math.univ-lyon1.fr/~renard
-------------------------------------------------------------------------