]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Initialize particle locations with invalid numbers. 8537/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 9 Aug 2019 20:22:29 +0000 (14:22 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 9 Aug 2019 20:22:29 +0000 (14:22 -0600)
source/particles/particle.cc
tests/particles/particle_01.cc
tests/particles/particle_01.output

index 070ba49fd474b1ddd614fec682e97dcfed2d6015..b08f23983cd74590292aafecd129017bce91b932 100644 (file)
@@ -13,6 +13,8 @@
 //
 // ---------------------------------------------------------------------
 
+#include <deal.II/base/signaling_nan.h>
+
 #include <deal.II/particles/particle.h>
 
 DEAL_II_NAMESPACE_OPEN
@@ -21,8 +23,8 @@ namespace Particles
 {
   template <int dim, int spacedim>
   Particle<dim, spacedim>::Particle()
-    : location()
-    , reference_location()
+    : location(numbers::signaling_nan<Point<spacedim>>())
+    , reference_location(numbers::signaling_nan<Point<dim>>())
     , id(0)
     , property_pool(nullptr)
     , properties(PropertyPool::invalid_handle)
index 406b1e21ec0c3b28e21ca19280b50b5f55fc51c5..0d0e5335da6e757e5724b44442df1d9da8596fe2 100644 (file)
@@ -29,8 +29,6 @@ test()
   {
     Particles::Particle<dim> particle;
 
-    deallog << "Particle location: " << particle.get_location() << std::endl;
-
     Point<dim> position;
     position(0) = 1.0;
     particle.set_location(position);
index cbfa261dee658fdee140d22ec1454cafdfe61b59..b466e15e4ac3cb4aa5d49573ef48fd6168ad6a61 100644 (file)
@@ -1,7 +1,5 @@
 
-DEAL::Particle location: 0.00000 0.00000
 DEAL::Particle location: 1.00000 0.00000
 DEAL::OK
-DEAL::Particle location: 0.00000 0.00000 0.00000
 DEAL::Particle location: 1.00000 0.00000 0.00000
 DEAL::OK

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.