getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] [getfem-commits] branch master updated: preparing 5.4 r


From: Yves Renard
Subject: [Getfem-commits] [getfem-commits] branch master updated: preparing 5.4 release : cleaning and file update
Date: Sun, 19 Apr 2020 13:49:29 -0400

This is an automated email from the git hooks/post-receive script.

renard pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
     new c6b43b9  preparing 5.4 release : cleaning and  file update
c6b43b9 is described below

commit c6b43b9c90d9605c1d39a7dcc310daf66fafab34
Author: Yves Renard <address@hidden>
AuthorDate: Sun Apr 19 17:30:44 2020 +0200

    preparing 5.4 release : cleaning and  file update
---
 configure.ac                                       |  4 +-
 doc/sphinx/Makefile.am                             | 10 ++--
 doc/sphinx/source/.templates/indexcontent.html     |  2 +-
 doc/sphinx/source/whatsnew/5.4.rst                 | 25 ++++++++
 doc/sphinx/source/whatsnew/index.rst               |  1 +
 src/getfem/bgeot_kdtree.h                          |  1 -
 src/getfem/bgeot_tensor.h                          | 66 +++++++++++-----------
 ...fem_generic_assembly_functions_and_operators.cc |  9 ++-
 src/gmm/gmm_real_part.h                            |  2 -
 src/gmm/gmm_sub_vector.h                           |  2 -
 src/gmm/gmm_vector.h                               |  5 +-
 11 files changed, 77 insertions(+), 50 deletions(-)

diff --git a/configure.ac b/configure.ac
index 10310f2..37d561a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,9 +27,9 @@ dnl thus, updating cache ./config.cache avoided.
 define([AC_CACHE_LOAD], )dnl
 define([AC_CACHE_SAVE], )dnl
 
-AC_INIT(getfem, 5.3)
+AC_INIT(getfem, 5.4)
 MAJOR_VERSION="5"
-MINOR_VERSION="3"
+MINOR_VERSION="4"
 PATCH_VERSION=""
 
 AC_CONFIG_SRCDIR([install-sh])
diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am
index 971849f..4ce76dc 100644
--- a/doc/sphinx/Makefile.am
+++ b/doc/sphinx/Makefile.am
@@ -137,11 +137,11 @@ gettext:
 clean:
        -rm -rf build/
        -rm -rf html/
-       -cd $(srcdir)/source/userdoc/images/; make clean
-       -cd $(srcdir)/source/project/images/; make clean
-       -cd $(srcdir)/source/matlab/images/; make clean
-       -cd $(srcdir)/source/python/images/; make clean
-       -cd $(srcdir)/source/scilab/images/; make clean
+       -cd $(srcdir)/source/userdoc/images/ && make clean
+       -cd $(srcdir)/source/project/images/ && make clean
+       -cd $(srcdir)/source/matlab/images/ && make clean
+       -cd $(srcdir)/source/python/images/ && make clean
+       -cd $(srcdir)/source/scilab/images/ && make clean
        -rm -f $(srcdir)/source/matlab/cmdref.rst
        -rm -f $(srcdir)/source/scilab/cmdref.rst
        -rm -f $(srcdir)/source/python/cmdref.rst
diff --git a/doc/sphinx/source/.templates/indexcontent.html 
b/doc/sphinx/source/.templates/indexcontent.html
index 188810d..f483928 100644
--- a/doc/sphinx/source/.templates/indexcontent.html
+++ b/doc/sphinx/source/.templates/indexcontent.html
@@ -8,7 +8,7 @@
 <div style="text-align:center;"><img src="{{ pathto('_static/logogetfem.png', 
1) }}" alt="the GetFEM logo"><br/> An open-source finite element library </div>
 <br/><br/>
 
-<p><strong>NEW</strong> (June 2018): Version 5.3 has been released.<br/></p>
+<p><strong>NEW</strong> (June 2020): Version 5.4 has been released.<br/></p>
 
 <p>Thank you for citing <a class="biglink" 
href="https://hal.archives-ouvertes.fr/hal-02532422/document";> [GetFEM2020]</a> 
in scientific work using GetFEM.<br/></p>
 
