This is an automated email from the git hooks/post-receive script. logari81 pushed a commit to branch master in repository getfem.
The following commit(s) were added to refs/heads/master by this push: new fb97892 Fix issue with internal variables and reduced fem fb97892 is described below commit fb97892482904578ebcc3043d73fdb92f91e4677 Author: Konstantinos Poulios <logar...@gmail.com> AuthorDate: Tue Dec 22 13:57:37 2020 +0100 Fix issue with internal variables and reduced fem --- interface/src/gf_model_get.cc | 17 +++++++++++++---- src/getfem_generic_assembly_workspace.cc | 20 ++++++++++---------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/interface/src/gf_model_get.cc b/interface/src/gf_model_get.cc index ed39b48..cf79d78 100644 --- a/interface/src/gf_model_get.cc +++ b/interface/src/gf_model_get.cc @@ -363,10 +363,10 @@ void gf_model_get(getfemint::mexargs_in& m_in, /*@GET ('assembly'[, @str option]) Assembly of the tangent system taking into account the terms from all bricks. `option`, if specified, should be 'build_all', - 'build_rhs', 'build_matrix'. - The default is to build the whole - tangent linear system (matrix and rhs). This function is useful - to solve your problem with you own solver. @*/ + 'build_rhs', 'build_matrix', 'build_rhs_with_internal', + 'build_matrix_condensed', 'build_all_condensed'. + The default is to build the whole tangent linear system (matrix and rhs). + This function is useful to solve your problem with you own solver. @*/ sub_command ("assembly", 0, 1, 0, 0, std::string option = "build_all"; @@ -381,6 +381,15 @@ void gf_model_get(getfemint::mexargs_in& m_in, else if (cmd_strmatch(option, "build matrix") || cmd_strmatch(option, "build_matrix")) version = getfem::model::BUILD_MATRIX; + else if (cmd_strmatch(option, "build rhs with internal") || + cmd_strmatch(option, "build_rhs_with_internal")) + version = getfem::model::BUILD_RHS_WITH_INTERNAL; + else if (cmd_strmatch(option, "build matrix condensed") || + cmd_strmatch(option, "build_matrix_condensed")) + version = getfem::model::BUILD_MATRIX_CONDENSED; + else if (cmd_strmatch(option, "build all condensed") || + cmd_strmatch(option, "build_all_condensed")) + version = getfem::model::BUILD_ALL_CONDENSED; else THROW_BADARG("bad option: " << option); md->assembly(version); ); diff --git a/src/getfem_generic_assembly_workspace.cc b/src/getfem_generic_assembly_workspace.cc index 1888af5..2fa936f 100644 --- a/src/getfem_generic_assembly_workspace.cc +++ b/src/getfem_generic_assembly_workspace.cc @@ -898,22 +898,22 @@ namespace getfem { uI2 = temporary_interval_of_variable(vname2), I1 = interval_of_variable(vname1), I2 = interval_of_variable(vname2); - if (mf1 && mf1->is_reduced() && mf2 && mf2->is_reduced()) { - model_real_sparse_matrix aux(I1.size(), uI2.size()); - model_real_row_sparse_matrix M(I1.size(), I2.size()); - gmm::mult(gmm::transposed(mf1->extension_matrix()), - gmm::sub_matrix(row_col_unreduced_K, uI1, uI2), - aux); - gmm::mult(aux, mf2->extension_matrix(), M); - gmm::add(M, gmm::sub_matrix(*K, I1, I2)); - } else if (mf1 && mf1->is_reduced()) { + if (mf1 && mf1->is_reduced()) { if (condensation && vars_vec_done.count(vname1) == 0) { gmm::mult_add(gmm::transposed(mf1->extension_matrix()), gmm::sub_vector(unreduced_V, uI1), gmm::sub_vector(*V, I1)); vars_vec_done.insert(vname1); } - if (I2.first() < nb_prim_dof) { // !is_internal_variable(vname2) + if (mf2 && mf2->is_reduced()) { + model_real_sparse_matrix aux(I1.size(), uI2.size()); + model_real_row_sparse_matrix M(I1.size(), I2.size()); + gmm::mult(gmm::transposed(mf1->extension_matrix()), + gmm::sub_matrix(row_col_unreduced_K, uI1, uI2), + aux); + gmm::mult(aux, mf2->extension_matrix(), M); + gmm::add(M, gmm::sub_matrix(*K, I1, I2)); + } else if (I2.first() < nb_prim_dof) { // !is_internal_variable(vname2) model_real_sparse_matrix M(I1.size(), I2.size()); gmm::mult(gmm::transposed(mf1->extension_matrix()), gmm::sub_matrix(row_unreduced_K, uI1, I2), M);