[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r5456 - in /trunk/getfem: contrib/opt_assembly/opt_asse
From: |
Yves . Renard |
Subject: |
[Getfem-commits] r5456 - in /trunk/getfem: contrib/opt_assembly/opt_assembly.cc src/getfem_generic_assembly.cc |
Date: |
Mon, 31 Oct 2016 20:14:02 -0000 |
Author: renard
Date: Mon Oct 31 21:14:01 2016
New Revision: 5456
URL: http://svn.gna.org/viewcvs/getfem?rev=5456&view=rev
Log:
small fix
Modified:
trunk/getfem/contrib/opt_assembly/opt_assembly.cc
trunk/getfem/src/getfem_generic_assembly.cc
Modified: trunk/getfem/contrib/opt_assembly/opt_assembly.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/contrib/opt_assembly/opt_assembly.cc?rev=5456&r1=5455&r2=5456&view=diff
==============================================================================
--- trunk/getfem/contrib/opt_assembly/opt_assembly.cc (original)
+++ trunk/getfem/contrib/opt_assembly/opt_assembly.cc Mon Oct 31 21:14:01 2016
@@ -256,7 +256,7 @@
bool all = false;
bool select = true;
- int only_one = 1;
+ int only_one = 8;
if (all || select || only_one == 1) {
VEC_TEST_1("Test for source term", ndofu, "u.Test_u", mim, size_type(-1),
@@ -364,8 +364,9 @@
Iu, Iu,
getfem::asm_stiffness_matrix_for_homogeneous_linear_elasticity
(K, mim2, mf_u, lambda, mu));
- MAT_TEST_2(ndofu, ndofu, "lambda*Div_Test_u*Div_Test2_u "
- "+ mu*(Grad_Test_u'+Grad_Test_u):Grad_Test2_u", mim2, Iu, Iu);
+ if (all)
+ MAT_TEST_2(ndofu, ndofu, "lambda*Div_Test_u*Div_Test2_u "
+ "+ mu*(Grad_Test_u'+Grad_Test_u):Grad_Test2_u", mim2, Iu, Iu);
// MAT_TEST_2(ndofu, ndofu,
// "lambda*((address@hidden))"
@@ -383,7 +384,7 @@
// "+ mu*(Grad_Test_u'+Grad_Test_u):Grad_Test2_u",
// mim2, Iu, Iu);
- if (N == 2 && (all || only_one == 9)) {
+ if (N == 2 && all) {
MAT_TEST_2(ndofu,ndofu,"lambda*Trace(Grad_Test_u)*Trace(Grad_Test2_u) "
"+mu*(Grad_Test_u'(:,1)"
"+Grad_Test_u(:,1)):Grad_Test2_u(:,1)"
@@ -396,7 +397,7 @@
"+mu*(Grad_Test_u'(2,:)"
"+Grad_Test_u(2,:)):Grad_Test2_u(2,:) ", mim2, Iu, Iu);
}
- if (N == 3 && (all || only_one == 10)) {
+ if (N == 3 && all) {
MAT_TEST_2(ndofu,ndofu,"lambda*Trace(Grad_Test_u)*Trace(Grad_Test2_u) "
"+mu*(Grad_Test_u'(:,1)"
"+Grad_Test_u(:,1)):Grad_Test2_u(:,1)"
@@ -416,7 +417,7 @@
}
- if (all || select || only_one == 11) {
+ if (all || select || only_one == 9) {
base_vector lambda2(ndofp, 3.0);
workspace.add_fem_constant("lambda2", mf_p, lambda2);
base_vector mu2(ndofp, 2.0);
@@ -439,7 +440,7 @@
FE_ENABLE_EXCEPT; // Enable floating point exception for Nan.
bool all = true;
- int only_one = 2;
+ int only_one = 5;
// Mesured times for
// - new assembly,
Modified: trunk/getfem/src/getfem_generic_assembly.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_generic_assembly.cc?rev=5456&r1=5455&r2=5456&view=diff
==============================================================================
--- trunk/getfem/src/getfem_generic_assembly.cc (original)
+++ trunk/getfem/src/getfem_generic_assembly.cc Mon Oct 31 21:14:01 2016
@@ -363,9 +363,11 @@
struct assembly_tensor { // The original sizes is always in t
// If copied, all the properties are taken in the copied tensor
- // If condensed, a condensed version exists
+ // If condensed, a condensed version exists
+ // for condensed tensor, resize instructions have to be adapted ...
+ // In some cases both tensor have to be adpated.
bool is_copied;
- int condensed; // 0 : no_condensed, 1 : ...
+ int condensed; // 0: not condensed, 1: base, 2: grad, 3: grad transposed,
..
base_tensor t;
assembly_tensor *tensor_copied;
std::shared_ptr<base_tensor> tensor_condensed;
@@ -473,8 +475,7 @@
inline size_type tensor_test_size() const {
size_type st = nb_test_functions();
- return (st >= 1 ? t.sizes()[0] : 1)
- * (st == 2 ? t.sizes()[1] : 1);
+ return (st >= 1 ? t.sizes()[0] : 1) * (st == 2 ? t.sizes()[1] : 1);
}
inline size_type tensor_proper_size() const
@@ -10446,6 +10447,9 @@
}
}
+ // Produce a resize instruction which is stored if no equivalent node is
+ // detected and is the mesh is not uniform.
+ pnode->t.set_to_original();
bool is_uniform = false;
if (pnode->test_function_type == 1) {
if (mf1 || mfg1)
@@ -10487,7 +10491,6 @@
else { rmi.instructions.push_back(std::move(pgai)); }
}
- // TODO : à déplacer avant les instructions d'ajustement de taille
// Optimization: detects if an equivalent node has already been compiled
pnode->t.set_to_original();
if (rmi.node_list.find(pnode->hash_value) != rmi.node_list.end()) {
@@ -10504,6 +10507,11 @@
if (sub_tree_are_equal(pnode, *it, workspace, 2)) {
// cout << "confirmed with transpose" << endl;
if (pnode->nb_test_functions() == 2) {
+ if (pgai) { // resize instruction if needed
+ if (is_uniform)
+ { pgai->exec(); }
+ else { rmi.instructions.push_back(std::move(pgai)); }
+ }
pgai = std::make_shared<ga_instruction_transpose_test>
(pnode->tensor(), (*it)->tensor());
rmi.instructions.push_back(std::move(pgai));
@@ -10519,6 +10527,12 @@
ss << " (no problem, but hash code would be adapted) " << endl;
GMM_TRACE2(ss.str());
}
+ }
+
+ if (pgai) { // resize instruction if needed and no equivalent node detected
+ if (is_uniform)
+ { pgai->exec(); }
+ else { rmi.instructions.push_back(std::move(pgai)); }
}
size_type interpolate_filter_inst = rmi.instructions.size();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r5456 - in /trunk/getfem: contrib/opt_assembly/opt_assembly.cc src/getfem_generic_assembly.cc,
Yves . Renard <=