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: Just white spac


From: Konstantinos Poulios
Subject: [Getfem-commits] [getfem-commits] branch master updated: Just white space changes
Date: Fri, 13 Jan 2023 08:03:21 -0500

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 5dd7219d Just white space changes
5dd7219d is described below

commit 5dd7219dc0afa468310c2911f638a69c8c3567d0
Author: Konstantinos Poulios <logari81@gmail.com>
AuthorDate: Fri Jan 13 14:02:56 2023 +0100

    Just white space changes
---
 interface/src/getfemint.h                       | 140 ++++++++++-----------
 src/getfem_generic_assembly_compile_and_exec.cc |   2 +-
 src/getfem_generic_assembly_semantic.cc         |  98 ++++++++-------
 src/getfem_global_function.cc                   |   2 +-
 src/gmm/gmm_sub_vector.h                        | 160 ++++++++++++++----------
 5 files changed, 216 insertions(+), 186 deletions(-)

diff --git a/interface/src/getfemint.h b/interface/src/getfemint.h
index 4e75dcce..b88f5876 100644
--- a/interface/src/getfemint.h
+++ b/interface/src/getfemint.h
@@ -51,25 +51,25 @@ namespace getfemint {
      Do not forget to modify also 'name_of_getfemint_class_id' just after
   */
   typedef enum { CONT_STRUCT_CLASS_ID,
-                CVSTRUCT_CLASS_ID,
-                ELTM_CLASS_ID,
-                FEM_CLASS_ID,
-                GEOTRANS_CLASS_ID,
-                GLOBAL_FUNCTION_CLASS_ID,
-                INTEG_CLASS_ID,
-                LEVELSET_CLASS_ID,
-                MESH_CLASS_ID,
-                MESHFEM_CLASS_ID,
-                MESHIM_CLASS_ID,
-                MESHIMDATA_CLASS_ID,
-                MESH_LEVELSET_CLASS_ID,
-                MESHER_OBJECT_CLASS_ID,
-                MODEL_CLASS_ID,
-                PRECOND_CLASS_ID,
-                SLICE_CLASS_ID,
-                SPMAT_CLASS_ID,
-                POLY_CLASS_ID,    /* Not fully interfaced. Remain at the end */
-                GETFEMINT_NB_CLASS } getfemint_class_id;
+                 CVSTRUCT_CLASS_ID,
+                 ELTM_CLASS_ID,
+                 FEM_CLASS_ID,
+                 GEOTRANS_CLASS_ID,
+                 GLOBAL_FUNCTION_CLASS_ID,
+                 INTEG_CLASS_ID,
+                 LEVELSET_CLASS_ID,
+                 MESH_CLASS_ID,
+                 MESHFEM_CLASS_ID,
+                 MESHIM_CLASS_ID,
+                 MESHIMDATA_CLASS_ID,
+                 MESH_LEVELSET_CLASS_ID,
+                 MESHER_OBJECT_CLASS_ID,
+                 MODEL_CLASS_ID,
+                 PRECOND_CLASS_ID,
+                 SLICE_CLASS_ID,
+                 SPMAT_CLASS_ID,
+                 POLY_CLASS_ID,    /* Not fully interfaced. Remain at the end 
*/
+                 GETFEMINT_NB_CLASS } getfemint_class_id;
 
   
   /* Associate the class ID found in the matlab structures referencing
@@ -83,17 +83,17 @@ namespace getfemint {
 
   /* exception-throwing version of the allocation functions of gfi_array.h */
   gfi_array* checked_gfi_array_create(int ndim, const int *dims,
-                                     gfi_type_id type,
-                                     gfi_complex_flag is_complex = GFI_REAL);
+                                      gfi_type_id type,
+                                      gfi_complex_flag is_complex = GFI_REAL);
   gfi_array* checked_gfi_array_create_0(gfi_type_id type,
-                                       gfi_complex_flag is_complex = GFI_REAL);
+                                        gfi_complex_flag is_complex = 
GFI_REAL);
   gfi_array* checked_gfi_array_create_1(int M, gfi_type_id type,
-                                       gfi_complex_flag is_complex = GFI_REAL);
+                                        gfi_complex_flag is_complex = 
GFI_REAL);
   gfi_array* checked_gfi_array_create_2(int M, int N, gfi_type_id type,
-                                       gfi_complex_flag is_complex = GFI_REAL);
+                                        gfi_complex_flag is_complex = 
GFI_REAL);
   gfi_array* checked_gfi_array_from_string(const char*s);
   gfi_array* checked_gfi_create_sparse(int m, int n, int nzmax,
-                                      gfi_complex_flag is_complex);
+                                       gfi_complex_flag is_complex);
 
   typedef bgeot::dim_type dim_type;
   typedef bgeot::scalar_type scalar_type;