diff --git a/doc/sphinx/source/whatsnew/5.4.rst 
b/doc/sphinx/source/whatsnew/5.4.rst
new file mode 100644
index 0000000..54b8e66
--- /dev/null
+++ b/doc/sphinx/source/whatsnew/5.4.rst
@@ -0,0 +1,25 @@
+.. include:: ../replaces.txt
+
+************************
+  What's New in |gf| 5.4
+************************
+
+The main contribution of this version is the extension of the language 
allowing macro definition and explicit differentiation.
+
+Released version, 2020/06/01.
+
+The main changes are:
+
+   * A support for variables defined at integration points 
+
+   * A full support for the automatic condensation of variables determined by 
local equations (for instance for plasticity) (Konstantinos Poulios 
contribution)
+
+   * A fully working Octave interface. Many thanks to Abderrahmane Bendali for 
the first adaptation of this interface from Matlab's one.
+
+   * The use of Python 3 instead of Python 2.7 by default
+
+   * A support for HHO methods
+   
+   * A support for the the assembly of product of terms defined on two 
different domains (integration on the product of two domains with a kernel, for 
instance).
+   
+
diff --git a/doc/sphinx/source/whatsnew/index.rst 
b/doc/sphinx/source/whatsnew/index.rst
index 814c363..ad5a299 100644
--- a/doc/sphinx/source/whatsnew/index.rst
+++ b/doc/sphinx/source/whatsnew/index.rst
@@ -11,6 +11,7 @@ for anyone wishing to stay up-to-date after a new release.
 .. toctree::
    :maxdepth: 2
 
+   5.4.rst
    5.3.rst
    5.2.rst
    5.1.rst
diff --git a/src/getfem/bgeot_kdtree.h b/src/getfem/bgeot_kdtree.h
index 97912aa..a89e3f1 100644
--- a/src/getfem/bgeot_kdtree.h
+++ b/src/getfem/bgeot_kdtree.h
@@ -60,7 +60,6 @@ namespace bgeot {
     size_type i;
     base_node n;
     index_node_pair() {}
-    index_node_pair(const index_node_pair& o) : i(o.i), n(o.n) {}
     index_node_pair(size_type i_, base_node n_) : i(i_), n(n_) {}
     void swap(index_node_pair& other) { std::swap(i,other.i); n.swap(other.n);}
   };
