[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] (no subject)
From: |
Tetsuo Koyama |
Subject: |
[Getfem-commits] (no subject) |
Date: |
Mon, 8 Apr 2019 07:50:11 -0400 (EDT) |
branch: dev-tetsuo-asm_lumped_mass_matrix_for_first_order_param
commit f6e848f362a0c2df46c502688259a01761e9227d
Author: Tetsuo Koyama <address@hidden>
Date: Mon Apr 8 20:49:35 2019 +0900
Add asm_lumped_mass_matrix_for_first_order_param
---
src/getfem/getfem_assembling.h | 36 +++++++++++++++++++++++++++++-------
src/getfem_models.cc | 2 +-
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/src/getfem/getfem_assembling.h b/src/getfem/getfem_assembling.h
index 885cbdf..ecbe4ea 100644
--- a/src/getfem/getfem_assembling.h
+++ b/src/getfem/getfem_assembling.h
@@ -826,15 +826,11 @@ namespace getfem {
}
/**
- * lumped mass matrix assembly (on the whole mesh or on the specified
- * boundary)
- * @ingroup asm
+ lumped mass matrix assembly from consistent mass matrix
*/
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);
+ inline void asm_lumped_mass_matrix_for_first_order_from_consistent
+ (const MAT &M) {
size_type nbd = gmm::mat_ncols(M), nbr = gmm::mat_nrows(M);
GMM_ASSERT1(nbd == nbr, "mass matrix is not square");
typedef typename gmm::linalg_traits<MAT>::value_type T;
@@ -847,6 +843,32 @@ namespace getfem {
}
}
+ /**
+ lumped mass matrix assembly (on the whole mesh or on the specified
+ boundary)
+ @ingroup asm
+ */
+ 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);
+ asm_lumped_mass_matrix_for_first_order_from_consistent(M);
+ }
+
+ /**
+ lumped mass matrix assembly with an additional parameter
+ (on the whole mesh or on the specified boundary)
+ @ingroup asm
+ */
+ template<typename MAT, typename VECT>
+ inline void asm_lumped_mass_matrix_for_first_order_param
+ (MAT &M, const mesh_im &mim, const mesh_fem &mf_u, const mesh_fem &mf_data,
+ const VECT &F, const mesh_region &rg = mesh_region::all_convexes()) {
+ asm_mass_matrix_param(M, mim, mf_u, mf_data, F, rg);
+ asm_lumped_mass_matrix_for_first_order_from_consistent(M);
+ }
+
/**
source term (for both volumic sources and boundary (Neumann) sources).
@ingroup asm
diff --git a/src/getfem_models.cc b/src/getfem_models.cc
index 6cd0103..bd2632f 100644
--- a/src/getfem_models.cc
+++ b/src/getfem_models.cc
@@ -6356,7 +6356,7 @@ namespace getfem {
GMM_TRACE2("Lumped mass matrix assembly (please check that integration
is 1st order.)");
gmm::clear(matl[0]);
if (dl.size() && mf_rho) {
- GMM_ASSERT1(true, "Unsupported format of lumped mass brick
coefficient");
+ asm_lumped_mass_matrix_for_first_order_param(matl[0], mim, mf_u,
*mf_rho, *rho, rg);
} else {
asm_lumped_mass_matrix_for_first_order(matl[0], mim, mf_u, rg);
if (dl.size()) gmm::scale(matl[0], (*rho)[0]);