[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] [getfem-commits] branch devel-logari81-internal-variabl
From: |
Konstantinos Poulios |
Subject: |
[Getfem-commits] [getfem-commits] branch devel-logari81-internal-variables updated: Fix model class for internal variable condensation |
Date: |
Sat, 01 Feb 2020 05:24:04 -0500 |
This is an automated email from the git hooks/post-receive script.
logari81 pushed a commit to branch devel-logari81-internal-variables
in repository getfem.
The following commit(s) were added to
refs/heads/devel-logari81-internal-variables by this push:
new d7d1e07 Fix model class for internal variable condensation
d7d1e07 is described below
commit d7d1e07384e555389d3c1e7cdf46bc970cf5a4de
Author: Konstantinos Poulios <address@hidden>
AuthorDate: Sat Feb 1 11:23:55 2020 +0100
Fix model class for internal variable condensation
---
src/getfem_models.cc | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/getfem_models.cc b/src/getfem_models.cc
index d509046..14e2673 100644
--- a/src/getfem_models.cc
+++ b/src/getfem_models.cc
@@ -2597,8 +2597,11 @@ namespace getfem {
if (version & BUILD_RHS) approx_external_load_ += brick.external_load;
}
- if (gmm::vect_size(full_rrhs)) { // i.e. if has_internal_variables()
+ if (version & BUILD_RHS && version & BUILD_WITH_INTERNAL) {
+ GMM_ASSERT1(gmm::vect_size(full_rrhs) > 0 && has_internal_variables(),
+ "Internal error");
gmm::sub_interval IP(0,gmm::vect_size(rrhs));
+ gmm::fill(full_rrhs, 0.);
gmm::copy(rrhs, gmm::sub_vector(full_rrhs, IP)); // TICTIC
}
@@ -2656,14 +2659,12 @@ namespace getfem {
if (with_internal) { // Condensation reads from/writes to rhs
gmm::copy(res0_distro.get(), res1_distro.get());
gmm::add(gmm::scaled(full_rrhs, scalar_type(-1)),
- res1_distro.get()); // TIC: initial value residual=-rhs
+ res1_distro.get()); // initial value residual=-rhs
(actually only the internal variables residual is needed)
workspace.set_assembled_vector(res1_distro);
workspace.set_internal_coupling_matrix(intern_mat_distro);
}
workspace.set_assembled_matrix(tangent_matrix_distro);
workspace.assembly(2, with_internal);
- if (with_internal) // TOC: diff from initial value, hack to make
OMP work
- gmm::add(full_rrhs, res1_distro.get());
) // end GETFEM_OMP_PARALLEL
} // end of res0_distro scope
else { // only BUILD_MATRIX
@@ -2672,14 +2673,12 @@ namespace getfem {
add_assignments_and_expressions_to_workspace(workspace);
if (with_internal) { // Condensation reads from/writes to rhs
gmm::copy(gmm::scaled(full_rrhs, scalar_type(-1)),
- res1_distro.get()); // TIC: initial value residual=-rhs
+ res1_distro.get()); // initial value residual=-rhs
(actually only the internal variables residual is needed)
workspace.set_assembled_vector(res1_distro);
workspace.set_internal_coupling_matrix(intern_mat_distro);
}
workspace.set_assembled_matrix(tangent_matrix_distro);
workspace.assembly(2, with_internal);
- if (with_internal) // TOC: diff from initial value, hack to make
OMP work
- gmm::add(full_rrhs, res1_distro.get());
) // end GETFEM_OMP_PARALLEL
}
} // end of tangent_matrix_distro, intern_mat_distro, res1_distro scope
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] [getfem-commits] branch devel-logari81-internal-variables updated: Fix model class for internal variable condensation,
Konstantinos Poulios <=