[cig-commits] [commit] master: Improved the version check for gplates. (7c63f6f)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Sat May 24 14:21:48 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/e2d2428a203331b4832dbc4e5f4d716934c22694...f68c1b584dc0211691228ef830ea1d2538da258d

>---------------------------------------------------------------

commit 7c63f6f46cffe0a2c53f3e5cdc27f743df8da123
Author: Rene Gassmoeller <R.Gassmoeller at mailbox.org>
Date:   Sat May 24 10:11:56 2014 -0500

    Improved the version check for gplates.


>---------------------------------------------------------------

7c63f6f46cffe0a2c53f3e5cdc27f743df8da123
 include/aspect/velocity_boundary_conditions/gplates.h |  2 +-
 source/velocity_boundary_conditions/gplates.cc        | 15 ++++++---------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/include/aspect/velocity_boundary_conditions/gplates.h b/include/aspect/velocity_boundary_conditions/gplates.h
index 56c6384..c16cc15 100644
--- a/include/aspect/velocity_boundary_conditions/gplates.h
+++ b/include/aspect/velocity_boundary_conditions/gplates.h
@@ -251,7 +251,7 @@ namespace aspect
            * origin from 0 to -180 degrees and we need to correct for this.
            */
           bool
-          gplates_1_4_or_higher(boost::property_tree::ptree pt) const;
+          gplates_1_4_or_higher(const boost::property_tree::ptree &pt) const;
       };
     }
 
diff --git a/source/velocity_boundary_conditions/gplates.cc b/source/velocity_boundary_conditions/gplates.cc
index d94dcf3..d5a3740 100644
--- a/source/velocity_boundary_conditions/gplates.cc
+++ b/source/velocity_boundary_conditions/gplates.cc
@@ -511,21 +511,18 @@ namespace aspect
 
 
       bool
-      GPlatesLookup::gplates_1_4_or_higher(boost::property_tree::ptree pt) const
+      GPlatesLookup::gplates_1_4_or_higher(const boost::property_tree::ptree &pt) const
       {
         const std::string gpml_version = pt.get<std::string>("gpml:FeatureCollection.<xmlattr>.gpml:version");
         std::vector<std::string> string_versions = dealii::Utilities::split_string_list(gpml_version,'.');
-        std::vector<int> int_versions;
-        for (std::vector<std::string>::iterator it = string_versions.begin(); it != string_versions.end(); it ++)
-          {
-            int_versions.push_back(dealii::Utilities::string_to_int(*it));
-          }
-        const int gplates_1_4_version[3] = {1,6,325};
+        std::vector<int> int_versions = dealii::Utilities::string_to_int(string_versions);
+
+        const int gplates_1_3_version[3] = {1,6,322};
 
         for (unsigned int i = 0; i < int_versions.size(); i++)
-          if (int_versions[i] < gplates_1_4_version[i]) return false;
+          if (int_versions[i] > gplates_1_3_version[i]) return true;
 
-        return true;
+        return false;
       }
     }
 



More information about the CIG-COMMITS mailing list