[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Getfem-commits] please merge branch devel-tetsuo-asm_lumped_mass_ma
From: |
Yves Renard |
Subject: |
Re: [Getfem-commits] please merge branch devel-tetsuo-asm_lumped_mass_matrix |
Date: |
Tue, 8 Jan 2019 13:03:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
Dear Tetsuo,
Your contribution can of course be interesting. I hope that you are
aware that is has a limitation. This is valid only for order one
elements (lumped matrices for higher order elements are rather difficult
to build). It should be noted somewhere.
Another aspect: you implemented the lump with two loops which can be
very inefficient for large matrices. So, can you test something as the
following implementation
template<typename MAT>
inline void asm_lumped_mass_matrix_for_first_order
(const MAT &M, const mesh_im &mim, const mesh_fem &mf1,
const mesh_region &rg = mesh_region::all_convexes()) {
asm_mass_matrix(M, mim, mf1, rg);
size_type nbd = gmm::mat_ncols(M), nbr = gmm::mat_nrows(M);
GMM_ASSERT1(nbd == nbr, "mass matrix is not square");
typedef typename linalg_traits<V>::value_type>::T value_type;
std::vector<value_type> V(nbd), W(nbr);
gmm::fill(V, T(1));
gmm::mult(M, V, W);
gmm::clear(const_cast<MAT &>(M));
for (size_type i = 0; i < nbd; ++i)
(const_cast<MAT &>(M))(i,i) = W[i];
}
which should be more efficient.
Best regards,
Yves
Le 07/01/2019 à 04:55, Tetsuo Koyama a écrit :
Dear GetFEM project
P.S.
I did a test in my local and checked.
But I'm wondering where I should add test for new function.
Thank you.
Best Regard Tetsuo
2019年1月7日(月) 12:49 Tetsuo Koyama <address@hidden>:
Dear GetFEM project
I added a asm_lumped_mass_matrix which calculate lumped mass matrix by
asm_mass_matrix.
I am planning to also add lumped mass to model object to use it for
dynamic response analysis.
I would appreciate having advice and comments.
Best Regard Tetsuo
--
Yves Renard (address@hidden) tel : (33) 04.72.43.87.08
INSA-Lyon
20, rue Albert Einstein
69621 Villeurbanne Cedex, FRANCE
http://math.univ-lyon1.fr/~renard
---------