diff --git a/src/getfem/bgeot_tensor.h b/src/getfem/bgeot_tensor.h
index 80a6f3b..b5e2821 100644
--- a/src/getfem/bgeot_tensor.h
+++ b/src/getfem/bgeot_tensor.h
@@ -118,7 +118,8 @@ namespace bgeot {
   template<class T> class tensor : public std::vector<T> {
     protected:
 
-    multi_index sizes_, coeff;
+    multi_index sizes_;
+    multi_index coeff_;
 
     public:
 
@@ -128,7 +129,7 @@ namespace bgeot {
 
     template<class CONT> inline const T& operator ()(const CONT &c) const {
       typename CONT::const_iterator it = c.begin();
-      multi_index::const_iterator q = coeff.begin(), e = coeff.end();
+      multi_index::const_iterator q = coeff_.begin(), e = coeff_.end();
 #ifndef NDEBUG
       multi_index::const_iterator qv = sizes_.begin();
 #endif
@@ -143,21 +144,21 @@ namespace bgeot {
     inline T& operator ()(size_type i, size_type j, size_type k,
                           size_type l) {
       GMM_ASSERT2(order() == 4, "Bad tensor order.");
-      size_type d = coeff[0]*i + coeff[1]*j + coeff[2]*k + coeff[3]*l;
+      size_type d = coeff_[0]*i + coeff_[1]*j + coeff_[2]*k + coeff_[3]*l;
       GMM_ASSERT2(d < size(), "Index out of range.");
       return *(this->begin() + d);
     }
 
     inline T& operator ()(size_type i, size_type j, size_type k) {
       GMM_ASSERT2(order() == 3, "Bad tensor order.");
-      size_type d = coeff[0]*i + coeff[1]*j + coeff[2]*k;
+      size_type d = coeff_[0]*i + coeff_[1]*j + coeff_[2]*k;
       GMM_ASSERT2(d < size(), "Index out of range.");
       return *(this->begin() + d);
     }
 
     inline T& operator ()(size_type i, size_type j) {
       GMM_ASSERT2(order() == 2, "Bad tensor order");
-        size_type d = coeff[0]*i + coeff[1]*j;
+        size_type d = coeff_[0]*i + coeff_[1]*j;
         GMM_ASSERT2(d < size(), "Index out of range.");
         return *(this->begin() + d);
     }
@@ -165,7 +166,7 @@ namespace bgeot {
     inline const T& operator ()(size_type i, size_type j, size_type k,
                                 size_type l) const {
       GMM_ASSERT2(order() == 4, "Bad tensor order.");
-      size_type d = coeff[0]*i + coeff[1]*j + coeff[2]*k + coeff[3]*l;
+      size_type d = coeff_[0]*i + coeff_[1]*j + coeff_[2]*k + coeff_[3]*l;
       GMM_ASSERT2(d < size(), "Index out of range.");
       return *(this->begin() + d);
     }
@@ -173,21 +174,21 @@ namespace bgeot {
     inline const T& operator ()(size_type i, size_type j,
                                 size_type k) const {
       GMM_ASSERT2(order() == 3, "Bad tensor order.");
-      size_type d = coeff[0]*i + coeff[1]*j + coeff[2]*k;
+      size_type d = coeff_[0]*i + coeff_[1]*j + coeff_[2]*k;
       GMM_ASSERT2(d < size(), "Index out of range.");
       return *(this->begin() + d);
     }
 
     inline const T& operator ()(size_type i, size_type j) const {
       GMM_ASSERT2(order() == 2, "Bad tensor order.");
-      size_type d = coeff[0]*i + coeff[1]*j;
+      size_type d = coeff_[0]*i + coeff_[1]*j;
       GMM_ASSERT2(d < size(), "Index out of range.");
       return *(this->begin() + d);
     }
 
     template<class CONT> inline T& operator ()(const CONT &c) {
       typename CONT::const_iterator it = c.begin();
-      multi_index::iterator q = coeff.begin(), e = coeff.end();
+      multi_index::iterator q = coeff_.begin(), e = coeff_.end();
       size_type d = 0;
       for ( ; q != e; ++q, ++it) d += (*q) * (*it);
       GMM_ASSERT2(d < size(), "Index out of range.");
@@ -202,36 +203,36 @@ namespace bgeot {
     void init(const multi_index &c) {
       auto it = c.begin();
       size_type d = 1;
-      sizes_ = c; coeff.resize(c.size());
-      auto p = coeff.begin(), pe = coeff.end();
+      sizes_ = c; coeff_.resize(c.size());
+      auto p = coeff_.begin(), pe = coeff_.end();
       for ( ; p != pe; ++p, ++it) { *p = d; d *= *it; }
       this->resize(d);
     }
 
-    inline void init() { sizes_.resize(0);  coeff.resize(0); this->resize(1); }
+    inline void init() { sizes_.resize(0); coeff_.resize(0); this->resize(1); }
 
     inline void init(size_type i) {
-      sizes_.resize(1); sizes_[0] = i; coeff.resize(1); coeff[0] = 1;
+      sizes_.resize(1); sizes_[0] = i; coeff_.resize(1); coeff_[0] = 1;
       this->resize(i);
     }
 
     inline void init(size_type i, size_type j) {
       sizes_.resize(2); sizes_[0] = i; sizes_[1] = j;
-      coeff.resize(2); coeff[0] = 1; coeff[1] = i;
+      coeff_.resize(2); coeff_[0] = 1; coeff_[1] = i;
       this->resize(i*j);
     }
 
     inline void init(size_type i, size_type j, size_type k) {
       sizes_.resize(3); sizes_[0] = i; sizes_[1] = j; sizes_[2] = k; 
-      coeff.resize(3); coeff[0] = 1; coeff[1] = i; coeff[2] = i*j;
+      coeff_.resize(3); coeff_[0] = 1; coeff_[1] = i; coeff_[2] = i*j;
       this->resize(i*j*k);
     }
 
     inline void init(size_type i, size_type j, size_type k, size_type l) {
       sizes_.resize(4);
       sizes_[0] = i; sizes_[1] = j; sizes_[2] = k; sizes_[3] = k; 
-      coeff.resize(4);
-      coeff[0] = 1; coeff[1] = i; coeff[2] = i*j; coeff[3] = i*j*k;
+      coeff_.resize(4);
+      coeff_[0] = 1; coeff_[1] = i; coeff_[2] = i*j; coeff_[3] = i*j*k;
       this->resize(i*j*k*l);
     }
 
@@ -246,11 +247,11 @@ namespace bgeot {
     
     inline size_type adjust_sizes_changing_last(const tensor &t, size_type P) {
       const multi_index &mi = t.sizes_; size_type d = mi.size();
-      sizes_.resize(d); coeff.resize(d);
+      sizes_.resize(d); coeff_.resize(d);
       if (d) {
        std::copy(mi.begin(), mi.end(), sizes_.begin());
-       std::copy(t.coeff.begin(), t.coeff.end(), coeff.begin());
-       size_type e = coeff.back();
+       std::copy(t.coeff_.begin(), t.coeff_.end(), coeff_.begin());
+       size_type e = coeff_.back();
        sizes_.back() = P;
        this->resize(e*P);
        return e;
@@ -264,10 +265,10 @@ namespace bgeot {
       if (sizes_.size()) {
        size_type i = 0, j = 0;
        for (; i < sizes_.size(); ++i)
-         if (sizes_[i] != 1) { sizes_[j]=sizes_[i]; coeff[j]=coeff[i]; ++j; }
+         if (sizes_[i] != 1) { sizes_[j]=sizes_[i]; coeff_[j]=coeff_[i]; ++j; }
        if (!j) ++j;
        sizes_.resize(j);
-       coeff.resize(j);
+       coeff_.resize(j);
       }
     }
 
@@ -291,7 +292,7 @@ namespace bgeot {
 
     size_type memsize() const {
       return sizeof(T) * this->size()
-        + sizeof(*this) + sizes_.memsize() + coeff.memsize();
+        + sizeof(*this) + sizes_.memsize() + coeff_.memsize();
     }
 
     std::vector<T> &as_vector() { return *this; }
@@ -317,11 +318,13 @@ namespace bgeot {
       std::copy(t.begin(), t.end(), this->begin());
       if (sizes_.size() != t.sizes_.size()) sizes_.resize(t.sizes_.size());
       std::copy(t.sizes_.begin(), t.sizes_.end(), sizes_.begin());
-      if (coeff.size() != t.coeff.size()) coeff.resize(t.coeff.size());
-      std::copy(t.coeff.begin(), t.coeff.end(), coeff.begin());
+      if (coeff_.size() != t.coeff_.size()) coeff_.resize(t.coeff_.size());
+      std::copy(t.coeff_.begin(), t.coeff_.end(), coeff_.begin());
       return *this;
     }
 
+    tensor(const tensor &t)
+      : std::vector<T>(t), sizes_(t.sizes_), coeff_(t.coeff_) { }
     tensor(const multi_index &c) { init(c); }
     tensor(size_type i) = delete; // { init(i); }
     tensor(size_type i, size_type j)  { init(i, j); }
@@ -333,8 +336,7 @@ namespace bgeot {
 
   template<class T> void tensor<T>::mat_transp_reduction
   (const tensor &t, const gmm::dense_matrix<T> &m, int ni) {
-    /* reduction du tenseur t par son indice ni et la matrice          */
-    /* transposee de m.                                                */
+    /* contraction of tensor t by its index ni and the transpose of matrix m. 
*/
 
     THREAD_SAFE_STATIC std::vector<T> tmp;
     THREAD_SAFE_STATIC multi_index mi;
@@ -352,8 +354,8 @@ namespace bgeot {
 
     const_iterator pft = t.begin();
     iterator pf = this->begin();
-    size_type dd  =   coeff[ni]*(  sizes()[ni]-1)-1, co  =   coeff[ni];
-    size_type ddt = t.coeff[ni]*(t.sizes()[ni]-1)-1, cot = t.coeff[ni];
+    size_type dd  =   coeff_[ni]*(  sizes()[ni]-1)-1, co  =   coeff_[ni];
+    size_type ddt = t.coeff_[ni]*(t.sizes()[ni]-1)-1, cot = t.coeff_[ni];
     std::fill(mi.begin(), mi.end(), 0);
     for (;!mi.finished(sizes()); mi.incrementation(sizes()), ++pf, ++pft) {
       if (mi[ni] != 0) {
@@ -402,7 +404,7 @@ namespace bgeot {
 
   template<class T> void tensor<T>::mat_reduction
   (const tensor &t, const gmm::dense_matrix<T> &m, int ni) {
-    /* reduction du tenseur t par son indice ni et la matrice m.       */
+    /* contraction of tensor t by its index ni and the matrix m. */
     THREAD_SAFE_STATIC std::vector<T> tmp;
     THREAD_SAFE_STATIC multi_index mi;
     
@@ -417,8 +419,8 @@ namespace bgeot {
     adjust_sizes(mi);
     const_iterator pft = t.begin();
     iterator pf = this->begin();
-    size_type dd  =   coeff[ni]*(  sizes()[ni]-1)-1, co  =   coeff[ni];
-    size_type ddt = t.coeff[ni]*(t.sizes()[ni]-1)-1, cot = t.coeff[ni];
+    size_type dd  =   coeff_[ni]*(  sizes()[ni]-1)-1, co  =   coeff_[ni];
+    size_type ddt = t.coeff_[ni]*(t.sizes()[ni]-1)-1, cot = t.coeff_[ni];
     std::fill(mi.begin(), mi.end(), 0);
     for (;!mi.finished(sizes()); mi.incrementation(sizes()), ++pf, ++pft) {
       if (mi[ni] != 0) {
diff --git a/src/getfem_generic_assembly_functions_and_operators.cc 
b/src/getfem_generic_assembly_functions_and_operators.cc
index 7264f4e..6081028 100644
--- a/src/getfem_generic_assembly_functions_and_operators.cc
+++ b/src/getfem_generic_assembly_functions_and_operators.cc
@@ -335,6 +335,7 @@ namespace getfem {
     void derivative(const arg_list &args, size_type,
                     base_tensor &result) const { // to be verified
       size_type N = args[0]->sizes()[0];
+      if (!N) return;
       __mat_aux1().base_resize(N, N);
       gmm::copy(args[0]->as_vector(), __mat_aux1().as_vector());
       bgeot::lu_inverse(__mat_aux1());
@@ -343,9 +344,11 @@ namespace getfem {
       for (size_type l = 0; l < N; ++l, ++ita_l) {
         auto ita_k = ita;
         for (size_type k = 0; k < N; ++k, ita_k += N) {
-          auto ita_lj = ita_l;
-          for (size_type j = 0; j < N; ++j, ita_lj += N) {
-            auto ita_ik = ita_k;
+          auto ita_lj = ita_l, ita_ik = ita_k;
+          for (size_type i = 0; i < N; ++i, ++it, ++ita_ik)
+              *it = -(*ita_ik) * (*ita_lj);
+          for (size_type j = 1; j < N; ++j) {
+            ita_lj += N; ita_ik = ita_k;
             for (size_type i = 0; i < N; ++i, ++it, ++ita_ik)
               *it = -(*ita_ik) * (*ita_lj);
           }
diff --git a/src/gmm/gmm_real_part.h b/src/gmm/gmm_real_part.h
index 19895c0..697ade1 100644
--- a/src/gmm/gmm_real_part.h
+++ b/src/gmm/gmm_real_part.h
@@ -138,8 +138,6 @@ namespace gmm {
     
     part_vector_iterator(void) {}
     explicit part_vector_iterator(const IT &i) : it(i) {}
-    part_vector_iterator(const part_vector_iterator<MIT, MIT, PART> &i) : 
it(i.it) {}
-    
 
     size_type index(void) const { return it.index(); }
     part_vector_iterator operator ++(int)
diff --git a/src/gmm/gmm_sub_vector.h b/src/gmm/gmm_sub_vector.h
index 7fd2712..5a7902c 100644
--- a/src/gmm/gmm_sub_vector.h
+++ b/src/gmm/gmm_sub_vector.h
@@ -79,8 +79,6 @@ namespace gmm {
     sparse_sub_vector_iterator(void) {}
     sparse_sub_vector_iterator(const IT &it, const IT &ite, const SUBI &s)
       : itb(it), itbe(ite), si(s) { forward(); }
-    sparse_sub_vector_iterator(const sparse_sub_vector_iterator<MIT, MIT,
-        SUBI> &it) : itb(it.itb), itbe(it.itbe), si(it.si) {}
   };
 
   template <typename IT, typename MIT, typename SUBI>
diff --git a/src/gmm/gmm_vector.h b/src/gmm/gmm_vector.h
index 718891f..2e4919b 100644
--- a/src/gmm/gmm_vector.h
+++ b/src/gmm/gmm_vector.h
@@ -97,6 +97,7 @@ namespace gmm {
 
     operator std::complex<T>() const { return pm->r(l); }
     ref_elt_vector(V *p, size_type ll) : pm(p), l(ll) {}
+    ref_elt_vector(const ref_elt_vector &re) : pm(re.pm), l(re.l) {}
     inline bool operator ==(std::complex<T> v) const
     { return ((*pm).r(l) == v); }
     inline bool operator !=(std::complex<T> v) const
@@ -112,7 +113,7 @@ namespace gmm {
     inline ref_elt_vector &operator *=(std::complex<T> v)
     { (*pm).w(l,(*pm).r(l) * v); return *this; }
     inline ref_elt_vector &operator =(const ref_elt_vector &re)
-    { *this = T(re); return *this; }
+    { *this = std::complex<T>(re); return *this; }
     inline ref_elt_vector &operator =(std::complex<T> v)
     { (*pm).w(l,v); return *this; }
     inline ref_elt_vector &operator =(T v)
@@ -714,7 +715,7 @@ namespace gmm {
 
     wsvector_const_iterator() {}
     wsvector_const_iterator(const wsvector_iterator<T> &it)
-      : base_it_type(it) {}
+      : base_it_type(typename std::map<size_type, T>::iterator(it)) {}
     wsvector_const_iterator(const base_it_type &it) : base_it_type(it) {}
   };
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]