[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r5380 - in /trunk/getfem: interface/tests/matlab/ src/
From: |
Yves . Renard |
Subject: |
[Getfem-commits] r5380 - in /trunk/getfem: interface/tests/matlab/ src/ src/getfem/ tests/ |
Date: |
Mon, 03 Oct 2016 19:36:03 -0000 |
Author: renard
Date: Mon Oct 3 21:36:02 2016
New Revision: 5380
URL: http://svn.gna.org/viewcvs/getfem?rev=5380&view=rev
Log:
small fix
Modified:
trunk/getfem/interface/tests/matlab/demo_periodic_laplacian.m
trunk/getfem/src/getfem/getfem_mesh_fem.h
trunk/getfem/src/getfem/getfem_partial_mesh_fem.h
trunk/getfem/src/getfem_generic_assembly.cc
trunk/getfem/src/getfem_mesh_fem.cc
trunk/getfem/tests/test_assembly.cc
Modified: trunk/getfem/interface/tests/matlab/demo_periodic_laplacian.m
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_periodic_laplacian.m?rev=5380&r1=5379&r2=5380&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_periodic_laplacian.m
(original)
+++ trunk/getfem/interface/tests/matlab/demo_periodic_laplacian.m Mon Oct
3 21:36:02 2016
@@ -42,7 +42,7 @@
% create a mesh_fem of for a field of dimension 1 for the multiplier
mf_lambda = gf_mesh_fem(m,1);
-% assign the Q1 fem to all convexes of the mesh_fem (only the boundary will be
used),
+% assign the Q1 fem to all elements of the mesh_fem (only the boundary will be
used),
gf_mesh_fem_set(mf_lambda,'fem',gf_fem('FEM_QK(2,1)'));
% Integration which will be used
Modified: trunk/getfem/src/getfem/getfem_mesh_fem.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_mesh_fem.h?rev=5380&r1=5379&r2=5380&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_mesh_fem.h (original)
+++ trunk/getfem/src/getfem/getfem_mesh_fem.h Mon Oct 3 21:36:02 2016
@@ -277,7 +277,7 @@
/// Return a reference to the underlying mesh.
const mesh &linked_mesh(void) const { return *linked_mesh_; }
- bool is_uniform(void) const;
+ virtual bool is_uniform(void) const;
/** Set the degree of the fem for automatic addition
* of element option. K=-1 disables the automatic addition.
Modified: trunk/getfem/src/getfem/getfem_partial_mesh_fem.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_partial_mesh_fem.h?rev=5380&r1=5379&r2=5380&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_partial_mesh_fem.h (original)
+++ trunk/getfem/src/getfem/getfem_partial_mesh_fem.h Mon Oct 3 21:36:02 2016
@@ -73,6 +73,8 @@
virtual dim_type get_qdim() const { return mf.get_qdim(); }
virtual const bgeot::multi_index &get_qdims() const
{ return mf.get_qdims(); }
+
+ virtual bool is_uniform(void) const { return mf.is_uniform(); }
virtual void set_qdim(dim_type) {
GMM_ASSERT1(false, "The Qdim of a partial_mesh_fem is the same as "
Modified: trunk/getfem/src/getfem_generic_assembly.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_generic_assembly.cc?rev=5380&r1=5379&r2=5380&view=diff
==============================================================================
--- trunk/getfem/src/getfem_generic_assembly.cc (original)
+++ trunk/getfem/src/getfem_generic_assembly.cc Mon Oct 3 21:36:02 2016
@@ -4416,7 +4416,8 @@
virtual int exec() {
GA_DEBUG_INFO("Instruction: reduction operation of size 2 optimized ");
size_type s1 = tc1.size()/2, s2 = tc2.size()/2;
- GA_DEBUG_ASSERT(t.size() == s1*s2, "Internal error");
+ GA_DEBUG_ASSERT(t.size() == s1*s2, "Internal error " << t.size()
+ << " != " << s1 << "*" << s2);
base_tensor::iterator it1=tc1.begin(), it2=tc2.begin(), it2end=it2 + s2;
for (base_tensor::iterator it = t.begin(); it != t.end(); ++it) {
@@ -9520,12 +9521,14 @@
if (mf1 || mfg1)
pgai = std::make_shared<ga_instruction_first_ind_tensor>
(pnode->t, *pctx1, pnode->qdim1, mf1, mfg1);
+ // cout << "1 : " << int(mf1->is_uniform()) << endl;
if (mf1 && mf1->is_uniform())
{ is_uniform = true; pctx1->invalid_convex_num(); }
} else if (pnode->test_function_type == 2) {
if (mf2 || mfg2)
pgai = std::make_shared<ga_instruction_first_ind_tensor>
(pnode->t, *pctx2, pnode->qdim2, mf2, mfg2);
+ // cout << "2 : " << int(mf2->is_uniform()) << endl;
if (mf2 && mf2->is_uniform())
{ is_uniform = true; pctx2->invalid_convex_num(); }
} else if (pnode->test_function_type == 3) {
@@ -9533,26 +9536,31 @@
pgai = std::make_shared<ga_instruction_two_first_ind_tensor>
(pnode->t, *pctx1, *pctx2, pnode->qdim1, mf1, mfg1,
pnode->qdim2, mf2, mfg2);
+ // cout << "3 : " << int(mf1->is_uniform()) << " : " <<
int(mf2->is_uniform()) << endl;
if (mf1 && mf1->is_uniform() && mf2 && mf2->is_uniform()) {
- is_uniform=true;
+ is_uniform = true;
pctx1->invalid_convex_num();
pctx2->invalid_convex_num();
}
} else if (mf1 || mfg1) {
pgai = std::make_shared<ga_instruction_first_ind_tensor>
(pnode->t, *pctx1, pnode->qdim1, mf1, mfg1);
+ // cout << "4 : " << int(mf1->is_uniform()) << endl;
if (mf1 && mf1->is_uniform())
- { is_uniform=true; pctx1->invalid_convex_num(); }
+ { is_uniform = true; pctx1->invalid_convex_num(); }
} else if (mf2 || mfg2) {
pgai = std::make_shared<ga_instruction_second_ind_tensor>
(pnode->t, *pctx2, pnode->qdim2, mf2, mfg2);
+ // cout << "5 : " << int(mf2->is_uniform()) << endl;
if (mf2 && mf2->is_uniform())
- { is_uniform=true; pctx2->invalid_convex_num(); }
+ { is_uniform = true; pctx2->invalid_convex_num(); }
}
}
if (pgai) {
- if (is_uniform) pgai->exec();
- else rmi.instructions.push_back(std::move(pgai));
+ // cout << "mf1 = " << mf1 << " mf2 = " << mf2 << endl;
+ if (is_uniform)
+ { pgai->exec(); /* cout << "Uniform fem " << pnode->t.size() << endl;
*/ }
+ else { rmi.instructions.push_back(std::move(pgai)); /* cout <<
"nonUniform fem " << endl; */ }
}
// Optimization: detect if an equivalent node has already been compiled
Modified: trunk/getfem/src/getfem_mesh_fem.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_mesh_fem.cc?rev=5380&r1=5379&r2=5380&view=diff
==============================================================================
--- trunk/getfem/src/getfem_mesh_fem.cc (original)
+++ trunk/getfem/src/getfem_mesh_fem.cc Mon Oct 3 21:36:02 2016
@@ -304,7 +304,7 @@
if (fe_convex.card() == 0)
{ dof_enumeration_made = true; nb_total_dof = 0; return; }
pfem first_pf = f_elems[fe_convex.first_true()];
- if (first_pf->is_on_real_element()) is_uniform_ = false;
+ if (first_pf && first_pf->is_on_real_element()) is_uniform_ = false;
// Gives the Cuthill McKee ordering to iterate on elements
const std::vector<size_type> &cmk = linked_mesh().cuthill_mckee_ordering();
Modified: trunk/getfem/tests/test_assembly.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/tests/test_assembly.cc?rev=5380&r1=5379&r2=5380&view=diff
==============================================================================
--- trunk/getfem/tests/test_assembly.cc (original)
+++ trunk/getfem/tests/test_assembly.cc Mon Oct 3 21:36:02 2016
@@ -659,7 +659,6 @@
cout << "done " << c << endl;
}
- cout << "M1 = " << M1 << endl;
if (do_old && do_new) comp_mat(M1,M2);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r5380 - in /trunk/getfem: interface/tests/matlab/ src/ src/getfem/ tests/,
Yves . Renard <=