[cig-commits] commit by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Wed Aug 14 21:24:42 PDT 2013


Revision 1842

Rename a couple of member variables.

U   trunk/aspect/include/aspect/particle/particle.h
U   trunk/aspect/include/aspect/particle/world.h
U   trunk/aspect/source/particle/output.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=1842&peg=1842

Diff:
Modified: trunk/aspect/include/aspect/particle/particle.h
===================================================================
--- trunk/aspect/include/aspect/particle/particle.h	2013-08-14 11:31:29 UTC (rev 1841)
+++ trunk/aspect/include/aspect/particle/particle.h	2013-08-15 04:24:01 UTC (rev 1842)
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2011, 2012 by the authors of the ASPECT code.
+ Copyright (C) 2011, 2012, 2013 by the authors of the ASPECT code.
 
  This file is part of ASPECT.
 
@@ -35,20 +35,20 @@
     class MPIDataInfo
     {
       public:
-        std::string     _name;
-        unsigned int    _num_elems;
-        MPI_Datatype    _data_type;
-        unsigned int    _elem_size_bytes;
+        std::string     name;
+        unsigned int    n_elements;
+        MPI_Datatype    data_type;
+        unsigned int    size_in_bytes;
 
         MPIDataInfo(std::string name,
                     unsigned int num_elems,
                     MPI_Datatype data_type,
                     unsigned int elem_size_bytes)
         :
-          _name(name),
-          _num_elems(num_elems),
-          _data_type(data_type),
-          _elem_size_bytes(elem_size_bytes) {};
+          name(name),
+          n_elements(num_elems),
+          data_type(data_type),
+          size_in_bytes(elem_size_bytes) {};
     };
 
     enum ParticleDataFormat

Modified: trunk/aspect/include/aspect/particle/world.h
===================================================================
--- trunk/aspect/include/aspect/particle/world.h	2013-08-14 11:31:29 UTC (rev 1841)
+++ trunk/aspect/include/aspect/particle/world.h	2013-08-15 04:24:01 UTC (rev 1842)
@@ -297,9 +297,9 @@
           old_types = new MPI_Datatype[num_entries];
           for (i=0; i<num_entries; ++i)
             {
-              block_lens[i] = data_info[i]._num_elems;
-              indices[i] = (i == 0 ? 0 : indices[i-1]+data_info[i-1]._elem_size_bytes*data_info[i-1]._num_elems);
-              old_types[i] = data_info[i]._data_type;
+              block_lens[i] = data_info[i].n_elements;
+              indices[i] = (i == 0 ? 0 : indices[i-1]+data_info[i-1].size_in_bytes*data_info[i-1].n_elements);
+              old_types[i] = data_info[i].data_type;
             }
 
           // Create and commit the MPI type

Modified: trunk/aspect/source/particle/output.cc
===================================================================
--- trunk/aspect/source/particle/output.cc	2013-08-14 11:31:29 UTC (rev 1841)
+++ trunk/aspect/source/particle/output.cc	2013-08-15 04:24:01 UTC (rev 1842)
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2011, 2012 by the authors of the ASPECT code.
+ Copyright (C) 2011, 2012, 2013 by the authors of the ASPECT code.
 
  This file is part of ASPECT.
 
@@ -132,13 +132,13 @@
             for (dit=data_info.begin(); dit!=data_info.end(); ++dit)
               {
                 // If it's a 1D element, print just the name, otherwise use []
-                if (dit->_num_elems == 1)
+                if (dit->n_elements == 1)
                   {
-                    output << dit->_name << " ";
+                    output << dit->name << " ";
                   }
                 else
                   {
-                    for (i=0; i<dit->_num_elems; ++i) output << dit->_name << "[" << i << "] ";
+                    for (i=0; i<dit->n_elements; ++i) output << dit->name << "[" << i << "] ";
                   }
               }
             output << "
";
@@ -152,7 +152,7 @@
                 for (dit=data_info.begin(); dit!=data_info.end(); ++dit)
                   {
                     // Currently assumes all data is double, may need to change this
-                    for (i=0; i<dit->_num_elems; ++i)
+                    for (i=0; i<dit->n_elements; ++i)
                       {
                         double val;
                         memcpy (&val, p, sizeof(double));
@@ -295,29 +295,29 @@
             particle_data = new char[T::data_len(HDF5_DATA)];
 
             std::vector<MPIDataInfo>::iterator dit = data_info.begin();
-            data_offset = dit->_num_elems*dit->_elem_size_bytes;
+            data_offset = dit->n_elements*dit->size_in_bytes;
             dit++;
             for (; dit!=data_info.end(); ++dit)
               {
-                output << "        <DataArray type=\"Float64\" Name=\"" << dit->_name << "\" NumberOfComponents=\"" << (dit->_num_elems == 2 ? 3 : dit->_num_elems) << "\" Format=\"ascii\">
";
+                output << "        <DataArray type=\"Float64\" Name=\"" << dit->name << "\" NumberOfComponents=\"" << (dit->n_elements == 2 ? 3 : dit->n_elements) << "\" Format=\"ascii\">
";
                 for (typename std::multimap<LevelInd, T>::const_iterator
                      it=particles.begin(); it!=particles.end(); ++it)
                   {
                     it->second.write_data(HDF5_DATA, particle_data);
                     char *p = particle_data+data_offset;
                     output << "          ";
-                    for (unsigned int d=0; d<dit->_num_elems; ++d)
+                    for (unsigned int d=0; d<dit->n_elements; ++d)
                       {
                         double val;
                         memcpy (&val, p, sizeof(double));
                         output << val << " ";
                         p += sizeof(double);
                       }
-                    if (dit->_num_elems == 2)
+                    if (dit->n_elements == 2)
                       output << "0 ";
                     output << "
";
                   }
-                data_offset += dit->_num_elems*dit->_elem_size_bytes;
+                data_offset += dit->n_elements*dit->size_in_bytes;
                 output << "        </DataArray>
";
               }
             delete[] particle_data;
@@ -348,7 +348,7 @@
 
                 for (dit=data_info.begin()+1; dit!=data_info.end(); ++dit)
                   {
-                    pvtu_output << "      <PDataArray type=\"Float64\" Name=\"" << dit->_name << "\" NumberOfComponents=\"" << (dit->_num_elems == 2 ? 3 : dit->_num_elems) << "\" format=\"ascii\"/>
";
+                    pvtu_output << "      <PDataArray type=\"Float64\" Name=\"" << dit->name << "\" NumberOfComponents=\"" << (dit->n_elements == 2 ? 3 : dit->n_elements) << "\" format=\"ascii\"/>
";
                   }
                 pvtu_output << "    </PPointData>
";
                 for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(this->communicator); ++i)


More information about the CIG-COMMITS mailing list