getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r4575 - in /trunk/getfem/src: ./ getfem/ gmm/


From: logari81
Subject: [Getfem-commits] r4575 - in /trunk/getfem/src: ./ getfem/ gmm/
Date: Mon, 31 Mar 2014 22:06:34 -0000

Author: logari81
Date: Tue Apr  1 00:06:34 2014
New Revision: 4575

URL: http://svn.gna.org/viewcvs/getfem?rev=4575&view=rev
Log:
tidy up (use spaces for indentation, intend warning-free compilation)

Modified:
    trunk/getfem/src/dal_singleton.cc
    trunk/getfem/src/getfem/getfem_models.h
    trunk/getfem/src/getfem_fourth_order.cc
    trunk/getfem/src/getfem_mesh_region.cc
    trunk/getfem/src/getfem_models.cc
    trunk/getfem/src/getfem_nonlinear_elasticity.cc
    trunk/getfem/src/getfem_omp.cc
    trunk/getfem/src/gmm/gmm_vector.h

Modified: trunk/getfem/src/dal_singleton.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/dal_singleton.cc?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/dal_singleton.cc   (original)
+++ trunk/getfem/src/dal_singleton.cc   Tue Apr  1 00:06:34 2014
@@ -56,19 +56,19 @@
                return a->level() < b->level();
        }
 
-       singletons_manager::~singletons_manager() { 
-               GMM_ASSERT1(!getfem::me_is_multithreaded_now(), 
-                       "singletons_manager destructor should" 
-                       "not be running in parallel !!");
-               //arrange distruction per thread
-               for(size_t i=0;i<getfem::num_threads();i++)
+  singletons_manager::~singletons_manager() { 
+    GMM_ASSERT1(!getfem::me_is_multithreaded_now(), 
+                "singletons_manager destructor should" 
+                "not be running in parallel !!");
+    //arrange distruction per thread
+    for(size_t i=0;i<getfem::num_threads();i++)
     {
-                       /* sort singletons in increasing levels,
-                       lowest levels will be destroyed first */
-                 std::sort(lst(i).begin(),lst(i).end(), level_compare);
-                       std::vector<singleton_instance_base *>::const_iterator 
it  = lst(i).begin();
+      /* sort singletons in increasing levels,
+      lowest levels will be destroyed first */
+      std::sort(lst(i).begin(),lst(i).end(), level_compare);
+      std::vector<singleton_instance_base *>::const_iterator it  = 
lst(i).begin();
       std::vector<singleton_instance_base *>::const_iterator ite = 
lst(i).end();                       
       for ( ; it != ite; ++it) { delete *it; }
-               }
-       }
+    }
+  }
 }

