]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
oops
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Feb 2000 17:55:28 +0000 (17:55 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Feb 2000 17:55:28 +0000 (17:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@2470 0785d39b-7218-0410-832d-ea1e28bc413d

15 files changed:
deal.II/base/source/convergence_table.cc
deal.II/base/source/data_out_base.all_dimensions.cc
deal.II/base/source/data_out_base.cc
deal.II/base/source/exceptions.cc
deal.II/base/source/function.cc
deal.II/base/source/function_lib.cc
deal.II/base/source/job_identifier.cc
deal.II/base/source/log.cc
deal.II/base/source/parameter_handler.cc
deal.II/base/source/quadrature.cc
deal.II/base/source/quadrature_lib.cc
deal.II/base/source/table_handler.cc
deal.II/base/source/tensor.cc
deal.II/base/source/tensor_function.cc
deal.II/base/source/timer.cc

index bf4d181cfdf16a986c6821ae0273b1daef48fb33..d94a2fa5fab926fe2e1132a59cd9fa941631adc7 100644 (file)
@@ -12,6 +12,7 @@
 //----------------------------  convergence_table.cc  ---------------------------
 
 
+#include <base/convergence_table.h>
 #include <math.h>
 
 
index 6a0a13b029ccc29b47ffe287ea84af94bc78a202..1467e4097f1159818678b3d898be432ce6d8928e 100644 (file)
@@ -12,6 +12,7 @@
 //----------------------------  data_out_base.all_dimensions.cc  ---------------------------
 
 
+#include <base/data_out_base.h>
 #include <base/parameter_handler.h>
 
 
index 707e3c7dd638d297bcbebc34716341eeb19bdfd0..b3ffdf6dbca4a2cb8dc302a298d574f516aa89ea 100644 (file)
 //----------------------------  data_out_base.cc  ---------------------------
 
 
-#include \"data.inc\" " << endl;
+#include <base/data_out_base.h>
+#include <base/parameter_handler.h>
+#include <iomanip>
+#include <ctime>
+#include <cmath>
+#include <set>
+
+
+// egcs does not understand this at present.
+//
+// template <int dim>
+// DataOut::Patch<dim>::Patch () :
+//             n_subdivisions (1)
+//                              // all the rest has a constructor of its own
+// {};
+
+
+template <int dim>
+void DataOutBase::write_ucd (const vector<Patch<dim> > &patches,
+                            const vector<string>      &data_names,
+                            const UcdFlags            &flags,
+                            ostream                   &out) 
+{
+  AssertThrow (out, ExcIO());
+
+  Assert (patches.size() > 0, ExcNoPatches());
+  
+  const unsigned int n_data_sets = data_names.size();
+  
+                                  // first count the number of cells
+                                  // and cells for later use
+  unsigned int n_cells = 0,
+              n_nodes = 0;
+  for (vector<Patch<dim> >::const_iterator patch=patches.begin();
+       patch!=patches.end(); ++patch)
+    switch (dim)
+      {
+       case 1:
+             n_cells += patch->n_subdivisions;
+             n_nodes += patch->n_subdivisions+1;
+             break;
+       case 2:
+             n_cells += patch->n_subdivisions *
+                        patch->n_subdivisions;
+             n_nodes += (patch->n_subdivisions+1) *
+                        (patch->n_subdivisions+1);
+             break;
+       case 3:
+             n_cells += patch->n_subdivisions *
+                        patch->n_subdivisions *
+                        patch->n_subdivisions;
+             n_nodes += (patch->n_subdivisions+1) *
+                        (patch->n_subdivisions+1) *
+                        (patch->n_subdivisions+1);
+             break;
+       default:
+             Assert (false, ExcNotImplemented());
+      };
+
+                                  ///////////////////////
+                                  // preamble
+  if (flags.write_preamble)
+    {
+      time_t  time1= time (0);
+      tm     *time = localtime(&time1); 
+      out << "# This file was generated by the deal.II library." << endl
+         << "# Date =  "
+         << time->tm_year+1900 << "/"
+         << time->tm_mon+1 << "/"
+         << time->tm_mday << endl
+         << "# Time =  "
+         << time->tm_hour << ":"
+         << setw(2) << time->tm_min << ":"
+         << setw(2) << time->tm_sec << endl
+         << "#" << endl
+         << "# For a description of the UCD format see the AVS Developer's guide."
+         << endl
+         << "#" << endl;
+    };
+
+                                  // start with ucd data
+  out << n_nodes << ' '
+      << n_cells << ' '
+      << n_data_sets << ' '
+      << 0 << ' '                  // no cell data at present
+      << 0                         // no model data
+      << endl;
+
+                                  ///////////////////////////////
+                                  // first make up the list of used
+                                  // nodes along with their
+                                  // coordinates. number them
+                                  // consecutively starting with 1
+                                  //
+                                  // note that we have to print
+                                  // d=1..3 dimensions
+  if (true)
+    {
+      unsigned int present_node = 1;
+      
+      for (vector<Patch<dim> >::const_iterator patch=patches.begin();
+          patch!=patches.end(); ++patch)
+       {
+         const unsigned int n_subdivisions = patch->n_subdivisions;
+         
+                                          // if we have nonzero values for
+                                          // this coordinate
+         switch (dim)
+           {
+             case 1:
+             {
+               for (unsigned int i=0; i<n_subdivisions+1; ++i, ++present_node)
+                 out << present_node
+                     << "   "
+                     << ((patch->vertices[1](0) * i / n_subdivisions) +
+                         (patch->vertices[0](0) * (n_subdivisions-i) / n_subdivisions))
+                     << " 0 0\n";                        // fill with zeroes
+               break;
+             };
+              
+             case 2:
+             {
+               for (unsigned int i=0; i<n_subdivisions+1; ++i)
+                 for (unsigned int j=0; j<n_subdivisions+1; ++j)
+                   {
+                     const double x_frac = i * 1./n_subdivisions,
+                                  y_frac = j * 1./n_subdivisions;
+                     
+                                                      // compute coordinates for
+                                                      // this patch point
+                     out << present_node
+                         << "  "
+                         << (((patch->vertices[1] * x_frac) +
+                              (patch->vertices[0] * (1-x_frac))) * (1-y_frac) +
+                             ((patch->vertices[2] * x_frac) +
+                              (patch->vertices[3] * (1-x_frac))) * y_frac)
+                         << " 0\n";                   // fill with zeroes
+
+                     ++present_node;
+                   };
+             
+               break;
+             };
+              
+             case 3:
+             {
+               for (unsigned int i=0; i<n_subdivisions+1; ++i)
+                 for (unsigned int j=0; j<n_subdivisions+1; ++j)
+                   for (unsigned int k=0; k<n_subdivisions+1; ++k)
+                     {
+                                                        // note the broken
+                                                        // design of hexahedra
+                                                        // in deal.II, where
+                                                        // first the z-component
+                                                        // is counted up, before
+                                                        // increasing the y-
+                                                        // coordinate
+                       const double x_frac = i * 1./n_subdivisions,
+                                    y_frac = k * 1./n_subdivisions,
+                                    z_frac = j * 1./n_subdivisions;
+                       
+                                                        // compute coordinates for
+                                                        // this patch point
+                       out << present_node
+                           << "  "
+                           << ((((patch->vertices[1] * x_frac) +
+                                 (patch->vertices[0] * (1-x_frac))) * (1-y_frac) +
+                                ((patch->vertices[2] * x_frac) +
+                                 (patch->vertices[3] * (1-x_frac))) * y_frac)   * (1-z_frac) +
+                               (((patch->vertices[5] * x_frac) +
+                                 (patch->vertices[4] * (1-x_frac))) * (1-y_frac) +
+                                ((patch->vertices[6] * x_frac) +
+                                 (patch->vertices[7] * (1-x_frac))) * y_frac)   * z_frac)
+                           << endl;
+                       
+                       ++present_node;
+                     };
+             
+               break;
+             };
+              
+             default:
+                   Assert (false, ExcNotImplemented());
+           };
+       };
+
+                                      // note that we number starting with 1!
+      Assert (present_node == n_nodes+1,
+             ExcInternalError());
+    };
+
+                                  /////////////////////////////////////////
+                                  // write cell. number them consecutively,
+                                  // starting with 1
+  if (true)
+    {
+      unsigned int present_cell = 1;      
+      unsigned int first_vertex_of_patch = 0;
+      
+      for (vector<Patch<dim> >::const_iterator patch=patches.begin();
+          patch!=patches.end(); ++patch)
+       {
+         const unsigned int n_subdivisions = patch->n_subdivisions;
+         
+                                          // write out the cells making
+                                          // up this patch
+         switch (dim)
+           {
+             case 1:
+             {
+               for (unsigned int i=0; i<n_subdivisions; ++i, ++present_cell)
+                 out << present_cell
+                     << " 0  line  "        // set material id to 0
+                     << first_vertex_of_patch+i+1 << ' '
+                     << first_vertex_of_patch+i+1+1 << endl;
+               break;
+             };
+              
+             case 2:
+             {
+               for (unsigned int i=0; i<n_subdivisions; ++i)
+                 for (unsigned int j=0; j<n_subdivisions; ++j)
+                   {
+                     out << present_cell
+                         << " 0  quad  "    // set material id to 0
+                         << first_vertex_of_patch+i*(n_subdivisions+1)+j+1 << ' '
+                         << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1 << ' '
+                         << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1+1 << ' '
+                         << first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1
+                         << endl;
+                     ++present_cell;
+                   };
+               break;
+             };
+              
+             case 3:
+             {
+               for (unsigned int i=0; i<n_subdivisions; ++i)
+                 for (unsigned int j=0; j<n_subdivisions; ++j)
+                   for (unsigned int k=0; k<n_subdivisions; ++k)
+                     {
+                       out << present_cell
+                           << " 0  hex  "    // set material id to 0
+                                                          // note: vertex indices start with 1!
+                           << first_vertex_of_patch+(i*(n_subdivisions+1)+j      )*(n_subdivisions+1)+k  +1 << ' '
+                           << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j  )*(n_subdivisions+1)+k  +1 << ' '
+                           << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k  +1 << ' '
+                           << first_vertex_of_patch+(i*(n_subdivisions+1)+j+1    )*(n_subdivisions+1)+k  +1 << ' '
+                           << first_vertex_of_patch+(i*(n_subdivisions+1)+j      )*(n_subdivisions+1)+k+1+1 << ' '
+                           << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j  )*(n_subdivisions+1)+k+1+1 << ' '
+                           << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1+1 << ' '
+                           << first_vertex_of_patch+(i*(n_subdivisions+1)+j+1    )*(n_subdivisions+1)+k+1+1 << ' '
+                           << endl;
+                       ++present_cell;
+                     };
+               break;
+             };
+
+             default:
+                   Assert (false, ExcNotImplemented());
+           };
+
+
+// finally update the number
+                                          // of the first vertex of this patch
+         switch (dim)
+           {
+             case 1:
+                   first_vertex_of_patch += n_subdivisions+1;
+                   break;
+             case 2:
+                   first_vertex_of_patch += (n_subdivisions+1) *
+                                            (n_subdivisions+1);
+                   break;
+             case 3:
+                   first_vertex_of_patch += (n_subdivisions+1) *
+                                            (n_subdivisions+1) *
+                                            (n_subdivisions+1);
+                   break;
+             default:
+                   Assert (false, ExcNotImplemented());
+           };
+       };
+      out << endl;
+
+                                      // note that we number starting with 1!
+      Assert (present_cell == n_cells+1,
+             ExcInternalError());
+    };
+
+
+/////////////////////////////
+                                  // now write data
+  if (n_data_sets != 0)
+    {      
+      out << n_data_sets << "    ";    // number of vectors
+      for (unsigned int i=0; i<n_data_sets; ++i)
+       out << 1 << ' ';               // number of components;
+                                      // only 1 supported presently
+      out << endl;
+
+      for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+       out << data_names[data_set]
+           << ",dimensionless"      // no units supported at present
+           << endl;
+
+
+// loop over all patches
+      unsigned int present_node = 1;
+      for (typename vector<Patch<dim> >::const_iterator patch=patches.begin();
+          patch != patches.end(); ++patch)
+       {
+         const unsigned int n_subdivisions = patch->n_subdivisions;
+      
+         Assert (patch->data.m() == n_data_sets,
+                 ExcUnexpectedNumberOfDatasets (patch->data.m(), n_data_sets));
+         Assert (patch->data.n() == (dim==1 ?
+                                     n_subdivisions+1 :
+                                     (dim==2 ?
+                                      (n_subdivisions+1)*(n_subdivisions+1) :
+                                      (dim==3 ?
+                                       (n_subdivisions+1)*(n_subdivisions+1)*(n_subdivisions+1) :
+                                       0))),
+                 ExcInvalidDatasetSize (patch->data.n(), n_subdivisions+1));
+
+         switch (dim)
+           {
+             case 1:
+             {      
+               for (unsigned int i=0; i<n_subdivisions+1; ++i, ++present_node) 
+                 {
+                   out << present_node
+                       << "  ";
+                   for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                     out << patch->data(data_set,i) << ' ';
+
+                   out << endl;
+                 };
+           
+               break;
+             };
+          
+             case 2:
+             {
+               for (unsigned int i=0; i<n_subdivisions+1; ++i)
+                 for (unsigned int j=0; j<n_subdivisions+1; ++j)
+                   {
+                     out << present_node
+                         << "  ";
+                     for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                       out << patch->data(data_set,i*(n_subdivisions+1) + j) << ' ';
+
+                     out << endl;
+
+                     ++present_node;
+                   };
+
+               break;
+             };
+
+             case 3:
+             {
+               for (unsigned int i=0; i<n_subdivisions+1; ++i)
+                 for (unsigned int j=0; j<n_subdivisions+1; ++j)
+                   for (unsigned int k=0; k<n_subdivisions+1; ++k)
+                     {
+                       out << present_node
+                           << "  ";
+                       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                         out << patch->data(data_set,
+                                            (i*(n_subdivisions+1)+j)*(n_subdivisions+1)+k)
+                             << ' ';
+                       
+                       out << endl;
+                       
+                       ++present_node;
+                     };
+
+               break;
+             };
+
+             default:
+                   Assert (false, ExcNotImplemented());
+           };
+       };  
+    };
+
+                                  // no model data
+
+                                  // assert the stream is still ok
+  AssertThrow (out, ExcIO());
+};
+
+
+template <int dim>
+void DataOutBase::write_gnuplot (const vector<Patch<dim> > &patches,
+                                const vector<string>      &data_names,
+                                const GnuplotFlags        &/*flags*/,
+                                ostream                   &out) 
+{
+  AssertThrow (out, ExcIO());
+  
+  Assert (patches.size() > 0, ExcNoPatches());
+
+  const unsigned int n_data_sets = data_names.size();
+  
+                                  // write preamble
+  if (true) 
+    {
+                                      // block this to have local
+                                      // variables destroyed after
+                                      // use
+      const time_t  time1= time (0);
+      const tm     *time = localtime(&time1); 
+      out << "# This file was generated by the deal.II library." << endl
+         << "# Date =  "
+         << time->tm_year+1900 << "/"
+         << time->tm_mon+1 << "/"
+         << time->tm_mday << endl
+         << "# Time =  "
+         << time->tm_hour << ":"
+         << setw(2) << time->tm_min << ":"
+         << setw(2) << time->tm_sec << endl
+         << "#" << endl
+         << "# For a description of the GNUPLOT format see the GNUPLOT manual."
+         << endl
+         << "#" << endl
+         << "# ";
+      
+      switch (dim) 
+       {
+         case 1:
+               out << "<x> ";
+               break;
+         case 2:
+               out << "<x> <y> ";
+               break;
+         case 3:
+               out << "<x> <y> <z> ";
+               break;
+               
+         default:
+               Assert (false, ExcNotImplemented());
+       };
+
+      for (unsigned int i=0; i<data_names.size(); ++i)
+       out << '<'
+           << data_names[i]
+           << "> ";
+      out << endl;      
+    };
+
+
+// loop over all patches
+  for (typename vector<Patch<dim> >::const_iterator patch=patches.begin();
+       patch != patches.end(); ++patch)
+    {
+      const unsigned int n_subdivisions = patch->n_subdivisions;
+      
+      Assert (patch->data.m() == n_data_sets,
+             ExcUnexpectedNumberOfDatasets (patch->data.m(), n_data_sets));
+      Assert (patch->data.n() == (dim==1 ?
+                                 n_subdivisions+1 :
+                                 (dim==2 ?
+                                  (n_subdivisions+1)*(n_subdivisions+1) :
+                                  (dim==3 ?
+                                   (n_subdivisions+1)*(n_subdivisions+1)*(n_subdivisions+1) :
+                                   0))),
+             ExcInvalidDatasetSize (patch->data.n(), n_subdivisions+1));
+
+      switch (dim)
+       {
+         case 1:
+         {      
+           for (unsigned int i=0; i<n_subdivisions+1; ++i) 
+             {
+                                                // compute coordinates for
+                                                // this patch point
+               out << ((patch->vertices[1] * i / n_subdivisions) +
+                       (patch->vertices[0] * (n_subdivisions-i) / n_subdivisions))
+                   << ' ';
+
+               for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                 out << patch->data(data_set,i) << ' ';
+
+               out << endl;
+             };
+
+                                            // end of patch
+           out << endl
+               << endl;
+           
+           break;
+         };
+          
+         case 2:
+         {
+           for (unsigned int i=0; i<n_subdivisions+1; ++i)
+             {
+               for (unsigned int j=0; j<n_subdivisions+1; ++j)
+                 {
+                   const double x_frac = i * 1./n_subdivisions,
+                                y_frac = j * 1./n_subdivisions;
+                   
+                                                    // compute coordinates for
+                                                    // this patch point
+                   out << (((patch->vertices[1] * x_frac) +
+                            (patch->vertices[0] * (1-x_frac))) * (1-y_frac) +
+                           ((patch->vertices[2] * x_frac) +
+                            (patch->vertices[3] * (1-x_frac))) * y_frac)
+                       << ' ';
+                   
+                   for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                     out << patch->data(data_set,i*(n_subdivisions+1) + j) << ' ';
+
+                   out << endl;
+                 };
+
+                                                // end of row in patch
+               out << endl;
+             };
+
+                                            // end of patch
+           out << endl;
+
+           break;
+         };
+
+         case 3:
+         {
+                                            // for all grid points: draw
+                                            // lines into all positive
+                                            // coordinate directions if
+                                            // there is another grid point
+                                            // there
+           for (unsigned int i=0; i<n_subdivisions+1; ++i)
+             for (unsigned int j=0; j<n_subdivisions+1; ++j)
+               for (unsigned int k=0; k<n_subdivisions+1; ++k)
+                 {
+                                                    // note the broken
+                                                    // design of hexahedra
+                                                    // in deal.II, where
+                                                    // first the z-component
+                                                    // is counted up, before
+                                                    // increasing the y-
+                                                    // coordinate
+                   const double x_frac = i * 1./n_subdivisions,
+                                y_frac = k * 1./n_subdivisions,
+                                z_frac = j * 1./n_subdivisions;
+
+                                                    // compute coordinates for
+                                                    // this patch point
+                   const Point<dim> this_point
+                     = ((((patch->vertices[1] * x_frac) +
+                          (patch->vertices[0] * (1-x_frac))) * (1-y_frac) +
+                         ((patch->vertices[2] * x_frac) +
+                          (patch->vertices[3] * (1-x_frac))) * y_frac)   * (1-z_frac) +
+                        (((patch->vertices[5] * x_frac) +
+                          (patch->vertices[4] * (1-x_frac))) * (1-y_frac) +
+                         ((patch->vertices[6] * x_frac) +
+                          (patch->vertices[7] * (1-x_frac))) * y_frac)   * z_frac);
+
+                                                    // line into positive x-direction
+                                                    // if possible
+                   if (i < n_subdivisions)
+                     {
+                                                        // write point here
+                                                        // and its data
+                       out << this_point;
+                       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                         out  << ' '
+                              << patch->data(data_set,
+                                             (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
+                       out << endl;
+                       
+                                                        // write point there
+                                                        // and its data
+                       const double x_frac_new = x_frac + 1./n_subdivisions;
+                       out << ((((patch->vertices[1] * x_frac_new) +
+                                 (patch->vertices[0] * (1-x_frac_new))) * (1-y_frac) +
+                                ((patch->vertices[2] * x_frac_new) +
+                                 (patch->vertices[3] * (1-x_frac_new))) * y_frac)   * (1-z_frac) +
+                               (((patch->vertices[5] * x_frac_new) +
+                                 (patch->vertices[4] * (1-x_frac_new))) * (1-y_frac) +
+                                ((patch->vertices[6] * x_frac_new) +
+                                 (patch->vertices[7] * (1-x_frac_new))) * y_frac)   * z_frac);
+                       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                         out  << ' '
+                              << patch->data(data_set,
+                                             ((i+1)*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
+                       out << endl;
+
+                                                        // end of line
+                       out << endl
+                           << endl;
+                     };
+                   
+                                                    // line into positive y-direction
+                                                    // if possible
+                   if (j < n_subdivisions)
+                     {
+                                                        // write point here
+                                                        // and its data
+                       out << this_point;
+                       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                         out  << ' '
+                              << patch->data(data_set,
+                                             (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
+                       out << endl;
+                       
+                                                        // write point there
+                                                        // and its data
+                       const double z_frac_new = z_frac + 1./n_subdivisions;
+                       out << ((((patch->vertices[1] * x_frac) +
+                                 (patch->vertices[0] * (1-x_frac))) * (1-y_frac) +
+                                ((patch->vertices[2] * x_frac) +
+                                 (patch->vertices[3] * (1-x_frac))) * y_frac)   * (1-z_frac_new) +
+                               (((patch->vertices[5] * x_frac) +
+                                 (patch->vertices[4] * (1-x_frac))) * (1-y_frac) +
+                                ((patch->vertices[6] * x_frac) +
+                                 (patch->vertices[7] * (1-x_frac))) * y_frac)   * z_frac_new);
+                       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                         out  << ' '
+                              << patch->data(data_set,
+                                             (i*(n_subdivisions+1) + (j+1))*(n_subdivisions+1)+k);
+                       out << endl;
+
+                                                        // end of line
+                       out << endl
+                           << endl;
+                     };
+
+                                                    // line into positive z-direction
+                                                    // if possible
+                   if (k < n_subdivisions)
+                     {
+                                                        // write point here
+                                                        // and its data
+                       out << this_point;
+                       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                         out  << ' '
+                              << patch->data(data_set,
+                                             (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
+                       out << endl;
+                       
+                                                        // write point there
+                                                        // and its data
+                       const double y_frac_new = y_frac + 1./n_subdivisions;
+                       out << ((((patch->vertices[1] * x_frac) +
+                                 (patch->vertices[0] * (1-x_frac))) * (1-y_frac_new) +
+                                ((patch->vertices[2] * x_frac) +
+                                 (patch->vertices[3] * (1-x_frac))) * y_frac_new)   * (1-z_frac) +
+                               (((patch->vertices[5] * x_frac) +
+                                 (patch->vertices[4] * (1-x_frac))) * (1-y_frac_new) +
+                                ((patch->vertices[6] * x_frac) +
+                                 (patch->vertices[7] * (1-x_frac))) * y_frac_new)   * z_frac);
+                       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
+                         out  << ' '
+                              << patch->data(data_set,
+                                             (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k+1);
+                       out << endl;
+
+                                                        // end of line
+                       out << endl
+                           << endl;
+                     };                    
+                       
+                 };
+
+           break;
+         };
+
+         default:
+               Assert (false, ExcNotImplemented());
+       };
+    };
+
+  AssertThrow (out, ExcIO());
+};
+
+
+template <int dim>
+void DataOutBase::write_povray (const vector<Patch<dim> > &patches,
+                               const vector<string>      &data_names,
+                               const PovrayFlags         &flags,
+                               ostream                   &out) 
+{
+  AssertThrow (out, ExcIO());
+  
+  Assert (patches.size() > 0, ExcNoPatches());
+  Assert (dim==2, ExcNotImplemented());        // only for 2-D  
+
+  const unsigned int n_data_sets = data_names.size();
+  
+                                    // write preamble
+  if (true) 
+    {
+                                    // block this to have local
+                                    // variables destroyed after use
+      const time_t  time1= time (0);
+      const tm     *time = localtime(&time1); 
+      out << "/* This file was generated by the deal.II library." << endl
+         << "   Date =  "
+         << time->tm_year+1900 << "/"
+         << time->tm_mon+1 << "/"
+         << time->tm_mday << endl
+         << "   Time =  "
+         << time->tm_hour << ":"
+         << setw(2) << time->tm_min << ":"
+         << setw(2) << time->tm_sec << endl
+         << endl
+         << "   For a description of the POVRAY format see the POVRAY manual."
+         << endl
+         << "*/ " << endl;
+      
+                                    // include files
+      out << "#include \"colors.inc\" " << endl
+         << "#include \"textures.inc\" " << endl;
+
+
+// use external include file for textures,
+                                    // camera and light
+      if (flags.external_data)
+       out << "#include \"data.inc\" " << endl;
       else                          // all definitions in data file
        {  
                                     // camera
index e5109b1a3903221a400907ae8b9cfd332bbe4f05..2cff5a7e34215c0c77cd272a77448084317662c5 100644 (file)
@@ -12,6 +12,8 @@
 //----------------------------  exceptions.cc  ---------------------------
 
 
+#include <base/exceptions.h>
+#include <string>
 #include <strstream>
 
 
index 794d994b6ac6eaa5a65c3ddac13e64c3b251ea09..244b0c6d1fd501a9d0cfb1615eceefe2955f83b2 100644 (file)
@@ -12,6 +12,9 @@
 //----------------------------  function.cc  ---------------------------
 
 
+#include <base/function.h>
+#include <base/point.h>
+#include <lac/vector.h>
 #include <vector>
 
 
index 9a5a142db8f35ac92cf5c96e15dfe7fe6fb20322..d5df1d87ca9aded215c180a3689b6d2c4166a7aa 100644 (file)
@@ -12,6 +12,9 @@
 //----------------------------  function_lib.cc  ---------------------------
 
 
+#include <base/point.h>
+#include <base/function_lib.h>
+
 #include <cmath>
 
 //TODO: Derivatives in 3d wrong (GK!)
index 4fe1a813695caac312935d7430a3557523a7a86d..3bbc1df6e01515479cf95b5907d2afda290e0415 100644 (file)
@@ -12,6 +12,7 @@
 //----------------------------  job_identifier.cc  ---------------------------
 
 
+#include <base/job_identifier.h>
 #include <ctime>
 
 
index dfc27ff29ac30b04e20d3f6672fa7b5232b8c7b7..a799ae2b1ea03bbadacabfb675226b33e85df68a 100644 (file)
 //----------------------------  log.cc  ---------------------------
 
 
+#include <base/logstream.h>
+#include <base/job_identifier.h>
+
+#include <sys/resource.h>
 #include <iomanip>
 
 LogStream deallog;
index c602aab557a47b8e69133728dfd3ae6b38ef0a86..d70ae47a54f5a761396a1b3e9640491d8ade77a5 100644 (file)
 //----------------------------  parameter_handler.cc  ---------------------------
 
 
+#include <base/parameter_handler.h>
+#include <fstream>
+#include <iomanip>
+#include <strstream>
+#include <cstdlib>
+#include <algorithm>
 #include <list>
 
 
index 65afff7526bf6fcfff35fc732a07142bc840df33..6c817780a5975597b6aa2a84c1971c4bbda5dd62 100644 (file)
@@ -12,6 +12,7 @@
 //----------------------------  quadrature.cc  ---------------------------
 
 
+#include <base/quadrature.h>
 #include <cmath>
 
 
index 30117523b17aa556b050435f84a289cf0060a85d..b4bc6549f3af583a1745235ba1134e77aef53997 100644 (file)
@@ -12,6 +12,7 @@
 //----------------------------  quadrature_lib.cc  ---------------------------
 
 
+#include <base/quadrature_lib.h>
 #include <cmath>
 
 
index 32f368827790576ee8caf2d6b3d74563e1ebe595..6b2eea8517dffce315c3c4b15a016d986aac0c27 100644 (file)
@@ -12,6 +12,9 @@
 //----------------------------  table_handler.cc  ---------------------------
 
 
+#include <base/table_handler.h>
+
+#include <iostream>
 #include <iomanip>
 
 
index 74d5b2ebf114a2735cdcc5f05b2e74eec03a6476..bcab0b9673134db9c422114b8bd0ab244e006a8b 100644 (file)
@@ -12,6 +12,8 @@
 //----------------------------  tensor.cc  ---------------------------
 
 
+#include <base/tensor.h>
+#include <cmath>
 #include <lac/vector.h>
 
 
index 6fc4e4fdb22245f3725503c487142e42f1ae4387..a625d9b79fcef1daf461c3d51ece4b2acf507b4f 100644 (file)
 //----------------------------  tensor_function.cc  ---------------------------
 
 
+#include <base/tensor_function.h>
+#include <vector>
+#include <base/tensor.h>
+#include <cmath>
 #include <lac/vector.h>
 
 
index 9c17fd95734e520f6ccef44f1500ceff89feaf81..c87e0bd688625e2d714ae92bc7880b031630cfcf 100644 (file)
 //----------------------------  timer.cc  ---------------------------
 
 
+#include <base/timer.h>
+
+
+// these includes should probably be properly
+// ./configure'd using the AC_HEADER_TIME macro:
+#include <sys/resource.h>
 #include <sys/time.h>
 
 Timer::Timer()

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.