← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3898: Produce meaningful error message.

 

------------------------------------------------------------
revno: 3898
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2014-04-09 16:03:16 +0200
message:
  Produce meaningful error message.
modified:
  pkg/common/SPHEngine.cpp
  pkg/common/SPHEngine.hpp
  pkg/dem/ViscoelasticPM.hpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/common/SPHEngine.cpp'
--- pkg/common/SPHEngine.cpp	2014-04-09 14:03:16 +0000
+++ pkg/common/SPHEngine.cpp	2014-04-09 14:03:16 +0000
@@ -217,7 +217,7 @@
 
 KernelFunction returnKernelFunction(const int a, const int b, const typeKernFunctions typeF) {
   if (a != b) {
-    throw runtime_error("Kernel types should be equal! KERNELFUNCDESCR");
+    throw runtime_error("Kernel types should be equal!");
   }
   if (a==Poly6) {
     if (typeF==Norm) {
@@ -227,7 +227,7 @@
     } else if (typeF==Lapl) {
       return smoothkernelPoly6Lapl;
     } else {
-      throw runtime_error("Type of kernel function undefined! KERNELFUNCDESCR");
+      KERNELFUNCDESCR
     }
   } else if (a==Spiky) {
     if (typeF==Norm) {
@@ -237,7 +237,7 @@
     } else if (typeF==Lapl) {
       return smoothkernelSpikyLapl;
     } else {
-      throw runtime_error("Type of kernel function undefined! KERNELFUNCDESCR");
+      KERNELFUNCDESCR
     }
   } else if (a==Visco) {
     if (typeF==Norm) {
@@ -256,7 +256,7 @@
     } else if (typeF==Lapl) {
       return smoothkernelLucyLapl;
     } else {
-      throw runtime_error("Type of kernel function undefined! KERNELFUNCDESCR");
+      KERNELFUNCDESCR
     }
   } else if (a==Monaghan) {
     if (typeF==Norm) {
@@ -266,10 +266,10 @@
     } else if (typeF==Lapl) {
       return smoothkernelMonaghanLapl;
     } else {
-      throw runtime_error("Type of kernel function undefined! KERNELFUNCDESCR");
+      KERNELFUNCDESCR
     }
   } else {
-    throw runtime_error("Type of kernel function undefined! KERNELFUNCDESCR!");
+    KERNELFUNCDESCR
   }
 }
 

=== modified file 'pkg/common/SPHEngine.hpp'
--- pkg/common/SPHEngine.hpp	2014-04-09 14:03:16 +0000
+++ pkg/common/SPHEngine.hpp	2014-04-09 14:03:16 +0000
@@ -7,7 +7,7 @@
 typedef Real (* KernelFunction)(const double & r, const double & h);
 
 enum KernFunctions {Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5};
-#define KERNELFUNCDESCR The following kernel functions are available: Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5.
+#define KERNELFUNCDESCR throw runtime_error("Type of kernel function undefined! The following kernel functions are available: Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5.");
 
 enum typeKernFunctions {Norm, Grad, Lapl};
 class SPHEngine: public PartialEngine{
@@ -18,7 +18,7 @@
     ((int, mask,-1,, "Bitmask for SPH-particles."))
     ((Real,k,-1,,    "Gas constant for SPH-interactions (only for SPH-model). See Mueller [Mueller2003]_ .")) // [Mueller2003], (11)
     ((Real,rho0,-1,, "Rest density. See Mueller [Mueller2003]_ ."))                                           // [Mueller2003], (1)
-    ((int,KernFunctionDensity, Poly6,, "Kernel function for density calculation (by default - Poly6). KERNELFUNCDESCR"))
+    ((int,KernFunctionDensity, Poly6,, "Kernel function for density calculation (by default - Poly6). The following kernel functions are available: Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5."))
   );
 };
 REGISTER_SERIALIZABLE(SPHEngine);

=== modified file 'pkg/dem/ViscoelasticPM.hpp'
--- pkg/dem/ViscoelasticPM.hpp	2014-04-09 14:03:16 +0000
+++ pkg/dem/ViscoelasticPM.hpp	2014-04-09 14:03:16 +0000
@@ -35,8 +35,8 @@
 #ifdef YADE_SPH
 		((bool,SPHmode,false,,"True, if SPH-mode is enabled."))
 		((Real,mu,-1,, "Viscosity. See Mueller [Mueller2003]_ ."))                                              // [Mueller2003], (14)
-		((int,KernFunctionPressure,Spiky,, "Kernel function for pressure calculation (by default - Spiky). KERNELFUNCDESCR"))
-		((int,KernFunctionVisco,   Visco,, "Kernel function for viscosity calculation (by default - Visco). KERNELFUNCDESCR"))
+		((int,KernFunctionPressure,Spiky,, "Kernel function for pressure calculation (by default - Spiky). The following kernel functions are available: Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5."))
+		((int,KernFunctionVisco,   Visco,, "Kernel function for viscosity calculation (by default - Visco). The following kernel functions are available: Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5."))
 #endif
 		((unsigned int,mRtype,1,,"Rolling resistance type, see [Zhou1999536]_. mRtype=1 - equation (3) in [Zhou1999536]_; mRtype=2 - equation (4) in [Zhou1999536]_.")),
 		createIndex();