Modified: trunk/getfem/src/getfem/getfem_models.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_models.h?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_models.h     (original)
+++ trunk/getfem/src/getfem/getfem_models.h     Tue Apr  1 00:06:34 2014
@@ -356,7 +356,7 @@
     bool is_var_mf_newer_than_brick(const std::string &varname,
                                     size_type ib) const;
     bool is_mim_newer_than_brick(const mesh_im &mim,
-                                    size_type ib) const;
+                                 size_type ib) const;
 
     pbrick brick_pointer(size_type ib) const {
       GMM_ASSERT1(valid_bricks[ib], "Inexistent brick");

Modified: trunk/getfem/src/getfem_fourth_order.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_fourth_order.cc?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/getfem_fourth_order.cc     (original)
+++ trunk/getfem/src/getfem_fourth_order.cc     Tue Apr  1 00:06:34 2014
@@ -193,7 +193,7 @@
       if (mf_data) s = s * mf_data->get_qdim() / mf_data->nb_dof();
 
       GMM_ASSERT1(s == mf_u.get_qdim()
-                 || s == mf_u.get_qdim()*gmm::sqr(mf_u.linked_mesh().dim()),
+                 || s == 
size_type(mf_u.get_qdim()*gmm::sqr(mf_u.linked_mesh().dim())),
                  dl[0] << ": bad format of normal derivative source term "
                  "data. Detected dimension is " << s << " should be "
                  << size_type(mf_u.get_qdim()));

Modified: trunk/getfem/src/getfem_mesh_region.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_mesh_region.cc?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/getfem_mesh_region.cc      (original)
+++ trunk/getfem/src/getfem_mesh_region.cc      Tue Apr  1 00:06:34 2014
@@ -34,17 +34,17 @@
 
 
   mesh_region::mesh_region() : p(new impl), id_(size_type(-2)), 
type_(size_type(-1)),
-    parent_mesh(0), partitioning_allowed(true), index_updated(false)
+    partitioning_allowed(true), parent_mesh(0), index_updated(false)
   { 
     if (me_is_multithreaded_now()) prohibit_partitioning();
   }
 
   mesh_region::mesh_region(size_type id__) : id_(id__), type_(size_type(-1)),
-    parent_mesh(0), partitioning_allowed(true), index_updated(false)
+    partitioning_allowed(true), parent_mesh(0), index_updated(false)
   { }
 
   mesh_region::mesh_region(mesh& m, size_type id__, size_type type) : 
-    p(new impl), id_(id__), type_(type), parent_mesh(&m), 
partitioning_allowed(true),
+    p(new impl), id_(id__), type_(type), partitioning_allowed(true), 
parent_mesh(&m),
     index_updated(false)
   { 
     if (me_is_multithreaded_now()) prohibit_partitioning();  
@@ -52,7 +52,7 @@
 
   mesh_region::mesh_region(const dal::bit_vector &bv) : 
     p(new impl), id_(size_type(-2)), type_(size_type(-1)),
-    parent_mesh(0), partitioning_allowed(true), index_updated(false)
+    partitioning_allowed(true), parent_mesh(0), index_updated(false)
   { 
     if (me_is_multithreaded_now()) prohibit_partitioning();  
     add(bv); 
@@ -85,7 +85,7 @@
 
   mesh_region& mesh_region::operator=(const mesh_region &from) 
   {
-    if (!this->parent_mesh && !from.parent_mesh) 
+    if (!this->parent_mesh && !from.parent_mesh)
     {
       this->id_ = from.id_;
       this->type_ = from.type_;
@@ -150,7 +150,7 @@
       = std::ceil(static_cast<scalar_type>(region_size)/
       static_cast<scalar_type >(num_threads()));
     size_type index_begin = partition_size * this_thread();
-    const_iterator it = rp().m.begin(); size_type i;
+    const_iterator it = rp().m.begin();
     for (size_type i=0;i<index_begin;++i) ++it;
     return it;
   }
@@ -164,7 +164,7 @@
       = std::ceil(static_cast<scalar_type>(region_size)/
       static_cast<scalar_type >(num_threads()));
     size_type index_end = partition_size * (this_thread() + 1);
-    const_iterator it = rp().m.begin(); size_type i;
+    const_iterator it = rp().m.begin();
     for (size_type i=0;i<index_end && it!=rp().m.end();++i) ++it;
     return it;
   }
@@ -274,7 +274,7 @@
   }
 
 
-  void mesh_region::swap_convex(size_type cv1, size_type cv2) 
+  void mesh_region::swap_convex(size_type cv1, size_type cv2)
   {
     map_t::iterator it1 = wp().m.find(cv1), it2 = wp().m.find(cv2),
       ite = wp().m.end();
@@ -348,7 +348,7 @@
 
 
   mesh_region mesh_region::intersection(const mesh_region &a, 
-    const mesh_region &b) 
+                                        const mesh_region &b) 
   {
     GMM_TRACE2("intersection of "<<a.id()<<" and "<<b.id());
     mesh_region r;
@@ -390,7 +390,7 @@
   }
 
   mesh_region mesh_region::merge(const mesh_region &a, 
-    const mesh_region &b) 
+                                 const mesh_region &b) 
   {
     GMM_TRACE2("Merger of "<<a.id()<<" and "<<b.id());
     mesh_region r;
@@ -404,7 +404,7 @@
 
 
   mesh_region mesh_region::substract(const mesh_region &a,
-    const mesh_region &b) 
+                                     const mesh_region &b) 
   {
     GMM_TRACE2("subtraction of "<<a.id()<<" and "<<b.id());
     mesh_region r;
@@ -442,7 +442,7 @@
   void mesh_region::error_if_not_homogeneous() const 
   {
     GMM_ASSERT1(is_only_faces() || is_only_convexes(), "Expecting a set "
-      "of convexes or a set of faces, but not a mixed set");
+                "of convexes or a set of faces, but not a mixed set");
   }
 
   mesh_region::visitor::visitor(const mesh_region &s, const mesh &m) : 
@@ -483,4 +483,4 @@
 
       return os;
   }
-}
+}

Modified: trunk/getfem/src/getfem_models.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_models.cc?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/getfem_models.cc   (original)
+++ trunk/getfem/src/getfem_models.cc   Tue Apr  1 00:06:34 2014
@@ -784,19 +784,19 @@
                typedef typename C::value_type value_type;
 
     void build_distro(gmm::abstract_matrix )