@@ -114,12 +114,12 @@ namespace getfemint {
   typedef gmm::row_matrix<gmm::wsvector<scalar_type> >  gf_real_sparse_by_row;
   typedef gmm::col_matrix<gmm::wsvector<scalar_type> >  gf_real_sparse_by_col;
   typedef gmm::csc_matrix_ref<const double *, const unsigned int *,
-                             const unsigned int *>
+                              const unsigned int *>
   gf_real_sparse_csc_const_ref;
   typedef gmm::row_matrix<gmm::wsvector<complex_type> >  gf_cplx_sparse_by_row;
   typedef gmm::col_matrix<gmm::wsvector<complex_type> >  gf_cplx_sparse_by_col;
   typedef gmm::csc_matrix_ref<const complex_type *, const unsigned int *,
-                             const unsigned int *>
+                              const unsigned int *>
   gf_cplx_sparse_csc_const_ref;
   class gsparse;
 
@@ -204,7 +204,7 @@ namespace getfemint {
       return (data.get())[unsigned(i+j*getm()+k*getm()*getn())];
     }
     const value_type& operator()(size_type i, size_type j,
-                                size_type k=0) const {
+                                 size_type k=0) const {
       if (i+j*getm()+k*getm()*getn() >= size()) THROW_INTERNAL_ERROR;
       return (data.get())[unsigned(i+j*getm()+k*getm()*getn())];
     }
@@ -237,20 +237,20 @@ namespace getfemint {
       if (gfi_array_get_class(mx) == GFI_DOUBLE) {
         /* creation from an array of doubles : just store a ref to the array */
         assign_dimensions(mx);
-       data = std::shared_array_ptr<double>(std::shared_ptr<double>(),
-                                            gfi_double_get_data(mx));
+        data = std::shared_array_ptr<double>(std::shared_ptr<double>(),
+                                             gfi_double_get_data(mx));
       } else if (gfi_array_get_class(mx) == GFI_UINT32 ||
-                gfi_array_get_class(mx) == GFI_INT32) {
+                 gfi_array_get_class(mx) == GFI_INT32) {
         /* creation from an array of int : allocation of new storage,
-          and copy of the content */
+           and copy of the content */
         assign_dimensions(mx);
         data = std::make_shared_array<double>(size());
         if (gfi_array_get_class(mx) == GFI_INT32)
           std::copy(gfi_int32_get_data(mx), gfi_int32_get_data(mx)+size(),
-                   data.get());
+                    data.get());
         else
           std::copy(gfi_uint32_get_data(mx), gfi_uint32_get_data(mx)+size(),
-                   data.get());
+                    data.get());
       } else THROW_INTERNAL_ERROR;
     }
     darray(const gfi_array *mx) { assign(mx); }
@@ -279,25 +279,25 @@ namespace getfemint {
       if (gfi_array_get_class(mx) == GFI_DOUBLE && gfi_array_is_complex(mx)) {
         /* creation from an array of complexes: just store a ref to the array 
*/
         assign_dimensions(mx);
-       data = std::shared_array_ptr<complex_type>
-         (std::shared_ptr<complex_type>(),
-          reinterpret_cast<complex_type*>(gfi_double_get_data(mx)));
+        data = std::shared_array_ptr<complex_type>
+               (std::shared_ptr<complex_type>(),
+                reinterpret_cast<complex_type*>(gfi_double_get_data(mx)));
       } else if (gfi_array_get_class(mx) == GFI_DOUBLE ||
-                gfi_array_get_class(mx) == GFI_UINT32 ||
-                gfi_array_get_class(mx) == GFI_INT32) {
+                 gfi_array_get_class(mx) == GFI_UINT32 ||
+                 gfi_array_get_class(mx) == GFI_INT32) {
         /* creation from an array of int or doubles: allocation of new storage,
-          and copy of the content */
+           and copy of the content */
         assign_dimensions(mx);
-       data = std::make_shared_array<complex_type>(size());
+        data = std::make_shared_array<complex_type>(size());
         if (gfi_array_get_class(mx) == GFI_DOUBLE)
           std::copy(gfi_double_get_data(mx), gfi_double_get_data(mx)+size(),
-                   data.get());
+                    data.get());
         else if (gfi_array_get_class(mx) == GFI_INT32)
           std::copy(gfi_int32_get_data(mx), gfi_int32_get_data(mx)+size(),
-                   data.get());
+                    data.get());
         else if (gfi_array_get_class(mx) == GFI_UINT32)
           std::copy(gfi_uint32_get_data(mx), gfi_uint32_get_data(mx)+size(),
-                   data.get());
+                    data.get());
       } else THROW_INTERNAL_ERROR;
     }
     carray(const gfi_array *mx) { assign(mx); }
@@ -325,9 +325,9 @@ namespace getfemint {
     bool is_complex() const { return v == COMPLEX; }
     carray &to_complex() {
       if (v == REAL) {
-       c = std::make_shared<carray>(mx);
-       d = std::shared_ptr<darray>();
-       v = COMPLEX;
+        c = std::make_shared<carray>(mx);
+        d = std::shared_ptr<darray>();
+        v = COMPLEX;
       }
       return cplx();
     }
@@ -355,11 +355,11 @@ namespace getfemint {
     iarray() {}
     void assign(const gfi_array *mx) {
       if (gfi_array_get_class(mx) == GFI_INT32)
-       data = std::shared_array_ptr<int>(std::shared_ptr<int>(),
-                                         gfi_int32_get_data(mx));
+        data = std::shared_array_ptr<int>(std::shared_ptr<int>(),
+                                          gfi_int32_get_data(mx));
       else if (gfi_array_get_class(mx) == GFI_UINT32)
-       data = std::shared_array_ptr<int>(std::shared_ptr<int>(),
-                                         (int*)gfi_uint32_get_data(mx));
+        data = std::shared_array_ptr<int>(std::shared_ptr<int>(),
+                                          (int*)gfi_uint32_get_data(mx));
       else THROW_INTERNAL_ERROR;
       assign_dimensions(mx);
     }
@@ -439,7 +439,7 @@ namespace getfemint {
     bool is_object_id(id_type *pid=0, id_type *pcid=0) const;
     bool is_sparse();
     bool is_complex(); /* true for complex garrays AND complex sparse matrices
-                         (native or gsparse) */
+                          (native or gsparse) */
     bool is_integer();
     bool is_bool();
 
@@ -456,9 +456,9 @@ namespace getfemint {
     carray               to_carray();
     carray               to_carray(int expected_dim);
     carray               to_carray(int expected_n, int expected_m,
-                                  int expected_k=1, int expected_q=1);
+                                   int expected_k=1, int expected_q=1);
     darray               to_darray(); /* do not perform any check on the
-                                        number of dimensions of the array */
+                                         number of dimensions of the array */
     /* expect the argument to be a row or column vector of given dimension */
     darray               to_darray(int expected_dim);
     /* expect the argument to be a matrix (or possibly a 3D array)
@@ -466,16 +466,16 @@ namespace getfemint {
        is not checked
      */
     darray               to_darray(int expected_m, int expected_n,
-                                  int expected_k=1, int expected_q=1);
+                                   int expected_k=1, int expected_q=1);
     /* convertion to a real or complex array */
     rcarray              to_rcarray();
     rcarray              to_rcarray(int expected_dim);
     rcarray              to_rcarray(int expected_m, int expected_n,
-                                   int expected_k=1, int expected_q=1);
+                                    int expected_k=1, int expected_q=1);
     iarray               to_iarray();
     iarray               to_iarray(int expected_dim);
     iarray               to_iarray(int expected_m, int expected_n,
-                                  int expected_k=1, int expected_q=1);
+                                   int expected_k=1, int expected_q=1);
 
     /* template friendly version */
     garray<double>            to_garray(double) { return to_darray(); }
