]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use numbers comparators in physics standard tensor functions 6349/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 29 Apr 2018 09:20:20 +0000 (11:20 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 29 Apr 2018 10:05:27 +0000 (12:05 +0200)
include/deal.II/physics/elasticity/standard_tensors.h

index a0a9d90a7447425aadd1caf4dffff9f60e95d738..65682d534449c9f4a009c6d2a75490ce03c2862a 100644 (file)
@@ -17,6 +17,7 @@
 #define dealii_elasticity_standard_tensors_h
 
 
+#include <deal.II/base/numbers.h>
 #include <deal.II/base/symmetric_tensor.h>
 #include <deal.II/base/tensor.h>
 
@@ -292,7 +293,7 @@ SymmetricTensor<4, dim, Number>
 Physics::Elasticity::StandardTensors<dim>::Dev_P (const Tensor<2, dim, Number> &F)
 {
   const Number det_F = determinant(F);
-  Assert(det_F > Number(0.0),
+  Assert(numbers::value_is_greater_than(det_F,0.0),
          ExcMessage("Deformation gradient has a negative determinant."));
   const Tensor<2,dim,Number> C_ns = transpose(F)*F;
   const SymmetricTensor<2,dim,Number> C = symmetrize(C_ns);
@@ -316,7 +317,7 @@ SymmetricTensor<4, dim, Number>
 Physics::Elasticity::StandardTensors<dim>::Dev_P_T (const Tensor<2, dim, Number> &F)
 {
   const Number det_F = determinant(F);
-  Assert(det_F > Number(0.0),
+  Assert(numbers::value_is_greater_than(det_F,0.0),
          ExcMessage("Deformation gradient has a negative determinant."));
   const Tensor<2,dim,Number> C_ns = transpose(F)*F;
   const SymmetricTensor<2,dim,Number> C = symmetrize(C_ns);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.