-               {
+    {
       //intentionally skipping thread 0, as list_distro will
       //use original_list for it
-                       for(size_type thread = 1; thread<num_threads(); 
thread++)
-                       {
-                               typename C::iterator 
it_org=original_list.begin();
-                               typename C::iterator 
it_distro=th_list(thread).begin();
-                               
for(;it_org!=original_list.end();++it_org,++it_distro)
-                               {
+      for(size_type thread = 1; thread<num_threads(); thread++)
+      {
+        typename C::iterator it_org=original_list.begin();
+        typename C::iterator it_distro=th_list(thread).begin();
+        for(;it_org!=original_list.end();++it_org,++it_distro)
+        {
           
gmm::resize(*it_distro,gmm::mat_nrows(*it_org),gmm::mat_ncols(*it_org));
-                               }
-                       }
-               }
+        }
+      }
+   }
 
     void build_distro(gmm::abstract_vector)
                {
@@ -817,32 +817,32 @@
        public:
 
     list_distro(C& l) : original_list(l)
-               {
+    {
       if (not_multithreaded()) return;
-                       for(size_type thread=1;thread<num_threads();thread++) 
-                                           
th_list(thread).resize(original_list.size());
-                       build_distro(typename 
gmm::linalg_traits<value_type>::linalg_type());
-               }
-
-               operator C&()
+      for(size_type thread=1;thread<num_threads();thread++) 
+        th_list(thread).resize(original_list.size());
+      build_distro(typename gmm::linalg_traits<value_type>::linalg_type());
+    }
+
+    operator C&()
     {
       if (not_multithreaded() || this_thread() == 0) return original_list;
       else return th_list(this_thread());
     }
 
-               ~list_distro()
+    ~list_distro()
     {
       if (not_multithreaded()) return;
-                       GMM_ASSERT1(!me_is_multithreaded_now(),
-                               "List accumulation should not run in parallel");
-                       for(size_type thread = 1; thread<num_threads(); 
thread++)
+      GMM_ASSERT1(!me_is_multithreaded_now(),
+                  "List accumulation should not run in parallel");
+      for(size_type thread = 1; thread<num_threads(); thread++)
       { 
-                               typename C::iterator 
it_org=original_list.begin();
-                               typename C::iterator 
it_distro=th_list(thread).begin();
-                               
for(;it_org!=original_list.end();++it_org,++it_distro) 
-                                                       
gmm::add(*it_distro,*it_org);
-                       }
-               }
+        typename C::iterator it_org=original_list.begin();
+        typename C::iterator it_distro=th_list(thread).begin();
+        for(;it_org!=original_list.end();++it_org,++it_distro) 
+          gmm::add(*it_distro,*it_org);
+        }
+      }
        };
 
 

Modified: trunk/getfem/src/getfem_nonlinear_elasticity.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_nonlinear_elasticity.cc?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/getfem_nonlinear_elasticity.cc     (original)
+++ trunk/getfem/src/getfem_nonlinear_elasticity.cc     Tue Apr  1 00:06:34 2014
@@ -409,9 +409,9 @@
     for (size_type i = 0; i < N; ++i)
       for (size_type l = 0; l < N; ++l) {
         result(i, i, l, l) += params[0];
-       result(i, l, i, l) += params[1]/scalar_type(2);
-       result(i, l, l, i) += params[1]/scalar_type(2);
-       result(l, i, i, l) += params[1]/scalar_type(2);
+        result(i, l, i, l) += params[1]/scalar_type(2);
+        result(i, l, l, i) += params[1]/scalar_type(2);
+        result(l, i, i, l) += params[1]/scalar_type(2);
         result(l, i, l, i) += params[1]/scalar_type(2);
       }
   }

Modified: trunk/getfem/src/getfem_omp.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_omp.cc?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/getfem_omp.cc      (original)
+++ trunk/getfem/src/getfem_omp.cc      Tue Apr  1 00:06:34 2014
@@ -37,7 +37,7 @@
   }
 
 
-  region_partition::region_partition(mesh* pm,size_type id) :
+  region_partition::region_partition(mesh* pm, size_type id) :
     pparent_mesh(pm),original_region(0),
     partitions(num_threads())
   {
@@ -48,7 +48,7 @@
     //in case mesh is not provided, also don't do anything
     if (!pm) return;
 
-    if (id==-1) {
+    if (id == size_type(-1)) {
       original_region.reset(new mesh_region(pm->convex_index()));
       original_region->set_parent_mesh(pm);
     } else{

Modified: trunk/getfem/src/gmm/gmm_vector.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/gmm/gmm_vector.h?rev=4575&r1=4574&r2=4575&view=diff
==============================================================================
--- trunk/getfem/src/gmm/gmm_vector.h   (original)
+++ trunk/getfem/src/gmm/gmm_vector.h   Tue Apr  1 00:06:34 2014
@@ -515,7 +515,8 @@
        else {
          size_type ind = it - this->begin();
           if (this->nb_stored() - ind > 800)
-            GMM_WARNING2("Inefficient addition of element in rsvector");
+            GMM_WARNING2("Inefficient addition of element in rsvector with "
+                         << this->nb_stored() - ind << " non-zero entries");
          base_type_::resize(nb_stored()+1, ev);
          if (ind != this->nb_stored() - 1) {
            it = this->begin() + ind;




reply via email to

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