@@ -487,10 +487,10 @@ namespace getfemint {
     garray<complex_type>      to_garray(int expected_dim, complex_type)
     { return to_carray(expected_dim); }
     garray<complex_type>      to_garray(int expected_m, int expected_n,
-                                       complex_type)
+                                        complex_type)
     { return to_carray(expected_m, expected_n); }
     dal::bit_vector           to_bit_vector(const dal::bit_vector *subsetof = 
0,
-                                           int shiftvs=-config::base_index());
+                                            int shiftvs=-config::base_index());
     sub_index                 to_sub_index();
     getfem::base_node         to_base_node() { return to_base_node(-1); }
     getfem::base_node         to_base_node(int expected_dim);
@@ -500,7 +500,7 @@ namespace getfemint {
     
     mexarg_in &check_trailing_dimension(int expected_dim);
     void check_dimensions(array_dimensions &v, int expected_m,
-                         int expected_n, int expected_p=-1, int expected_q=-1);
+                          int expected_n, int expected_p=-1, int 
expected_q=-1);
     void check_dimensions(const array_dimensions &v, int expected_dim);
   private:
     friend class mexargs_in;
@@ -522,10 +522,10 @@ namespace getfemint {
     void from_string(const char *s);
     template<class STR_CONT> void from_string_container(const STR_CONT& s);
     void from_bit_vector(const dal::bit_vector& bv,
-                        int shift=config::base_index());
+                         int shift=config::base_index());
     void from_mesh_region(const getfem::mesh_region &region);
     typedef enum { USE_NATIVE_SPARSE, USE_GSPARSE,
-                  USE_DEFAULT_SPARSE } output_sparse_fmt;
+                   USE_DEFAULT_SPARSE } output_sparse_fmt;
 
     /**
        BIG CAUTION:
@@ -533,9 +533,9 @@ namespace getfemint {
        (in order to avoid unnecessary copies of sparse matrices)
     */
     void from_sparse(gf_real_sparse_by_col& M,
-                    output_sparse_fmt fmt = USE_DEFAULT_SPARSE);
+                     output_sparse_fmt fmt = USE_DEFAULT_SPARSE);
     void from_sparse(gf_cplx_sparse_by_col& M,
-                    output_sparse_fmt fmt = USE_DEFAULT_SPARSE);
+                     output_sparse_fmt fmt = USE_DEFAULT_SPARSE);
     void from_sparse(gsparse& M, output_sparse_fmt fmt = USE_DEFAULT_SPARSE);
 
     void from_tensor(const getfem::base_tensor& t);
@@ -610,7 +610,7 @@ namespace getfemint {
   }
 
   gfi_array *create_object_id(int nid, id_type *ids, id_type cid,
-                             bool not_as_a_vector=false);
+                              bool not_as_a_vector=false);
   inline gfi_array *create_object_id(id_type id, id_type cid) {
     return create_object_id(1, &id, cid, true);
   }
@@ -659,7 +659,7 @@ namespace getfemint {
   /* handles the list of output arguments */
   class mexargs_out {
     mutable std::deque<gfi_array *> out; /* deque because mexarg_out hold a
-                                           reference to this array content */
+                                            reference to this array content */
     int nb_arg; /* if equal to -1, the number of output arguments is unknown */
     int idx;
     int okay; /* if 0, the destructor will destroy the allacted arrays in 'out'
@@ -682,7 +682,7 @@ namespace getfemint {
     bool remaining() const
     { return !narg_known() || (std::max(nb_arg,1) - idx); }
     void return_packed_obj_ids(const std::vector<id_type>& ids,
-                              id_type class_id);
+                               id_type class_id);
     std::deque<gfi_array *>& args() { return out; }
     void set_okay(bool ok) { okay = ok; }
     void set_scilab(bool _scilab_flag) {scilab_flag = _scilab_flag;}
@@ -710,11 +710,11 @@ namespace getfemint {
   // Gives the class id of an object
   // To be completed when an object class is added.
   id_type class_id_of_object(const dal::pstatic_stored_object &p,
-                            const void **q = 0);
+                             const void **q = 0);
 
-# define getfemint_declare_getfem_class(CLASS)                         \
+# define getfemint_declare_getfem_class(CLASS)                          \
   } namespace getfem { class CLASS; } namespace getfemint {
-# define getfemint_delare_bgeot_class(CLASS)                           \
+# define getfemint_delare_bgeot_class(CLASS)                            \
   } namespace bgeot { class CLASS; } namespace getfemint {
   
   // Functions for CONT_STRUCT_CLASS_ID
diff --git a/src/getfem_generic_assembly_compile_and_exec.cc 
b/src/getfem_generic_assembly_compile_and_exec.cc
index 8a6087c0..a7ec2bd5 100644
--- a/src/getfem_generic_assembly_compile_and_exec.cc
+++ b/src/getfem_generic_assembly_compile_and_exec.cc
@@ -3658,7 +3658,7 @@ namespace getfem {
       return 0;
     }
     ga_instruction_c_matrix_with_tests
-    (base_tensor &t_, const std::vector<const base_tensor *>  &components_)
+    (base_tensor &t_, const std::vector<const base_tensor *> &components_)
       : t(t_), components(components_) {}
   };
 
diff --git a/src/getfem_generic_assembly_semantic.cc 
b/src/getfem_generic_assembly_semantic.cc
index 039ff551..b6619f1a 100644
--- a/src/getfem_generic_assembly_semantic.cc
+++ b/src/getfem_generic_assembly_semantic.cc
@@ -252,7 +252,8 @@ namespace getfem {
           pnode->parent->op_type = GA_COLON;
           tree.add_child(pnode->parent, GA_NODE_PARAMS);
           pga_tree_node pid = pnode->parent->children[1];
-          tree.add_child(pid); tree.add_child(pid);
+          tree.add_child(pid);
+          tree.add_child(pid);
           pid->children[0]->node_type = GA_NODE_NAME;
           pid->children[0]->name = "Id";
           pid->children[1]->node_type = GA_NODE_CONSTANT;
@@ -450,18 +451,22 @@ namespace getfem {
       = dal::singleton<ga_spec_function_tab>::instance(0);
 
     switch (pnode->node_type) {
-    case GA_NODE_PREDEF_FUNC: case GA_NODE_OPERATOR: case GA_NODE_SPEC_FUNC :
-    case GA_NODE_CONSTANT: case GA_NODE_X: case GA_NODE_ELT_SIZE:
-    case GA_NODE_ELT_K:  case GA_NODE_ELT_B: case GA_NODE_NORMAL:
-    case GA_NODE_RESHAPE: case GA_NODE_CROSS_PRODUCT:
-    case GA_NODE_IND_MOVE_LAST: case GA_NODE_SWAP_IND:
-    case GA_NODE_CONTRACT: case GA_NODE_INTERPOLATE_X:
-    case GA_NODE_INTERPOLATE_ELT_K: case GA_NODE_INTERPOLATE_ELT_B:
+    case GA_NODE_PREDEF_FUNC: case GA_NODE_OPERATOR: case GA_NODE_SPEC_FUNC:
+    case GA_NODE_CONSTANT:    case GA_NODE_X:        case GA_NODE_ELT_SIZE:
+    case GA_NODE_ELT_K:       case GA_NODE_ELT_B:    case GA_NODE_NORMAL:
+    case GA_NODE_RESHAPE:     case GA_NODE_CROSS_PRODUCT:
+    case GA_NODE_IND_MOVE_LAST:      case GA_NODE_SWAP_IND:
+    case GA_NODE_CONTRACT:           case GA_NODE_INTERPOLATE_X:
+    case GA_NODE_INTERPOLATE_ELT_K:  case GA_NODE_INTERPOLATE_ELT_B:
     case GA_NODE_INTERPOLATE_NORMAL: case GA_NODE_SECONDARY_DOMAIN_X:
     case GA_NODE_SECONDARY_DOMAIN_NORMAL:
-      pnode->test_function_type = 0; break;
+      pnode->test_function_type = 0;
+      break;
+
+    case GA_NODE_ALLINDICES:
+      pnode->test_function_type = 0;
+      break;
 
-    case GA_NODE_ALLINDICES: pnode->test_function_type = 0; break;
     case GA_NODE_VAL:
       if (eval_fixed_size && !(workspace.associated_mf(pnode->name))
           && !(workspace.associated_im_data(pnode->name))) {
@@ -470,35 +475,35 @@ namespace getfem {
       }
       break;
 
-    case GA_NODE_ZERO: case GA_NODE_GRAD:
-    case GA_NODE_HESS: case GA_NODE_DIVERG:
-    case GA_NODE_INTERPOLATE_VAL:  case GA_NODE_INTERPOLATE_GRAD:
-    case GA_NODE_INTERPOLATE_HESS: case GA_NODE_INTERPOLATE_DIVERG:
-    case GA_NODE_ELEMENTARY_VAL: case GA_NODE_ELEMENTARY_GRAD:
-    case GA_NODE_ELEMENTARY_HESS: case GA_NODE_ELEMENTARY_DIVERG:
+    case GA_NODE_ZERO:                  case GA_NODE_GRAD:
+    case GA_NODE_HESS:                  case GA_NODE_DIVERG:
+    case GA_NODE_INTERPOLATE_VAL:       case GA_NODE_INTERPOLATE_GRAD:
+    case GA_NODE_INTERPOLATE_HESS:      case GA_NODE_INTERPOLATE_DIVERG:
+    case GA_NODE_ELEMENTARY_VAL:        case GA_NODE_ELEMENTARY_GRAD:
+    case GA_NODE_ELEMENTARY_HESS:       case GA_NODE_ELEMENTARY_DIVERG:
     case GA_NODE_SECONDARY_DOMAIN_VAL:  case GA_NODE_SECONDARY_DOMAIN_GRAD:
     case GA_NODE_SECONDARY_DOMAIN_HESS: case GA_NODE_SECONDARY_DOMAIN_DIVERG:
-    case GA_NODE_XFEM_PLUS_VAL: case GA_NODE_XFEM_PLUS_GRAD:
-    case GA_NODE_XFEM_PLUS_HESS: case GA_NODE_XFEM_PLUS_DIVERG:
-    case GA_NODE_XFEM_MINUS_VAL: case GA_NODE_XFEM_MINUS_GRAD:
-    case GA_NODE_XFEM_MINUS_HESS: case GA_NODE_XFEM_MINUS_DIVERG:
+    case GA_NODE_XFEM_PLUS_VAL:         case GA_NODE_XFEM_PLUS_GRAD:
+    case GA_NODE_XFEM_PLUS_HESS:        case GA_NODE_XFEM_PLUS_DIVERG:
+    case GA_NODE_XFEM_MINUS_VAL:        case GA_NODE_XFEM_MINUS_GRAD:
+    case GA_NODE_XFEM_MINUS_HESS:       case GA_NODE_XFEM_MINUS_DIVERG:
       break;
 
-    case GA_NODE_VAL_TEST: case GA_NODE_GRAD_TEST:
-    case GA_NODE_HESS_TEST: case GA_NODE_DIVERG_TEST:
-    case GA_NODE_INTERPOLATE_VAL_TEST: case GA_NODE_INTERPOLATE_GRAD_TEST:
+    case GA_NODE_VAL_TEST:              case GA_NODE_GRAD_TEST:
+    case GA_NODE_HESS_TEST:             case GA_NODE_DIVERG_TEST:
+    case GA_NODE_INTERPOLATE_VAL_TEST:  case GA_NODE_INTERPOLATE_GRAD_TEST:
     case GA_NODE_INTERPOLATE_HESS_TEST: case GA_NODE_INTERPOLATE_DIVERG_TEST:
     case GA_NODE_INTERPOLATE_DERIVATIVE:
-    case GA_NODE_ELEMENTARY_VAL_TEST: case GA_NODE_ELEMENTARY_GRAD_TEST:
-    case GA_NODE_ELEMENTARY_HESS_TEST: case GA_NODE_ELEMENTARY_DIVERG_TEST:
+    case GA_NODE_ELEMENTARY_VAL_TEST:   case GA_NODE_ELEMENTARY_GRAD_TEST:
+    case GA_NODE_ELEMENTARY_HESS_TEST:  case GA_NODE_ELEMENTARY_DIVERG_TEST:
     case GA_NODE_SECONDARY_DOMAIN_VAL_TEST:
     case GA_NODE_SECONDARY_DOMAIN_GRAD_TEST:
     case GA_NODE_SECONDARY_DOMAIN_HESS_TEST:
     case GA_NODE_SECONDARY_DOMAIN_DIVERG_TEST:
-    case GA_NODE_XFEM_PLUS_VAL_TEST: case GA_NODE_XFEM_PLUS_GRAD_TEST:
-    case GA_NODE_XFEM_PLUS_HESS_TEST: case GA_NODE_XFEM_PLUS_DIVERG_TEST:
-    case GA_NODE_XFEM_MINUS_VAL_TEST: case GA_NODE_XFEM_MINUS_GRAD_TEST:
-    case GA_NODE_XFEM_MINUS_HESS_TEST: case GA_NODE_XFEM_MINUS_DIVERG_TEST:
+    case GA_NODE_XFEM_PLUS_VAL_TEST:    case GA_NODE_XFEM_PLUS_GRAD_TEST:
+    case GA_NODE_XFEM_PLUS_HESS_TEST:   case GA_NODE_XFEM_PLUS_DIVERG_TEST:
+    case GA_NODE_XFEM_MINUS_VAL_TEST:   case GA_NODE_XFEM_MINUS_GRAD_TEST:
+    case GA_NODE_XFEM_MINUS_HESS_TEST:  case GA_NODE_XFEM_MINUS_DIVERG_TEST:
       {
         const mesh_fem *mf = workspace.associated_mf(pnode->name);
         const im_data *imd = workspace.associated_im_data(pnode->name);
@@ -807,20 +812,17 @@ namespace getfem {
 
         if (ndt == 1) {
           if (!(workspace.interpolate_transformation_exists
-                (pnode->interpolate_name)))  {
+                (pnode->interpolate_name)))
             ga_throw_error(pnode->expr, pnode->pos,
                            "Unknown interpolate transformation");
-          }
         } else if (ndt == 2) {
           if (!(workspace.elementary_transformation_exists
-                (pnode->elementary_name))) {
+                (pnode->elementary_name)))
             ga_throw_error(pnode->expr, pnode->pos,
                            "Unknown elementary transformation");
-          }
-          if (!(workspace.variable_or_group_exists(pnode->elementary_target))) 
{
+          if (!(workspace.variable_or_group_exists(pnode->elementary_target)))
             ga_throw_error(pnode->expr, pnode->pos, "Unknown data or variable "
                            << pnode->elementary_target);
-          }
           const mesh_fem *mft = workspace.associated_mf(name);
           if (!mft)
             ga_throw_error(pnode->expr, pnode->pos,
@@ -828,10 +830,9 @@ namespace getfem {
                            "should be a finite element variables/data");
         } else if (ndt == 3) {
           if (!(workspace.secondary_domain_exists
-                (pnode->interpolate_name))) {
+                (pnode->interpolate_name)))
             ga_throw_error(pnode->expr, pnode->pos,
                            "Unknown secondary domain");
-          }
         }
       }
       break;
@@ -2108,7 +2109,7 @@ namespace getfem {
           ga_throw_error(pnode->expr, child1->pos,
                          "Wrong number of parameters for Cross_product");
         pga_tree_node child2 = pnode->children[2];
-        
+
         if (false && child1->is_constant() && child2->is_constant()) {
           pnode->node_type = GA_NODE_CONSTANT;
           pnode->test_function_type = 0;
@@ -2721,7 +2722,7 @@ namespace getfem {
     if (!(tree.root)) return;
     // cout << "Begin semantic analysis with ";
     // ga_print_node(tree.root, cout); cout << endl;
-    
+
     if (option == 1) { workspace.test1.clear(); workspace.test2.clear(); }
     ga_node_analysis(tree, workspace, tree.root, m, ref_elt_dim,
                      eval_fixed_size, ignore_X, option);
@@ -2993,7 +2994,10 @@ namespace getfem {
       break;
 
     case GA_NODE_INTERPOLATE_FILTER:
-      if (!child_0_is_constant) { is_constant = false; break; }
+      if (!child_0_is_constant) {
+        is_constant = false;
+        break;
+      }
       //[[fallthrough]];
     case GA_NODE_INTERPOLATE_VAL_TEST:
     case GA_NODE_INTERPOLATE_GRAD_TEST:
@@ -3998,7 +4002,7 @@ namespace getfem {
 
     if ((interpolate_node || interpolate_test_node)  &&
         (workspace.associated_mf(pnode->name) != 0)) marked = true;
-      
+
     if (pnode->node_type == GA_NODE_INTERPOLATE_X ||
         pnode->node_type == GA_NODE_INTERPOLATE_ELT_K ||
         pnode->node_type == GA_NODE_INTERPOLATE_ELT_B ||
@@ -4301,11 +4305,15 @@ namespace getfem {
       else
         pnode->node_type = GA_NODE_XFEM_MINUS_HESS_TEST;
       mi = pnode->tensor().sizes();
-      mi.pop_back(), mi.push_back(m.dim());
-      if (m.dim() > 1) mi.push_back(m.dim());
+      mi.pop_back();
+      mi.push_back(m.dim());
+      if (m.dim() > 1)
+        mi.push_back(m.dim());
       pnode->t.adjust_sizes(mi);
       tree.duplicate_with_operation(pnode, GA_COLON);
-      child0 = pnode; pnode = pnode->parent; child1 = pnode->children[1];
+      child0 = pnode;
+      pnode = pnode->parent;
+      child1 = pnode->children[1];
       child1->init_matrix_tensor(meshdim, meshdim);
       gmm::clear(pnode->tensor().as_vector());
       for (size_type i = 0; i < meshdim; ++i)
@@ -4734,7 +4742,7 @@ namespace getfem {
           switch (F.dtype()) {
           case 0:
             GMM_ASSERT1(false, "Cannot derive function " << child0->name
-                     << ". No derivative provided or not derivable function.");
+                        << ". No derivative provided or not derivable 
function.");
           case 1:
             child0->name = F.derivative1();
             break;
diff --git a/src/getfem_global_function.cc b/src/getfem_global_function.cc
index e96503c6..400d4dd0 100644
--- a/src/getfem_global_function.cc
+++ b/src/getfem_global_function.cc
@@ -1294,7 +1294,7 @@ namespace getfem {
 
     global_function_xy_bspline_(const scalar_type &xmin_, const scalar_type 
&xmax_,
                                 const scalar_type &ymin_, const scalar_type 
&ymax_,
-                                const size_type &order, 
+                                const size_type &order,
                                 const size_type &xtype, const size_type &ytype)
     : global_function_simple(2), xmin(xmin_), ymin(ymin_), xmax(xmax_), 
ymax(ymax_),
       xscale(scalar_type(xtype)/(xmax-xmin)), 
yscale(scalar_type(ytype)/(ymax-ymin))
diff --git a/src/gmm/gmm_sub_vector.h b/src/gmm/gmm_sub_vector.h
index 2ca8df8d..92369098 100644
--- a/src/gmm/gmm_sub_vector.h
+++ b/src/gmm/gmm_sub_vector.h
@@ -44,7 +44,7 @@
 namespace gmm {
 
   /* ********************************************************************* */
-  /*           sparse sub-vectors                                         */
+  /*            sparse sub-vectors                                         */
   /* ********************************************************************* */
 
   template <typename IT, typename MIT, typename SUBI>
@@ -118,18 +118,18 @@ namespace gmm {
        end_(vect_end(v)), origin(linalg_origin(v)), si(s) {}
     sparse_sub_vector(const V &v, const SUBI &s) 
       : begin_(vect_begin(const_cast<V &>(v))),
-       end_(vect_end(const_cast<V &>(v))),
-       origin(linalg_origin(const_cast<V &>(v))), si(s) {}
+        end_(vect_end(const_cast<V &>(v))),
+        origin(linalg_origin(const_cast<V &>(v))), si(s) {}
     sparse_sub_vector() {}
     sparse_sub_vector(const sparse_sub_vector<CPT, SUBI> &cr)
       : begin_(cr.begin_),end_(cr.end_),origin(cr.origin), si(cr.si) {} 
   };
 
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_begin(sparse_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, sparse_sub_vector<PT, SUBI> *,
-                   linalg_modifiable) {
+                    ORG o, sparse_sub_vector<PT, SUBI> *,
+                    linalg_modifiable) {
     typedef sparse_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     set_to_begin(it.itb, o, typename linalg_traits<VECT>::pV(), ref_t());
@@ -137,10 +137,10 @@ namespace gmm {
     it.forward();
   }
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_begin(sparse_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, const sparse_sub_vector<PT, SUBI> *, 
-                   linalg_modifiable) {
+                    ORG o, const sparse_sub_vector<PT, SUBI> *, 
+                    linalg_modifiable) {
     typedef sparse_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     set_to_begin(it.itb, o, typename linalg_traits<VECT>::pV(), ref_t());
@@ -149,9 +149,9 @@ namespace gmm {
   }
   
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_end(sparse_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, sparse_sub_vector<PT, SUBI> *, linalg_modifiable) {
+                  ORG o, sparse_sub_vector<PT, SUBI> *, linalg_modifiable) {
     typedef sparse_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     set_to_end(it.itb, o, typename linalg_traits<VECT>::pV(), ref_t());
@@ -159,10 +159,10 @@ namespace gmm {
     it.forward();
   }
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_end(sparse_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, const sparse_sub_vector<PT, SUBI> *,
-                 linalg_modifiable) {
+                  ORG o, const sparse_sub_vector<PT, SUBI> *,
+                  linalg_modifiable) {
     typedef sparse_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     set_to_end(it.itb, o, typename linalg_traits<VECT>::pV(), ref_t());
@@ -177,71 +177,86 @@ namespace gmm {
     typedef PT pV;
     typedef typename std::iterator_traits<PT>::value_type V;
     typedef typename linalg_and<typename index_is_sorted<SUBI>::bool_type,
-           typename linalg_traits<V>::index_sorted>::bool_type index_sorted;
+            typename linalg_traits<V>::index_sorted>::bool_type index_sorted;
     typedef typename linalg_traits<V>::is_reference V_reference;
     typedef typename linalg_traits<V>::origin_type origin_type;
     typedef typename select_ref<const origin_type *, origin_type *,
-                               PT>::ref_type porigin_type;
+                                PT>::ref_type porigin_type;
     typedef typename which_reference<PT>::is_reference is_reference;
     typedef abstract_vector linalg_type;
     typedef typename linalg_traits<V>::value_type value_type;
     typedef typename select_ref<value_type, typename
             linalg_traits<V>::reference, PT>::ref_type reference;
     typedef typename select_ref<typename linalg_traits<V>::const_iterator,
-           typename linalg_traits<V>::iterator, PT>::ref_type pre_iterator;
+            typename linalg_traits<V>::iterator, PT>::ref_type pre_iterator;
     typedef typename select_ref<abstract_null_type, 
-           sparse_sub_vector_iterator<pre_iterator, pre_iterator, SUBI>,
-           PT>::ref_type iterator;
+                                sparse_sub_vector_iterator<pre_iterator,
+                                                           pre_iterator, SUBI>,
+                                PT>::ref_type iterator;
     typedef sparse_sub_vector_iterator<typename linalg_traits<V>
             ::const_iterator, pre_iterator, SUBI> const_iterator;
     typedef abstract_sparse storage_type;
     static size_type size(const this_type &v) { return v.size(); }
     static iterator begin(this_type &v) {
       iterator it;
-      it.itb = v.begin_; it.itbe = v.end_; it.si = v.si;
+      it.itb = v.begin_;
+      it.itbe = v.end_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       set_to_begin(it, v.origin, pthis_type(), is_reference());
-      else it.forward();
+        set_to_begin(it, v.origin, pthis_type(), is_reference());
+      else
+        it.forward();
       return it;
     }
     static const_iterator begin(const this_type &v) {
-      const_iterator it; it.itb = v.begin_; it.itbe = v.end_; it.si = v.si;
+      const_iterator it;
+      it.itb = v.begin_;
+      it.itbe = v.end_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       { set_to_begin(it, v.origin, pthis_type(), is_reference()); }
-      else it.forward();
+        set_to_begin(it, v.origin, pthis_type(), is_reference());
+      else
+        it.forward();
       return it;
     }
     static iterator end(this_type &v) {
       iterator it;
-      it.itb = v.end_; it.itbe = v.end_; it.si = v.si;
+      it.itb = v.end_;
+      it.itbe = v.end_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       set_to_end(it, v.origin, pthis_type(), is_reference());
-      else it.forward();
+        set_to_end(it, v.origin, pthis_type(), is_reference());
+      else
+        it.forward();
       return it;
     }
     static const_iterator end(const this_type &v) {
-      const_iterator it; it.itb = v.end_; it.itbe = v.end_; it.si = v.si;
+      const_iterator it;
+      it.itb = v.end_;
+      it.itbe = v.end_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       set_to_end(it, v.origin, pthis_type(), is_reference());
-      else it.forward();
+        set_to_end(it, v.origin, pthis_type(), is_reference());
+      else
+        it.forward();
       return it;
     }
     static origin_type* origin(this_type &v) { return v.origin; }
     static const origin_type* origin(const this_type &v) { return v.origin; }
     static void clear(origin_type* o, const iterator &begin_,
-                     const iterator &end_) {
+                      const iterator &end_) {
       std::deque<size_type> ind;
       iterator it = begin_;
       for (; it != end_; ++it) ind.push_front(it.index());
       for (; !(ind.empty()); ind.pop_back())
-       access(o, begin_, end_, ind.back()) = value_type(0);
+        access(o, begin_, end_, ind.back()) = value_type(0);
     }
     static void do_clear(this_type &v) { clear(v.origin, begin(v), end(v)); }
     static value_type access(const origin_type *o, const const_iterator &it,
-                            const const_iterator &ite, size_type i)
+                             const const_iterator &ite, size_type i)
     { return linalg_traits<V>::access(o, it.itb, ite.itb, it.si.index(i)); }
     static reference access(origin_type *o, const iterator &it,
-                           const iterator &ite, size_type i)
+                            const iterator &ite, size_type i)
     { return linalg_traits<V>::access(o, it.itb, ite.itb, it.si.index(i)); }
   };
 
@@ -250,10 +265,10 @@ namespace gmm {
   { gmm::write(o,m); return o; }
 
   /* ********************************************************************* */
-  /*           skyline sub-vectors                                        */
+  /*            skyline sub-vectors                                        */
   /* ********************************************************************* */
 
-    template <typename IT, typename MIT, typename SUBI>
+  template <typename IT, typename MIT, typename SUBI>
   struct skyline_sub_vector_iterator {
 
     IT itb;
@@ -300,7 +315,7 @@ namespace gmm {
     skyline_sub_vector_iterator(const IT &it, const SUBI &s)
       : itb(it), si(s) {}
     skyline_sub_vector_iterator(const skyline_sub_vector_iterator<MIT, MIT,
-        SUBI> &it) : itb(it.itb), si(it.si) {}
+         SUBI> &it) : itb(it.itb), si(it.si) {}
   };
 
   template <typename IT, typename SUBI>
@@ -335,8 +350,8 @@ namespace gmm {
     }
     skyline_sub_vector(const V &v, const SUBI &s)
       : begin_(vect_begin(const_cast<V &>(v))),
-       end_(vect_end(const_cast<V &>(v))),
-       origin(linalg_origin(const_cast<V &>(v))), si(s) {
+        end_(vect_end(const_cast<V &>(v))),
+        origin(linalg_origin(const_cast<V &>(v))), si(s) {
       update_for_sub_skyline(begin_, end_, si);
     }
     skyline_sub_vector() {}
@@ -345,10 +360,10 @@ namespace gmm {
   };
 
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_begin(skyline_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, skyline_sub_vector<PT, SUBI> *,
-                   linalg_modifiable) {
+                    ORG o, skyline_sub_vector<PT, SUBI> *,
+                    linalg_modifiable) {
     typedef skyline_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     IT itbe = it.itb;
@@ -357,10 +372,10 @@ namespace gmm {
     update_for_sub_skyline(it.itb, itbe, it.si);
   }
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_begin(skyline_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, const skyline_sub_vector<PT, SUBI> *,
-                   linalg_modifiable) {
+                    ORG o, const skyline_sub_vector<PT, SUBI> *,
+                    linalg_modifiable) {
     typedef skyline_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     IT itbe = it.itb;
@@ -370,10 +385,10 @@ namespace gmm {
   }
   
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_end(skyline_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, skyline_sub_vector<PT, SUBI> *,
-                 linalg_modifiable) {
+                  ORG o, skyline_sub_vector<PT, SUBI> *,
+                  linalg_modifiable) {
     typedef skyline_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     IT itb = it.itb;
@@ -382,10 +397,10 @@ namespace gmm {
     update_for_sub_skyline(itb, it.itb, it.si);
   }
   template <typename IT, typename MIT, typename SUBI, typename ORG,
-           typename PT> inline
+            typename PT> inline
   void set_to_end(skyline_sub_vector_iterator<IT, MIT, SUBI> &it,
-                   ORG o, const skyline_sub_vector<PT, SUBI> *,
-                 linalg_modifiable) {
+                  ORG o, const skyline_sub_vector<PT, SUBI> *,
+                  linalg_modifiable) {
     typedef skyline_sub_vector<PT, SUBI> VECT;
     typedef typename linalg_traits<VECT>::V_reference ref_t;
     IT itb = it.itb;
@@ -402,8 +417,8 @@ namespace gmm {
     typedef typename std::iterator_traits<PT>::value_type V;
     typedef typename linalg_traits<V>::is_reference V_reference;
     typedef typename linalg_traits<V>::origin_type origin_type;
-    typedef typename select_ref<const origin_type *, origin_type *,
-                               PT>::ref_type porigin_type;
+    typedef typename select_ref<const origin_type *,
+                                origin_type *, PT>::ref_type porigin_type;
     typedef V * pV;
     typedef typename which_reference<PT>::is_reference is_reference;
     typedef abstract_vector linalg_type;
@@ -412,11 +427,12 @@ namespace gmm {
             linalg_traits<V>::reference, PT>::ref_type reference;
     typedef typename linalg_traits<V>::const_iterator const_V_iterator;
     typedef typename linalg_traits<V>::iterator V_iterator;    
-    typedef typename select_ref<const_V_iterator, V_iterator, 
-                               PT>::ref_type pre_iterator;
+    typedef typename select_ref<const_V_iterator,
+                                V_iterator, PT>::ref_type pre_iterator;
     typedef typename select_ref<abstract_null_type, 
-           skyline_sub_vector_iterator<pre_iterator, pre_iterator, SUBI>,
-           PT>::ref_type iterator;
+                                skyline_sub_vector_iterator<pre_iterator,
+                                                            pre_iterator, 
SUBI>,
+                                PT>::ref_type iterator;
     typedef skyline_sub_vector_iterator<const_V_iterator, pre_iterator, SUBI>
             const_iterator;
     typedef abstract_skyline storage_type;
@@ -424,28 +440,34 @@ namespace gmm {
     static size_type size(const this_type &v) { return v.size(); }
     static iterator begin(this_type &v) {
       iterator it;
-      it.itb = v.begin_; it.si = v.si;
+      it.itb = v.begin_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       set_to_begin(it, v.origin, pthis_type(), is_reference());
+        set_to_begin(it, v.origin, pthis_type(), is_reference());
       return it;
     }
     static const_iterator begin(const this_type &v) {
-      const_iterator it; it.itb = v.begin_; it.si = v.si;
+      const_iterator it;
+      it.itb = v.begin_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       { set_to_begin(it, v.origin, pthis_type(), is_reference()); }
+        set_to_begin(it, v.origin, pthis_type(), is_reference());
       return it;
     }
     static iterator end(this_type &v) {
       iterator it;
-      it.itb = v.end_; it.si = v.si;
+      it.itb = v.end_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       set_to_end(it, v.origin, pthis_type(), is_reference());
+        set_to_end(it, v.origin, pthis_type(), is_reference());
       return it;
     }
     static const_iterator end(const this_type &v) {
-      const_iterator it; it.itb = v.end_; it.si = v.si;
+      const_iterator it;
+      it.itb = v.end_;
+      it.si = v.si;
       if (!is_const_reference(is_reference()))
-       set_to_end(it, v.origin, pthis_type(), is_reference());
+        set_to_end(it, v.origin, pthis_type(), is_reference());
       return it;
     }
     static origin_type* origin(this_type &v) { return v.origin; }
@@ -454,10 +476,10 @@ namespace gmm {
     { std::fill(it, ite, value_type(0)); }
     static void do_clear(this_type &v) { clear(v.origin, begin(v), end(v)); }
     static value_type access(const origin_type *o, const const_iterator &it,
-                            const const_iterator &ite, size_type i)
+                             const const_iterator &ite, size_type i)
     { return linalg_traits<V>::access(o, it.itb, ite.itb, it.si.index(i)); }
     static reference access(origin_type *o, const iterator &it,
-                           const iterator &ite, size_type i)
+                            const iterator &ite, size_type i)
     { return linalg_traits<V>::access(o, it.itb, ite.itb, it.si.index(i)); }
   };
 
@@ -466,7 +488,7 @@ namespace gmm {
   { gmm::write(o,m); return o; }
 
   /* ******************************************************************** */
-  /*           sub vector.                                               */
+  /*            sub vector.                                               */
   /* ******************************************************************** */
   /* sub_vector_type<PT, SUBI>::vector_type is the sub vector type        */
   /* returned by sub_vector(v, sub_index)                                 */



reply via email to

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