// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001 by Wolfgang Bangerth
+// std::copyright (C) 1998, 1999, 2000, 2001 by Wolfgang Bangerth
//
// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
+// without std::copyright and license information. Please refer
// to the file deal.II/doc/license.html for the text and
// further information on this license.
//
#include <numerics/time_dependent.h>
#include <dofs/dof_handler.h>
#include <dofs/dof_tools.h>
+#include <dofs/dof_constraints.h>
#include <lac/sparse_matrix.h>
#include <lac/full_matrix.h>
#include <base/parameter_handler.h>
#include <base/forward_declarations.h>
#include <lac/forward_declarations.h>
#include <grid/forward_declarations.h>
+#include <lac/vector.h>
#include <fstream>
#include <string>
#include <iostream>
#include <list>
-ofstream logfile("wave-test-3.output");
+using namespace std;
+
+std::ofstream logfile("wave-test-3.output");
class UserMatrix;
class SweepInfo;
const TimeStep_Primal<dim> & get_timestep_primal () const;
const TimeStep_Dual<dim> & get_timestep_dual () const;
const TimeStep_Postprocess<dim> & get_timestep_postprocess () const;
- string tmp_filename_base (const string &branch_signature) const;
+ std::string tmp_filename_base (const std::string &branch_signature) const;
void attach_sweep_info (SweepInfo &sweep_info);
void attach_sweep_data (SweepData<dim> &sweep_data);
class TimeStep_Wave : public virtual TimeStepBase_Wave<dim>
{
public:
- TimeStep_Wave (const string fe_name);
+ TimeStep_Wave (const std::string fe_name);
~TimeStep_Wave();
virtual void wake_up (const unsigned int wakeup_level);
virtual void sleep (const unsigned int sleep_level);
unsigned int solve (const UserMatrix &matrix,
Vector<double> &solution,
const Vector<double> &rhs) const;
- virtual string branch_signature () const = 0;
+ virtual std::string branch_signature () const = 0;
DeclException0 (ExcIO);
DeclException0 (ExcCoarsestGridsDiffer);
const unsigned int n_dofs,
const unsigned int n_solver_steps_helmholtz,
const unsigned int n_solver_steps_projection,
- const pair<double,double> energy);
- static void write_descriptions (ostream &out);
- void write (ostream &out) const;
+ const std::pair<double,double> energy);
+ static void write_descriptions (std::ostream &out);
+ void write (std::ostream &out) const;
unsigned int n_active_cells;
unsigned int n_dofs;
unsigned int n_solver_steps_helmholtz;
unsigned int n_solver_steps_projection;
- pair<double,double> energy;
+ std::pair<double,double> energy;
};
DoFHandler<dim> *dof_handler;
const Vector<double> &old_grid_v,
Vector<double> &old_u,
Vector<double> &old_v) const;
- pair<double,double> compute_energy ();
+ std::pair<double,double> compute_energy ();
template <int anydim> friend class DualFunctional;
template <int anydim> friend class EvaluationBase;
template <int anydim> friend class TimeStep_ErrorEstimation;
class TimeStep_Primal : public TimeStep_Wave<dim>
{
public:
- TimeStep_Primal (const string &primal_fe);
+ TimeStep_Primal (const std::string &primal_fe);
void do_initial_step ();
void do_timestep ();
virtual void solve_primal_problem ();
- virtual string branch_signature () const;
+ virtual std::string branch_signature () const;
virtual void wake_up (const unsigned int wakeup_level);
virtual void end_sweep ()
{
class TimeStep_Dual : public TimeStep_Wave<dim>
{
public:
- TimeStep_Dual (const string &dual_fe);
+ TimeStep_Dual (const std::string &dual_fe);
void do_initial_step ();
void do_timestep ();
virtual void solve_dual_problem ();
- virtual string branch_signature () const;
+ virtual std::string branch_signature () const;
virtual void wake_up (const unsigned int wakeup_level);
virtual void end_sweep ()
virtual void sleep (const unsigned int sleep_level);
virtual void get_tria_refinement_criteria (Vector<float> &indicators) const;
void get_error_indicators (Vector<float> &indicators) const;
- virtual string branch_signature () const = 0;
+ virtual std::string branch_signature () const = 0;
protected:
struct StatisticData
{
StatisticData ();
StatisticData (const double estimated_error);
- static void write_descriptions (ostream &out);
- void write (ostream &out) const;
+ static void write_descriptions (std::ostream &out);
+ void write (std::ostream &out) const;
double estimated_error;
};
struct CellwiseError
{
CellwiseError (const unsigned int n_errors);
- vector<ErrorOnCell> errors;
- typename vector<ErrorOnCell>::iterator next_free_slot;
+ std::vector<ErrorOnCell> errors;
+ typename ErrorOnCell* next_free_slot;
};
Vector<float> estimated_error_per_cell;
virtual void wake_up (const unsigned int wakeup_level);
virtual void sleep (const unsigned int sleep_level);
virtual void end_sweep ();
- string branch_signature () const;
+ std::string branch_signature () const;
protected:
struct StatisticData
{
- static void write_descriptions (ostream &out,
+ static void write_descriptions (std::ostream &out,
const WaveParameters<dim> ¶meters);
- void write (ostream &out) const;
- vector<double> evaluation_results;
+ void write (std::ostream &out) const;
+ std::vector<double> evaluation_results;
};
StatisticData statistic_data;
virtual void wake_up (const unsigned int wakeup_level);
virtual void sleep (const unsigned int sleep_level);
virtual void end_sweep ();
- static void write_statistics_descriptions (ostream &out,
+ static void write_statistics_descriptions (std::ostream &out,
const WaveParameters<dim> ¶meters);
- void write_statistics (ostream &out) const;
+ void write_statistics (std::ostream &out) const;
};
template <int dim> class TimeStep_Primal;
*
* Default is: do nothing.
*/
- virtual void print_final_result (ostream &out);
+ virtual void print_final_result (std::ostream &out);
/**
* Return the final result as a number
virtual double get_final_result ();
/**
- * Return a brief string of description
+ * Return a brief std::string of description
* which will go into the first line
* of the "results" file.
*/
- virtual string description () const = 0;
+ virtual std::string description () const = 0;
/**
* Exception.
* Base of the filenames under which
* we shall store our results.
*/
- string base_file_name;
+ std::string base_file_name;
};
integrated_value (0) {};
virtual double evaluate ();
- virtual void print_final_result (ostream &out);
+ virtual void print_final_result (std::ostream &out);
virtual double get_final_result ();
- virtual string description () const;
+ virtual std::string description () const;
/**
* Reset the average value to zero.
virtual double evaluate ();
- virtual void print_final_result (ostream &out);
+ virtual void print_final_result (std::ostream &out);
virtual double get_final_result ();
- virtual string description () const;
+ virtual std::string description () const;
/**
* Reset the value to zero.
virtual double evaluate ();
- virtual void print_final_result (ostream &out);
+ virtual void print_final_result (std::ostream &out);
virtual double get_final_result ();
- virtual string description () const;
+ virtual std::string description () const;
/**
* Reset the value to zero.
virtual double evaluate ();
- virtual void print_final_result (ostream &out);
+ virtual void print_final_result (std::ostream &out);
virtual double get_final_result ();
- virtual string description () const;
+ virtual std::string description () const;
/**
* Reset the value to zero.
virtual double evaluate ();
- virtual void print_final_result (ostream &out);
+ virtual void print_final_result (std::ostream &out);
virtual double get_final_result ();
- virtual string description () const;
+ virtual std::string description () const;
/**
* Reset the value to zero.
virtual double evaluate ();
- virtual void print_final_result (ostream &out);
+ virtual void print_final_result (std::ostream &out);
virtual double get_final_result ();
- virtual string description () const;
+ virtual std::string description () const;
/**
* Reset the value to zero.
template <int dim>
- void write_summary (const list<EvaluationBase<dim>*> & eval_list,
- ostream &out) const;
+ void write_summary (const std::list<EvaluationBase<dim>*> & eval_list,
+ std::ostream &out) const;
private:
Data data;
-string int_to_string (const unsigned int i, const unsigned int digits);
+std::string int_to_string (const unsigned int i, const unsigned int digits);
template <typename number>
* element specified by the name
* #name#.
*/
- static const FiniteElement<dim> & get_fe (const string &name);
+ static const FiniteElement<dim> & get_fe (const std::string &name);
/**
* Return the correct domain quadrature
* formula for the finite element denoted
* by the name #name#.
*/
- static const Quadrature<dim> & get_quadrature (const string &name);
+ static const Quadrature<dim> & get_quadrature (const std::string &name);
/**
* Return the correct boundary quadrature
* formula for the finite element denoted
* by the name #name#.
*/
- static const Quadrature<dim-1> & get_quadrature_face (const string &name);
+ static const Quadrature<dim-1> & get_quadrature_face (const std::string &name);
};
*
* \section{Description of the input parameters}
*
- * Note that this list may not be up-tp-date at present.
+ * Note that this std::list may not be up-tp-date at present.
*
* \subsection{Subsection #Grid#}
* \begin{itemize}
* @begin{itemize}
* @item #Initial refinement#: States how often the grid named by the above
* parameter shall be globally refined to form the coarse mesh.
- * @item #Maximum refinement#: maximum refinement level a cell may attain.
+ * @item #Maximum refinement#: std::maximum refinement level a cell may attain.
* Cells with such a refinement level are flagged as others are, but they
* are not refined any more; it is therefore not necessary to lower the
* fraction of cells to be refined in order to avoid the refinement of a
void delete_parameters ();
/**
- * Enum holding a list of possible coarse
+ * Enum holding a std::list of possible coarse
* mesh choices.
*/
enum InitialMesh {
};
/**
- * Enum holding a list of possible
+ * Enum holding a std::list of possible
* boundary condition choices.
*/
enum BoundaryConditions {
/**
* Level of initial refinement, i.e. the
- * minimum level cells on all grids at
+ * std::minimum level cells on all grids at
* all times need to have.
*/
unsigned int initial_refinement;
/**
- * Maximum refinement level a cell may
+ * std::maximum refinement level a cell may
* have. This one defaults to zero,
* meaning no limit.
*/
* are to be refined (first) and
* coarsened (second).
*/
- pair<double,double> refinement_fraction;
+ std::pair<double,double> refinement_fraction;
/**
* Fraction by which the number of cells
* (first: top deviation, second: bottom
* deviation).
*/
- pair<double,double> cell_number_corridor;
+ std::pair<double,double> cell_number_corridor;
/**
* Number of iterations to be performed
* Directory to which we want the output
* written.
*/
- string output_directory;
+ std::string output_directory;
/**
* Directory to which we want the temporary
* file to be written.
*/
- string tmp_directory;
+ std::string tmp_directory;
/**
* Format in which the results on the
* meshes is to be written to files.
*/
- string output_format;
+ std::string output_format;
/**
* Denotes in which sweeps the solution is
* How to break the intervals: linear
* or logarithmic.
*/
- string error_statistics_scaling;
+ std::string error_statistics_scaling;
/**
* Names of the finite element classes to
* be used for the primal and dual problems.
*/
- string primal_fe, dual_fe;
+ std::string primal_fe, dual_fe;
/**
* Strategy for mesh refinement.
unsigned int number_of_sweeps;
/**
- * List of operations which shall be
+ * std::list of operations which shall be
* done on each time step after finishing
* a sweep.
*/
- list<EvaluationBase<dim>*> eval_list;
+ std::list<EvaluationBase<dim>*> eval_list;
/**
* Symbolic name of the boundary conditions
* Exception.
*/
DeclException1 (ExcParameterNotInList,
- string,
+ std::string,
<< "The given parameter <" << arg1 << "> is not "
<< "recognized to be a valid one.");
private:
/**
- * Undefined copy constructor.
+ * Undefined std::copy constructor.
*/
WaveParameters (const WaveParameters &);
/**
- * Undefined copy operator.
+ * Undefined std::copy operator.
*/
WaveParameters & operator = (const WaveParameters &);
/**
- * List of names for the initial values.
+ * std::list of names for the initial values.
* Make this a member of the templated
* class since the supported initial
* values could be different from
* dimension to dimension.
*/
- static const string initial_value_names;
+ static const std::string initial_value_names;
/**
* Names of coefficient functions. The
* same applies as for
* #initial_value_names#.
*/
- static const string coefficient_names;
+ static const std::string coefficient_names;
/**
* Names of boundary value functions. The
* same applies as for
* #initial_value_names#.
*/
- static const string boundary_function_names;
+ static const std::string boundary_function_names;
/**
* Names of error functionals. The
* same applies as for
* #initial_value_names#.
*/
- static const string dual_functional_names;
+ static const std::string dual_functional_names;
/**
* Set the initial function pointers
* depending on the given names.
*/
- void set_initial_functions (const string &u_name,
- const string &v_name);
+ void set_initial_functions (const std::string &u_name,
+ const std::string &v_name);
/**
* Set the coefficient functions.
*/
- void set_coefficient_functions (const string &name);
+ void set_coefficient_functions (const std::string &name);
/**
* Set the boundary values.
*/
- void set_boundary_functions (const string &name);
+ void set_boundary_functions (const std::string &name);
/**
- * Make a list of evaluations to be
+ * Make a std::list of evaluations to be
* performed after each sweep.
*/
- void make_eval_list (const string &names);
+ void make_eval_list (const std::string &names);
/**
* Set the dual functional after
* which the dual solution will be
* computed.
*/
- void set_dual_functional (const string &name);
+ void set_dual_functional (const std::string &name);
/**
* Create the coarse grid for
* this run.
*/
- void make_coarse_grid (const string &name);
+ void make_coarse_grid (const std::string &name);
};
virtual void create_new (const unsigned int run_no);
/**
- * Make the list of parameters known
+ * Make the std::list of parameters known
* to the parameter handler. This
* function only delegates its work
* to the #parameters# sub-object.
virtual void declare_parameters (ParameterHandler &prm);
/**
- * Parse the list of parameters given
+ * Parse the std::list of parameters given
* by the parameter handler. This
* function only delegates its work
* to the #parameters# sub-object.
FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- vector<Tensor<1,dim> > local_u_grad (n_q_points);
- vector<double> local_v (n_q_points);
+ std::vector<Tensor<1,dim> > local_u_grad (n_q_points);
+ std::vector<double> local_v (n_q_points);
- vector<double> density_values(quadrature->n_quadrature_points);
- vector<double> stiffness_values(quadrature->n_quadrature_points);
+ std::vector<double> density_values(quadrature->n_quadrature_points);
+ std::vector<double> stiffness_values(quadrature->n_quadrature_points);
- vector<unsigned int> cell_dof_indices (dofs_per_cell);
+ std::vector<unsigned int> cell_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell, ++primal_cell)
{
stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
- const vector<vector<Tensor<1,dim> > > &shape_grads = fe_values.get_shape_grads ();
+ const std::vector<std::vector<Tensor<1,dim> > > &shape_grads = fe_values.get_shape_grads ();
const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
- const vector<double> &JxW_values (fe_values.get_JxW_values());
+ const std::vector<double> &JxW_values (fe_values.get_JxW_values());
- vector<double> local_functional1 (dofs_per_cell, 0);
- vector<double> local_functional2 (dofs_per_cell, 0);
+ std::vector<double> local_functional1 (dofs_per_cell, 0);
+ std::vector<double> local_functional2 (dofs_per_cell, 0);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
for (unsigned int point=0; point<n_q_points; ++point)
{
cell = dof->begin_active();
endc = dof->end();
- vector<unsigned int> cell_dof_indices (dofs_per_cell);
+ std::vector<unsigned int> cell_dof_indices (dofs_per_cell);
FEFaceValues<dim> fe_face_values (*fe, *quadrature_face,
UpdateFlags(update_values |
fe_face_values.reinit (cell, face_no);
const FullMatrix<double> &shape_values = fe_face_values.
get_shape_values ();
- const vector<double> &JxW_values (fe_face_values.
+ const std::vector<double> &JxW_values (fe_face_values.
get_JxW_values());
- const vector<Point<dim> > &q_points (fe_face_values.get_quadrature_points());
+ const std::vector<Point<dim> > &q_points (fe_face_values.get_quadrature_points());
- vector<double> local_integral (dofs_per_cell, 0);
+ std::vector<double> local_integral (dofs_per_cell, 0);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
for (unsigned int point=0; point<n_q_points; ++point)
local_integral[shape_func] += shape_values(shape_func,point) *
cell = dof->begin_active();
endc = dof->end();
- vector<unsigned int> face_dof_indices (face_dofs);
+ std::vector<unsigned int> face_dof_indices (face_dofs);
for (; cell!=endc; ++cell)
for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
cell = dof->begin_active();
endc = dof->end();
- vector<unsigned int> dof_indices (fe->dofs_per_cell);
+ std::vector<unsigned int> dof_indices (fe->dofs_per_cell);
FEFaceValues<dim> fe_face_values (*fe, *quadrature_face, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
fe_face_values.reinit (cell, face_no);
const FullMatrix<double> &shape_values = fe_face_values.get_shape_values ();
- const vector<double> &JxW_values = fe_face_values.get_JxW_values();
+ const std::vector<double> &JxW_values = fe_face_values.get_JxW_values();
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
endc = dof->end ();
FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
- vector<unsigned int> cell_dof_indices (dofs_per_cell);
+ std::vector<unsigned int> cell_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell)
{
fe_values.reinit (cell);
const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
- const vector<double> &JxW_values (fe_values.get_JxW_values());
+ const std::vector<double> &JxW_values (fe_values.get_JxW_values());
- vector<double> local_functional (dofs_per_cell, 0);
+ std::vector<double> local_functional (dofs_per_cell, 0);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
for (unsigned int point=0; point<n_q_points; ++point)
local_functional[shape_func] += shape_values(shape_func,point) *
cell = dof->begin_active();
endc = dof->end();
- vector<unsigned int> dof_indices (fe->dofs_per_cell);
+ std::vector<unsigned int> dof_indices (fe->dofs_per_cell);
FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
{
fe_values.reinit (cell);
const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
- const vector<double> &JxW_values = fe_values.get_JxW_values();
+ const std::vector<double> &JxW_values = fe_values.get_JxW_values();
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
cell = dof->begin_active();
endc = dof->end();
- vector<unsigned int> dof_indices (fe->dofs_per_cell);
+ std::vector<unsigned int> dof_indices (fe->dofs_per_cell);
FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
{
fe_values.reinit (cell);
const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
- const vector<double> &JxW_values = fe_values.get_JxW_values();
+ const std::vector<double> &JxW_values = fe_values.get_JxW_values();
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
template <int dim>
-void EvaluationBase<dim>::print_final_result (ostream &) {};
+void EvaluationBase<dim>::print_final_result (std::ostream &) {};
template <int dim>
Vector<double> local_u (fe->dofs_per_cell);
Vector<double> local_v (fe->dofs_per_cell);
- vector<double> density_values(quadrature->n_quadrature_points);
- vector<double> stiffness_values(quadrature->n_quadrature_points);
+ std::vector<double> density_values(quadrature->n_quadrature_points);
+ std::vector<double> stiffness_values(quadrature->n_quadrature_points);
double total_energy = 0;
fe_values.reinit (cell);
const FullMatrix<double> &values = fe_values.get_shape_values();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
cell->get_dof_values (*u, local_u);
cell->get_dof_values (*v, local_v);
template <int dim>
-void EvaluateIntegratedValueAtOrigin<dim>::print_final_result (ostream &out) {
+void EvaluateIntegratedValueAtOrigin<dim>::print_final_result (std::ostream &out) {
out << " Integrated value of u at origin: "
- << integrated_value << endl;
+ << integrated_value << std::endl;
};
template <int dim>
-string EvaluateIntegratedValueAtOrigin<dim>::description () const {
+std::string EvaluateIntegratedValueAtOrigin<dim>::description () const {
return "integrated value at origin";
};
template <int dim>
-void EvaluateSeismicSignal<dim>::print_final_result (ostream &out) {
- out << " Integrated seismic signal: " << result << endl;
+void EvaluateSeismicSignal<dim>::print_final_result (std::ostream &out) {
+ out << " Integrated seismic signal: " << result << std::endl;
};
template <int dim>
-string EvaluateSeismicSignal<dim>::description () const {
+std::string EvaluateSeismicSignal<dim>::description () const {
return "Integrated seismic signal at top";
};
double EvaluateSeismicSignal<dim>::evaluate () {
const unsigned int n_q_points = quadrature_face->n_quadrature_points;
- ofstream out((base_file_name + ".seismic").c_str());
+ std::ofstream out((base_file_name + ".seismic").c_str());
AssertThrow (out, typename EvaluationBase<dim>::ExcIO());
DoFHandler<dim>::active_cell_iterator cell = dof->begin_active(),
UpdateFlags(update_values |
update_JxW_values |
update_q_points));
- vector<double> face_u (fe->dofs_per_face);
+ std::vector<double> face_u (fe->dofs_per_face);
for (; cell!=endc; ++cell)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
{
face_values.reinit (cell, face);
face_values.get_function_values (*u, face_u);
- const vector<double> &JxW_values (face_values.get_JxW_values());
- const vector<Point<dim> > &q_points (face_values.get_quadrature_points());
+ const std::vector<double> &JxW_values (face_values.get_JxW_values());
+ const std::vector<Point<dim> > &q_points (face_values.get_quadrature_points());
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
<< cell->face(face)->vertex(0)(0)
<< " "
<< (*u)(cell->face(face)->vertex_dof_index(0,0))
- << endl
+ << std::endl
<< time
<< ' '
<< cell->face(face)->vertex(1)(0)
<< " "
<< (*u)(cell->face(face)->vertex_dof_index(1,0))
- << endl
- << endl;
+ << std::endl
+ << std::endl;
};
AssertThrow (out, typename EvaluationBase<dim>::ExcIO());
out.close ();
template <int dim>
-void EvaluateSplitSignal<dim>::print_final_result (ostream &out) {
- out << " Integrated split signal: " << result << endl;
+void EvaluateSplitSignal<dim>::print_final_result (std::ostream &out) {
+ out << " Integrated split signal: " << result << std::endl;
};
template <int dim>
-string EvaluateSplitSignal<dim>::description () const {
+std::string EvaluateSplitSignal<dim>::description () const {
return "Integrated split signal (exact: (2+pi)/(16-pi)=0.010229)";
};
endc = dof->end();
double u_integrated=0;
FEFaceValues<dim> face_values (*fe, *quadrature_face, UpdateFlags(update_values | update_JxW_values));
- vector<double> face_u (fe->dofs_per_face);
+ std::vector<double> face_u (fe->dofs_per_face);
for (; cell!=endc; ++cell)
for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
face_values.reinit (cell, face_no);
face_values.get_function_values (*u, face_u);
- const vector<double> &JxW_values (face_values.get_JxW_values());
+ const std::vector<double> &JxW_values (face_values.get_JxW_values());
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
template <int dim>
-void EvaluateOneBranch1d<dim>::print_final_result (ostream &out) {
- out << " One branch integrated: " << result << endl;
+void EvaluateOneBranch1d<dim>::print_final_result (std::ostream &out) {
+ out << " One branch integrated: " << result << std::endl;
};
template <int dim>
-string EvaluateOneBranch1d<dim>::description () const {
+std::string EvaluateOneBranch1d<dim>::description () const {
return "One branch integrated (exact: 0.055735)";
};
endc = dof->end();
double u_integrated=0;
FEValues<1> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
- vector<double> cell_u (fe->dofs_per_cell);
+ std::vector<double> cell_u (fe->dofs_per_cell);
for (; cell!=endc; ++cell)
if ((cell->center()(0) > -0.6) &&
{
fe_values.reinit (cell);
fe_values.get_function_values (*u, cell_u);
- const vector<double> &JxW_values (fe_values.get_JxW_values());
+ const std::vector<double> &JxW_values (fe_values.get_JxW_values());
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
template <int dim>
-void EvaluateSecondCrossing1d<dim>::print_final_result (ostream &out) {
- out << " Second crossing: " << result << endl;
+void EvaluateSecondCrossing1d<dim>::print_final_result (std::ostream &out) {
+ out << " Second crossing: " << result << std::endl;
};
template <int dim>
-string EvaluateSecondCrossing1d<dim>::description () const {
+std::string EvaluateSecondCrossing1d<dim>::description () const {
return "Second crossing (exact: 0.011147)";
};
double u_integrated=0;
FEValues<1> fe_values (*fe, *quadrature,
UpdateFlags(update_values | update_JxW_values | update_q_points));
- vector<double> cell_u (fe->dofs_per_cell);
+ std::vector<double> cell_u (fe->dofs_per_cell);
for (; cell!=endc; ++cell)
if ((cell->center()(0) > -0.03) &&
{
fe_values.reinit (cell);
fe_values.get_function_values (*u, cell_u);
- const vector<double> &JxW_values (fe_values.get_JxW_values());
- const vector<Point<1> > &quadrature_points (fe_values.get_quadrature_points());
+ const std::vector<double> &JxW_values (fe_values.get_JxW_values());
+ const std::vector<Point<1> > &quadrature_points (fe_values.get_quadrature_points());
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
template <int dim>
-void EvaluateHuyghensWave<dim>::print_final_result (ostream &out) {
- out << " Hughens wave -- weighted time: " << weighted_value / integrated_value << endl;
- out << " average : " << integrated_value << endl;
+void EvaluateHuyghensWave<dim>::print_final_result (std::ostream &out) {
+ out << " Hughens wave -- weighted time: " << weighted_value / integrated_value << std::endl;
+ out << " average : " << integrated_value << std::endl;
};
template <int dim>
-string EvaluateHuyghensWave<dim>::description () const {
+std::string EvaluateHuyghensWave<dim>::description () const {
return "Huyghens wave";
};
};
-deallog << "Sweep " << setw(2) << sweep_no << ':' << endl
- << "---------" << endl;
+ deallog << "Sweep " << std::setw(2) << sweep_no << ':' << std::endl
+ << "---------" << std::endl;
- for (typename list<EvaluationBase<dim>*>::const_iterator i = parameters.eval_list.begin();
+ for (typename std::list<EvaluationBase<dim>*>::const_iterator i = parameters.eval_list.begin();
i != parameters.eval_list.end(); ++i)
(*i)->reset ();
start_sweep (sweep_no);
- for (vector<TimeStepBase*>::iterator timestep=timesteps.begin();
+ for (std::vector<TimeStepBase*>::iterator timestep=timesteps.begin();
timestep!=timesteps.end(); ++timestep)
{
dynamic_cast<TimeStepBase_Wave<dim>*>(*timestep)->attach_sweep_info (sweep_info);
};
solve_primal_problem ();
- deallog << endl;
+ deallog << std::endl;
if ((parameters.refinement_strategy == WaveParameters<dim>::dual_estimator)
&&
(sweep_no >= parameters.initial_energy_estimator_sweeps))
{
solve_dual_problem ();
- deallog << endl;
+ deallog << std::endl;
};
postprocess ();
if (parameters.write_stacked_data)
write_stacked_data (*sweep_data.data_out_stack);
- deallog << endl;
+ deallog << std::endl;
if (sweep_no != parameters.number_of_sweeps-1)
refine_grids ();
end_sweep ();
- deallog << endl << endl;
+ deallog << std::endl << std::endl;
};
template <int dim>
void TimestepManager<dim>::refine_grids ()
{
- deallog << " Collecting refinement data: " << endl;
+ deallog << " Collecting refinement data: " << std::endl;
const unsigned int n_timesteps = timesteps.size();
- vector<Vector<float> > indicators (n_timesteps);
+ std::vector<Vector<float> > indicators (n_timesteps);
for (unsigned int i=0; i<n_timesteps; ++i)
static_cast<TimeStepBase_Wave<dim>*>(timesteps[i])
{
deallog << " Generating error statistics ";
- vector<double> time_values (timesteps.size());
+ std::vector<double> time_values (timesteps.size());
for (unsigned int i=0; i<timesteps.size(); ++i)
time_values[i] = timesteps[i]->get_time();
Histogram::parse_interval_spacing(parameters.error_statistics_scaling));
error_statistics.write_gnuplot (logfile);
- deallog << endl;
+ deallog << std::endl;
};
unsigned int next_index=0;
for (unsigned int i=0; i<timesteps.size(); ++i)
{
- copy (indicators[0].begin(),
+ std::copy (indicators[0].begin(),
indicators[0].end(),
&all_indicators(next_index));
next_index += (indicators[0].end() - indicators[0].begin());
const double total_error = all_indicators.l1_norm();
Vector<float> partial_sums(all_indicators.size());
- sort (all_indicators.begin(), all_indicators.end(), greater<double>());
- partial_sum (all_indicators.begin(), all_indicators.end(),
+ std::sort (all_indicators.begin(), all_indicators.end(), std::greater<double>());
+ std::partial_sum (all_indicators.begin(), all_indicators.end(),
partial_sums.begin());
const Vector<float>::const_iterator
- p = upper_bound (partial_sums.begin(), partial_sums.end(),
+ p = std::upper_bound (partial_sums.begin(), partial_sums.end(),
total_error*(1-parameters.refinement_fraction.second)),
- q = lower_bound (partial_sums.begin(), partial_sums.end(),
+ q = std::lower_bound (partial_sums.begin(), partial_sums.end(),
parameters.refinement_fraction.first*total_error);
double bottom_threshold = all_indicators(p != partial_sums.end() ?
deallog << " " << all_indicators.size()
<< " cells in total."
- << endl;
+ << std::endl;
deallog << " Thresholds are [" << bottom_threshold << "," << top_threshold << "]"
<< " out of ["
<< *min_element(all_indicators.begin(),all_indicators.end())
<< ','
<< *max_element(all_indicators.begin(),all_indicators.end())
<< "]. "
- << endl;
+ << std::endl;
deallog << " Expecting "
<< (all_indicators.size() +
(q-partial_sums.begin())*(GeometryInfo<dim>::children_per_cell-1) -
(partial_sums.end() - p)/(GeometryInfo<dim>::children_per_cell-1))
<< " cells in next sweep."
- << endl;
+ << std::endl;
deallog << " Now refining...";
do_loop (mem_fun (&TimeStepBase_Tria<dim>::init_for_refinement),
bind2nd (mem_fun1 (&TimeStepBase_Wave<dim>::refine_grid),
bottom_threshold)),
TimeDependent::TimeSteppingData (0,1),
TimeDependent::forward);
- deallog << endl;
+ deallog << std::endl;
}
else
{
- deallog << " Refining each time step separately." << endl;
+ deallog << " Refining each time step separately." << std::endl;
for (unsigned int timestep=0; timestep<timesteps.size(); ++timestep)
static_cast<TimeStepBase_Tria<dim>*>(timesteps[timestep])->init_for_refinement();
Vector<float> partial_sums(criteria.size());
- sort (criteria.begin(), criteria.end(), greater<double>());
- partial_sum (criteria.begin(), criteria.end(),
+ std::sort (criteria.begin(), criteria.end(), std::greater<double>());
+ std::partial_sum (criteria.begin(), criteria.end(),
partial_sums.begin());
const Vector<float>::const_iterator
- p = upper_bound (partial_sums.begin(), partial_sums.end(),
+ p = std::upper_bound (partial_sums.begin(), partial_sums.end(),
total_error*(1-parameters.refinement_fraction.second)),
- q = lower_bound (partial_sums.begin(), partial_sums.end(),
+ q = std::lower_bound (partial_sums.begin(), partial_sums.end(),
parameters.refinement_fraction.first*total_error);
double bottom_threshold = criteria(p != partial_sums.end() ?
deallog << " Got " << total_number_of_cells << " presently, expecting "
- << total_expected_cells << " for next sweep." << endl;
+ << total_expected_cells << " for next sweep." << std::endl;
};
};
{
deallog << " Writing statistics for whole sweep.";
- deallog << "# Description of fields" << endl
- << "# =====================" << endl
- << "# General:" << endl
- << "# time" << endl;
+ deallog << "# Description of fields" << std::endl
+ << "# =====================" << std::endl
+ << "# General:" << std::endl
+ << "# time" << std::endl;
TimeStep<dim>::write_statistics_descriptions (logfile, parameters);
- deallog << endl << endl;
+ deallog << std::endl << std::endl;
for (unsigned int timestep=0; timestep<timesteps.size(); ++timestep)
{
dynamic_cast<TimeStep<dim>*>
(static_cast<TimeStepBase_Wave<dim>*>
(timesteps[timestep]))->write_statistics (logfile);
- deallog << endl;
+ deallog << std::endl;
};
AssertThrow (logfile, ExcIO());
- deallog << endl;
+ deallog << std::endl;
};
logfile);
AssertThrow (logfile, ExcIO());
- deallog << endl;
+ deallog << std::endl;
};
};
eps_flags.turn_angle = 0;
data_out_stack.set_flags (eps_flags);
data_out_stack.write (logfile, output_format);
- deallog << '.' << endl;
+ deallog << '.' << std::endl;
};
template <int dim>
-const string WaveParameters<dim>::initial_value_names ("zero"
+const std::string WaveParameters<dim>::initial_value_names ("zero"
"|eigenmode"
"|bump"
"|small bump"
"|plateau"
"|earthquake");
template <int dim>
-const string WaveParameters<dim>::coefficient_names ("unit"
+const std::string WaveParameters<dim>::coefficient_names ("unit"
"|kink"
"|gradient"
"|preliminary earth model"
"|distorted");
template <int dim>
-const string WaveParameters<dim>::boundary_function_names ("wave from left"
+const std::string WaveParameters<dim>::boundary_function_names ("wave from left"
"|fast wave from left"
"|wave from left center"
"|wave from left bottom"
"|zero");
template <int dim>
-const string WaveParameters<dim>::dual_functional_names ("none"
+const std::string WaveParameters<dim>::dual_functional_names ("none"
"|integrated value at origin"
"|seismic signature"
"|split signal"
DeclException1 (ExcUnknownName,
- string,
- << "Unknown description string " << arg1);
+ std::string,
+ << "Unknown description std::string " << arg1);
template <int dim>
return 1+8*(p(dim-1)>1./5. ? 1. : 0.);
};
- virtual void value_list (const vector<Point<dim> > &points,
- vector<double> &values,
+ virtual void value_list (const std::vector<Point<dim> > &points,
+ std::vector<double> &values,
const unsigned int) const {
Assert (values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
return tmp;
};
- virtual void gradient_list (const vector<Point<dim> > &points,
- vector<Tensor<1,dim> > &gradients,
+ virtual void gradient_list (const std::vector<Point<dim> > &points,
+ std::vector<Tensor<1,dim> > &gradients,
const unsigned int) const {
for (unsigned int i=0; i<points.size(); ++i)
gradients[i] = Kink::gradient (points[i], 0);
return 1+8*p(1)*p(1);
};
- virtual void value_list (const vector<Point<dim> > &points,
- vector<double> &values,
+ virtual void value_list (const std::vector<Point<dim> > &points,
+ std::vector<double> &values,
const unsigned int) const {
Assert (values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
return tmp;
};
- virtual void gradient_list (const vector<Point<dim> > &points,
- vector<Tensor<1,dim> > &gradients,
+ virtual void gradient_list (const std::vector<Point<dim> > &points,
+ std::vector<Tensor<1,dim> > &gradients,
const unsigned int) const {
for (unsigned int i=0; i<points.size(); ++i)
gradients[i] = Gradient::gradient (points[i], 0);
return 10+2.5*(2-r/6371)*(2-r/6371)+20*(r<2000 ? 1 : 0);
};
- virtual void value_list (const vector<Point<dim> > &points,
- vector<double> &values,
+ virtual void value_list (const std::vector<Point<dim> > &points,
+ std::vector<double> &values,
const unsigned int) const {
Assert (values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
return tmp;
};
- virtual void gradient_list (const vector<Point<dim> > &points,
- vector<Tensor<1,dim> > &gradients,
+ virtual void gradient_list (const std::vector<Point<dim> > &points,
+ std::vector<Tensor<1,dim> > &gradients,
const unsigned int) const {
for (unsigned int i=0; i<points.size(); ++i)
gradients[i] = PreliminaryEarthModel::gradient (points[i], 0);
(sin(3*pi*(2*x+y)/sqrt(3)))>0 ? 1 : 0));
};
- virtual void value_list (const vector<Point<dim> > &points,
- vector<double> &values,
+ virtual void value_list (const std::vector<Point<dim> > &points,
+ std::vector<double> &values,
const unsigned int) const {
Assert (values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
return Tensor<1,dim>();
};
- virtual void gradient_list (const vector<Point<dim> > &points,
- vector<Tensor<1,dim> > &gradients,
+ virtual void gradient_list (const std::vector<Point<dim> > &points,
+ std::vector<Tensor<1,dim> > &gradients,
const unsigned int) const {
for (unsigned int i=0; i<points.size(); ++i)
gradients[i] = Distorted::gradient (points[i], 0);
delete coarse_grid;
coarse_grid = 0;
- for (typename list<EvaluationBase<dim>*>::iterator i=eval_list.begin();
+ for (typename std::list<EvaluationBase<dim>*>::iterator i=eval_list.begin();
i!=eval_list.end(); ++i)
delete *i;
eval_list.erase (eval_list.begin(), eval_list.end());
template <int dim>
-void WaveParameters<dim>::set_initial_functions (const string &u_name,
- const string &v_name) {
+void WaveParameters<dim>::set_initial_functions (const std::string &u_name,
+ const std::string &v_name) {
Assert (initial_u==0, ExcInternalError());
Assert (initial_v==0, ExcInternalError());
- const string names[2] = {u_name, v_name};
+ const std::string names[2] = {u_name, v_name};
Function<dim> *functions[2];
for (unsigned int i=0; i<2; ++i)
template <int dim>
-void WaveParameters<dim>::set_coefficient_functions (const string &name) {
+void WaveParameters<dim>::set_coefficient_functions (const std::string &name) {
Assert (density==0, ExcInternalError());
Assert (stiffness==0, ExcInternalError());
template <int dim>
-void WaveParameters<dim>::set_boundary_functions (const string &name) {
+void WaveParameters<dim>::set_boundary_functions (const std::string &name) {
Assert (boundary_values_u==0, ExcInternalError());
Assert (boundary_values_v==0, ExcInternalError());
template <int dim>
-void WaveParameters<dim>::make_eval_list (const string &names) {
+void WaveParameters<dim>::make_eval_list (const std::string &names) {
Assert (eval_list.size()==0, ExcInternalError());
- string split_list = names;
+ std::string split_list = names;
while (split_list.length())
{
- string name;
+ std::string name;
name = split_list;
- if (name.find(",") != string::npos)
+ if (name.find(",") != std::string::npos)
{
- name.erase (name.find(","), string::npos);
+ name.erase (name.find(","), std::string::npos);
split_list.erase (0, split_list.find(",")+1);
}
else
template <int dim>
-void WaveParameters<dim>::set_dual_functional (const string &name) {
+void WaveParameters<dim>::set_dual_functional (const std::string &name) {
Assert (dual_functional==0, ExcInternalError());
if (name == "none")
dual_functional = new DualFunctional<dim>();
#if 2 == 1
template <>
-void WaveParameters<1>::make_coarse_grid (const string &name) {
+void WaveParameters<1>::make_coarse_grid (const std::string &name) {
const unsigned int dim = 1;
coarse_grid = new Triangulation<dim>(MeshSmoothing(smoothing_on_refinement |
Point<1>(-1./3.),
Point<1>(1./3.),
Point<1>(1.) };
- vector<CellData<1> > cells (3, CellData<1>());
+ std::vector<CellData<1> > cells (3, CellData<1>());
cells[0].vertices[0] = 0;
cells[0].vertices[1] = 1;
cells[0].material_id = 0;
cells[2].vertices[1] = 3;
cells[2].material_id = 0;
- coarse_grid->create_triangulation (vector<Point<1> >(&vertices[0],
+ coarse_grid->create_triangulation (std::vector<Point<1> >(&vertices[0],
&vertices[4]),
cells,
SubCellData());
#if 2 == 2
template <>
-void WaveParameters<2>::make_coarse_grid (const string &name) {
+void WaveParameters<2>::make_coarse_grid (const std::string &name) {
const unsigned int dim=2;
- map<string,InitialMesh> initial_mesh_list;
+ std::map<std::string,InitialMesh> initial_mesh_list;
initial_mesh_list["split channel bottom"] = split_channel_bottom;
initial_mesh_list["split channel left"] = split_channel_left;
initial_mesh_list["split channel right"] = split_channel_right;
{1, 4, 5, 2},
{4, 6, 7, 5}};
- vector<CellData<dim> > cells (3, CellData<dim>());
+ std::vector<CellData<dim> > cells (3, CellData<dim>());
for (unsigned int i=0; i<3; ++i)
{
boundary_info.boundary_lines[0].vertices[1] = 3;
};
- coarse_grid->create_triangulation (vector<Point<dim> >(&vertices[0],
+ coarse_grid->create_triangulation (std::vector<Point<dim> >(&vertices[0],
&vertices[8]),
cells, boundary_info);
{1, 7, 5, 3},
{6, 4, 5, 7}};
- vector<CellData<2> > cells (4, CellData<2>());
+ std::vector<CellData<2> > cells (4, CellData<2>());
for (unsigned int i=0; i<4; ++i)
{
cells[i].material_id = 0;
};
- coarse_grid->create_triangulation (vector<Point<2> >(&vertices[0],
+ coarse_grid->create_triangulation (std::vector<Point<2> >(&vertices[0],
&vertices[8]),
cells,
SubCellData());
#if 2 == 3
template <>
-void WaveParameters<3>::make_coarse_grid (const string &name) {
+void WaveParameters<3>::make_coarse_grid (const std::string &name) {
const unsigned int dim=3;
- map<string,InitialMesh> initial_mesh_list;
+ std::map<std::string,InitialMesh> initial_mesh_list;
initial_mesh_list["square"] = square;
initial_mesh_list["earth"] = earth;
initial_mesh_list["seismic square"] = seismic_square;
template <int dim>
void WaveParameters<dim>::parse_parameters (ParameterHandler &prm) {
- map<string,BoundaryConditions> boundary_conditions_list;
+ std::map<std::string,BoundaryConditions> boundary_conditions_list;
boundary_conditions_list["wave from left"] = wave_from_left;
boundary_conditions_list["fast wave from left"] = fast_wave_from_left;
boundary_conditions_list["wave from left center"] = wave_from_left_center;
boundary_conditions_list["wave from left bottom"] = wave_from_left_bottom;
boundary_conditions_list["zero"] = zero;
- map<string,Preconditioning> preconditioning_list;
+ std::map<std::string,Preconditioning> preconditioning_list;
preconditioning_list["jacobi"] = jacobi;
preconditioning_list["sor"] = sor;
preconditioning_list["ssor"] = ssor;
preconditioning_list["none"] = no_preconditioning;
- map<string,WriteStrategy> write_strategy_list;
+ std::map<std::string,WriteStrategy> write_strategy_list;
write_strategy_list["never"] = never;
write_strategy_list["all sweeps"] = all_sweeps;
write_strategy_list["last sweep only"] = last_sweep_only;
template <int dim>
void
-SweepInfo::write_summary (const list<EvaluationBase<dim>*> &eval_list,
- ostream &out) const
+SweepInfo::write_summary (const std::list<EvaluationBase<dim>*> &eval_list,
+ std::ostream &out) const
{
- out << "Summary of this sweep:" << endl
- << "======================" << endl
- << endl;
-
- out << " Accumulated number of cells: " << data.cells << endl
- << " Acc. number of primal dofs : " << data.primal_dofs << endl
- << " Acc. number of dual dofs : " << data.dual_dofs << endl
- << " Accumulated error : " << data.accumulated_error << endl;
+ out << "Summary of this sweep:" << std::endl
+ << "======================" << std::endl
+ << std::endl;
+
+ out << " Accumulated number of cells: " << data.cells << std::endl
+ << " Acc. number of primal dofs : " << data.primal_dofs << std::endl
+ << " Acc. number of dual dofs : " << data.dual_dofs << std::endl
+ << " Accumulated error : " << data.accumulated_error << std::endl;
if (eval_list.size() != 0)
{
- out << endl;
- out << " Evaluations:" << endl
- << " ------------" << endl;
+ out << std::endl;
+ out << " Evaluations:" << std::endl
+ << " ------------" << std::endl;
- for (typename list<EvaluationBase<dim>*>::const_iterator i = eval_list.begin();
+ for (typename std::list<EvaluationBase<dim>*>::const_iterator i = eval_list.begin();
i != eval_list.end(); ++i)
(*i)->print_final_result (out);
<< time->tm_mday << ' '
<< int_to_string (time->tm_hour, 2) << ":"
<< int_to_string (time->tm_min, 2) << ":"
- << int_to_string (time->tm_sec, 2) << endl;
+ << int_to_string (time->tm_sec, 2) << std::endl;
};
template
-void SweepInfo::write_summary (const list<EvaluationBase<2>*> &eval_list,
- ostream &out) const;
+void SweepInfo::write_summary (const std::list<EvaluationBase<2>*> &eval_list,
+ std::ostream &out) const;
#include <iomanip>
-static const pair<unsigned int, double> relaxations[3]
-= { make_pair(100,5), make_pair(300,3), make_pair(500,2) };
+static const std::pair<unsigned int, double> relaxations[3]
+= { std::make_pair(100,5), std::make_pair(300,3), std::make_pair(500,2) };
static const TimeStepBase_Tria<2>::RefinementFlags::CorrectionRelaxations
wave_correction_relaxations (1,
- vector<pair<unsigned int,double> > (&relaxations[0],
+ std::vector<std::pair<unsigned int,double> > (&relaxations[0],
&relaxations[3]));
template <int dim>
-string TimeStepBase_Wave<dim>::tmp_filename_base (const string &branch_signature) const
+std::string TimeStepBase_Wave<dim>::tmp_filename_base (const std::string &branch_signature) const
{
return (parameters.tmp_directory +
branch_signature + 's' +
template <int dim>
-TimeStep_Wave<dim>::TimeStep_Wave (const string fe_name) :
+TimeStep_Wave<dim>::TimeStep_Wave (const std::string fe_name) :
dof_handler (0),
fe (FEHelper<dim>::get_fe(fe_name)),
quadrature (FEHelper<dim>::get_quadrature(fe_name)),
case postprocess:
{
sweep_info->get_timers().postprocessing.start();
- ifstream tmp_in(tmp_filename_base(branch_signature()).c_str());
+ std::ifstream tmp_in(tmp_filename_base(branch_signature()).c_str());
u.block_read (tmp_in);
v.block_read (tmp_in);
tmp_in.close ();
Assert (u.size() != 0, ExcInternalError());
Assert (v.size() != 0, ExcInternalError());
- ofstream tmp_out(tmp_filename_base(branch_signature()).c_str());
+ std::ofstream tmp_out(tmp_filename_base(branch_signature()).c_str());
u.block_write (tmp_out);
v.block_write (tmp_out);
tmp_out.close ();
template <int dim>
void TimeStep_Wave<dim>::end_sweep ()
{
- string tmp_filename = tmp_filename_base(branch_signature());
+ std::string tmp_filename = tmp_filename_base(branch_signature());
remove (tmp_filename.c_str());
};
const bool density_constant = parameters.density_constant,
stiffness_constant = parameters.stiffness_constant;
- vector<double> density_values (n_q_points, 1.);
- vector<double> stiffness_values (n_q_points, 1.);
+ std::vector<double> density_values (n_q_points, 1.);
+ std::vector<double> stiffness_values (n_q_points, 1.);
if (density_constant)
fill_n (density_values.begin(), n_q_points,
update_q_points :
0)));
- vector<unsigned int> dof_indices_on_cell (dofs_per_cell);
+ std::vector<unsigned int> dof_indices_on_cell (dofs_per_cell);
FullMatrix<double> cell_mass_matrix (dofs_per_cell, dofs_per_cell);
FullMatrix<double> cell_laplace_matrix (dofs_per_cell, dofs_per_cell);
cell->get_dof_indices (dof_indices_on_cell);
const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
- const vector<vector<Tensor<1,dim> > > &shape_grads = fe_values.get_shape_grads ();
- const vector<double> &JxW_values = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > > &shape_grads = fe_values.get_shape_grads ();
+ const std::vector<double> &JxW_values = fe_values.get_JxW_values ();
if (!density_constant || !stiffness_constant)
{
- const vector<Point<dim> > &quadrature_points = fe_values.get_quadrature_points ();
+ const std::vector<Point<dim> > &quadrature_points = fe_values.get_quadrature_points ();
if (!density_constant)
parameters.density->value_list (quadrature_points,
density_values);
template <int dim>
-pair<double,double>
+std::pair<double,double>
TimeStep_Wave<dim>::compute_energy () {
- pair<double,double> energy;
+ std::pair<double,double> energy;
switch (next_action)
{
n_dofs (0),
n_solver_steps_helmholtz (0),
n_solver_steps_projection (0),
- energy (make_pair(0.0, 0.0))
+ energy (std::make_pair(0.0, 0.0))
{};
const unsigned int n_dofs,
const unsigned int n_solver_steps_helmholtz,
const unsigned int n_solver_steps_projection,
- const pair<double,double> energy) :
+ const std::pair<double,double> energy) :
n_active_cells (n_active_cells),
n_dofs (n_dofs),
n_solver_steps_helmholtz (n_solver_steps_helmholtz),
template <int dim>
void
-TimeStep_Wave<dim>::StatisticData::write_descriptions (ostream &out)
+TimeStep_Wave<dim>::StatisticData::write_descriptions (std::ostream &out)
{
- out << "# number of active cells" << endl
- << "# number of degrees of freedom" << endl
- << "# iterations for the helmholtz equation" << endl
- << "# iterations for the projection equation" << endl
- << "# elastic energy" << endl
- << "# kinetic energy" << endl
- << "# total energy" << endl;
+ out << "# number of active cells" << std::endl
+ << "# number of degrees of freedom" << std::endl
+ << "# iterations for the helmholtz equation" << std::endl
+ << "# iterations for the projection equation" << std::endl
+ << "# elastic energy" << std::endl
+ << "# kinetic energy" << std::endl
+ << "# total energy" << std::endl;
};
template <int dim>
-void TimeStep_Wave<dim>::StatisticData::write (ostream &out) const
+void TimeStep_Wave<dim>::StatisticData::write (std::ostream &out) const
{
out << n_active_cells << ' '
<< n_dofs << ' '
template <int dim>
-TimeStep_Dual<dim>::TimeStep_Dual (const string &dual_fe)
+TimeStep_Dual<dim>::TimeStep_Dual (const std::string &dual_fe)
:
TimeStep_Wave<dim> (dual_fe)
{};
statistic_data = typename TimeStep_Wave<dim>::StatisticData (tria->n_active_cells(),
dof_handler->n_dofs(),
0, 0,
- make_pair (0.0, 0.0));
- deallog << "." << endl;
+ std::make_pair (0.0, 0.0));
+ deallog << "." << std::endl;
};
};
- map<unsigned int,double> boundary_value_list;
+ std::map<unsigned int,double> boundary_value_list;
if (dim != 1)
{
static const ZeroFunction<dim> boundary_values;
solver_steps2,
compute_energy ());
- deallog << "." << endl;
+ deallog << "." << std::endl;
};
template <int dim>
-string TimeStep_Dual<dim>::branch_signature () const
+std::string TimeStep_Dual<dim>::branch_signature () const
{
return "d";
};
{
fe_values.reinit (old_cell);
const FullMatrix<double> &values = fe_values.get_shape_values ();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- vector<double> density_values(fe_values.n_quadrature_points);
+ std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
cell_matrix.vmult (local_M_u, tmp);
cell_matrix.clear ();
- vector<double> stiffness_values(fe_values.n_quadrature_points);
+ std::vector<double> stiffness_values(fe_values.n_quadrature_points);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
time_step,
local_A_v);
- vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
+ std::vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
collect_from_children (old_cell, fe_values, rhs1, rhs2);
- vector<unsigned int> new_dof_indices (dofs_per_cell);
+ std::vector<unsigned int> new_dof_indices (dofs_per_cell);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
{
const unsigned int l = collect_from_children (old_child, fe_values,
child_rhs1, child_rhs2);
- level_difference = max (l+1, level_difference);
+ level_difference = std::max (l+1, level_difference);
}
else
{
fe_values.reinit (old_child);
const FullMatrix<double> &values = fe_values.get_shape_values();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
cell_matrix.clear ();
- vector<double> density_values(fe_values.n_quadrature_points);
+ std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
cell_matrix.vmult (local_M_v, local_old_dof_values_v);
cell_matrix.clear ();
- vector<double> stiffness_values(fe_values.n_quadrature_points);
+ std::vector<double> stiffness_values(fe_values.n_quadrature_points);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
Vector<double> rhs2 (dofs_per_cell);
- vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
+ std::vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
local_old_dof_values_v,
right_hand_side1,
right_hand_side2);
- level_difference = max (l+1, level_difference);
+ level_difference = std::max (l+1, level_difference);
}
else
{
fe_values.reinit (new_child);
const FullMatrix<double> &values = fe_values.get_shape_values();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
cell_matrix.clear ();
- vector<double> density_values(fe_values.n_quadrature_points);
+ std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
cell_matrix.vmult (local_M_v, local_old_dof_values_v);
cell_matrix.clear ();
- vector<double> stiffness_values(fe_values.n_quadrature_points);
+ std::vector<double> stiffness_values(fe_values.n_quadrature_points);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
estimate_error_dual ();
};
- const double accumulated_error = accumulate (estimated_error_per_cell.begin(),
- estimated_error_per_cell.end(),
- 0.0);
+ const double accumulated_error = std::accumulate (estimated_error_per_cell.begin(),
+ estimated_error_per_cell.end(),
+ 0.0);
statistic_data = StatisticData (accumulated_error);
sweep_info->get_data().accumulated_error += accumulated_error;
Assert (estimated_error_per_cell.size()!=0,
ExcInternalError());
- ofstream tmp_out(tmp_filename_base(branch_signature()).c_str());
+ std::ofstream tmp_out(tmp_filename_base(branch_signature()).c_str());
estimated_error_per_cell.block_write (tmp_out);
tmp_out.close ();
void
TimeStep_ErrorEstimation<dim>::get_error_indicators (Vector<float> &indicators) const
{
- ifstream in (tmp_filename_base(branch_signature()).c_str());
+ std::ifstream in (tmp_filename_base(branch_signature()).c_str());
indicators.block_read (in);
};
target.u :
target.v),
estimated_error_per_cell,
- vector<bool>(),
+ std::vector<bool>(),
parameters.stiffness);
if (((previous_timestep == 0) && (which_variables==0)) ||
target.v :
target.u),
v_estimator,
- vector<bool>(),
+ std::vector<bool>(),
parameters.density);
estimated_error_per_cell += v_estimator;
};
cellwise_error,
fe_values);
- Assert (cellwise_error.next_free_slot == cellwise_error.errors.end(),
+ Assert (cellwise_error.next_free_slot == &*cellwise_error.errors.end(),
::ExcInternalError());
};
endc = primal_problem.dof_handler->end();
for (; cell!=endc; ++cell, ++i)
{
- const typename vector<ErrorOnCell>::iterator
- error_on_this_cell = static_cast<typename vector<ErrorOnCell>::iterator>(cell->user_pointer());
+ const ErrorOnCell *
+ error_on_this_cell = static_cast<ErrorOnCell*>(cell->user_pointer());
Assert (error_on_this_cell != 0, ::ExcInternalError());
cell->clear_user_pointer ();
Vector<double> tmp2(dofs_per_cell);
-vector<double> stiffness(fe_values.n_quadrature_points);
+std::vector<double> stiffness(fe_values.n_quadrature_points);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness);
- vector<Tensor<1,dim> > grad_stiffness(fe_values.n_quadrature_points);
+ std::vector<Tensor<1,dim> > grad_stiffness(fe_values.n_quadrature_points);
parameters.stiffness->gradient_list (fe_values.get_quadrature_points(),
grad_stiffness);
fe_values.reinit (cell);
const FullMatrix<double> &values = fe_values.get_shape_values();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<vector<Tensor<2,dim> > >&second_derivatives
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<std::vector<Tensor<2,dim> > >&second_derivatives
= fe_values.get_shape_2nd_derivatives ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
- vector<double> density_values(fe_values.n_quadrature_points);
+ std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
template <int dim>
-void TimeStep_ErrorEstimation<dim>::StatisticData::write_descriptions (ostream &out)
+void TimeStep_ErrorEstimation<dim>::StatisticData::write_descriptions (std::ostream &out)
{
- out << "# total estimated error in this timestep" << endl;
+ out << "# total estimated error in this timestep" << std::endl;
};
template <int dim>
-void TimeStep_ErrorEstimation<dim>::StatisticData::write (ostream &out) const
+void TimeStep_ErrorEstimation<dim>::StatisticData::write (std::ostream &out) const
{
out << estimated_error*100000;
};
template <int dim>
TimeStep_ErrorEstimation<dim>::CellwiseError::CellwiseError (const unsigned int n_errors) :
errors (n_errors),
- next_free_slot (errors.begin())
+ next_free_slot (&*errors.begin())
{};
template <int dim>
-void TimeStep<dim>::write_statistics_descriptions (ostream &out,
+void TimeStep<dim>::write_statistics_descriptions (std::ostream &out,
const WaveParameters<dim> ¶meters)
{
- out << "# Primal problem:" << endl;
+ out << "# Primal problem:" << std::endl;
typename TimeStep_Primal<dim>::StatisticData xp;
xp.write_descriptions (out);
- out << "# Dual problem:" << endl;
+ out << "# Dual problem:" << std::endl;
typename TimeStep_Dual<dim>::StatisticData xd;
xd.write_descriptions (out);
- out << "# Error estimation:" << endl;
+ out << "# Error estimation:" << std::endl;
TimeStep_ErrorEstimation<dim>::StatisticData::write_descriptions (out);
if (parameters.eval_list.size() != 0)
{
- out << "# Postprocessing:" << endl;
+ out << "# Postprocessing:" << std::endl;
TimeStep_Postprocess<dim>::StatisticData::write_descriptions (out, parameters);
};
};
template <int dim>
-void TimeStep<dim>::write_statistics (ostream &out) const
+void TimeStep<dim>::write_statistics (std::ostream &out) const
{
TimeStep_Primal<dim>::statistic_data.write (out);
out << " ";
sweep_info->get_timers().postprocessing.start();
statistic_data.evaluation_results.clear();
- for (typename list<EvaluationBase<dim>*>::const_iterator i = parameters.eval_list.begin();
+ for (typename std::list<EvaluationBase<dim>*>::const_iterator i = parameters.eval_list.begin();
i != parameters.eval_list.end(); ++i)
{
(*i)->reset_timelevel (get_timestep_primal());
typename DataOut<dim>::OutputFormat output_format
= DataOut<dim>::parse_output_format (parameters.output_format);
- string data_filename = (parameters.output_directory +
+ std::string data_filename = (parameters.output_directory +
"sweep" + int_to_string(sweep_no,2) +
"/" + int_to_string(timestep_no,4) +
out.default_suffix (output_format));
if (parameters.write_error_as_cell_data)
{
estimated_error.reinit (estimated_error_per_cell.size());
- copy_n (estimated_error_per_cell.begin(),
- estimated_error_per_cell.size(),
- estimated_error.begin());
+ std::copy (estimated_error_per_cell.begin(),
+ estimated_error_per_cell.end(),
+ estimated_error.begin());
}
else
{
};
-deallog << endl;
+deallog << std::endl;
sweep_info->get_timers().postprocessing.stop();
};
template <int dim>
-string TimeStep_Postprocess<dim>::branch_signature () const
+std::string TimeStep_Postprocess<dim>::branch_signature () const
{
return "o";
};
template <int dim>
void TimeStep_Postprocess<dim>::end_sweep ()
{
- string tmp_filename = tmp_filename_base(branch_signature());
+ std::string tmp_filename = tmp_filename_base(branch_signature());
remove (tmp_filename.c_str());
};
template <int dim>
void TimeStep_Postprocess<dim>::StatisticData::
-write_descriptions (ostream &out,
+write_descriptions (std::ostream &out,
const WaveParameters<dim> ¶meters)
{
- for (typename list<EvaluationBase<dim>*>::const_iterator i = parameters.eval_list.begin();
+ for (typename std::list<EvaluationBase<dim>*>::const_iterator i = parameters.eval_list.begin();
i != parameters.eval_list.end(); ++i)
- out << "# " << (*i)->description() << endl;
+ out << "# " << (*i)->description() << std::endl;
};
template <int dim>
-void TimeStep_Postprocess<dim>::StatisticData::write (ostream &out) const
+void TimeStep_Postprocess<dim>::StatisticData::write (std::ostream &out) const
{
for (unsigned int i=0; i<evaluation_results.size(); ++i)
out << evaluation_results[i]*100000 << ' ';
template <int dim>
-TimeStep_Primal<dim>::TimeStep_Primal (const string &primal_fe)
+TimeStep_Primal<dim>::TimeStep_Primal (const std::string &primal_fe)
:
TimeStep_Wave<dim> (primal_fe)
{};
dof_handler->n_dofs(),
0,
0,
- make_pair (0.0, 0.0));
+ std::make_pair (0.0, 0.0));
- deallog << "." << endl;
+ deallog << "." << std::endl;
};
parameters.boundary_values_u->set_time (time);
parameters.boundary_values_v->set_time (time);
- map<unsigned int,double> boundary_value_list;
+ std::map<unsigned int,double> boundary_value_list;
VectorTools::interpolate_boundary_values (*dof_handler, 0,
*(parameters.boundary_values_u),
boundary_value_list);
if (dim != 1)
{
- map<unsigned int,double> boundary_value_list;
+ std::map<unsigned int,double> boundary_value_list;
VectorTools::interpolate_boundary_values (*dof_handler, 0,
*(parameters.boundary_values_v),
boundary_value_list);
solver_steps2,
compute_energy ());
- deallog << "." << endl;
+ deallog << "." << std::endl;
};
template <int dim>
-string TimeStep_Primal<dim>::branch_signature () const
+std::string TimeStep_Primal<dim>::branch_signature () const
{
return "p";
};
FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
const FullMatrix<double> &values = fe_values.get_shape_values ();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
- vector<double> density_values(fe_values.n_quadrature_points);
+ std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
cell_matrix.vmult (local_M_v, tmp);
cell_matrix.clear ();
- vector<double> stiffness_values(fe_values.n_quadrature_points);
+ std::vector<double> stiffness_values(fe_values.n_quadrature_points);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
time_step,
local_A_u);
- vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
+ std::vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
collect_from_children (old_cell, fe_values, rhs1, rhs2);
- vector<unsigned int> new_dof_indices (dofs_per_cell);
+ std::vector<unsigned int> new_dof_indices (dofs_per_cell);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
{
const unsigned int l = collect_from_children (old_child, fe_values,
child_rhs1, child_rhs2);
- level_difference = max (l+1, level_difference);
+ level_difference = std::max (l+1, level_difference);
}
else
{
fe_values.reinit (old_child);
const FullMatrix<double> &values = fe_values.get_shape_values ();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
cell_matrix.clear ();
- vector<double> density_values(fe_values.n_quadrature_points);
+ std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
cell_matrix.clear ();
- vector<double> stiffness_values(fe_values.n_quadrature_points);
+ std::vector<double> stiffness_values(fe_values.n_quadrature_points);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
Vector<double> rhs2 (dofs_per_cell);
- vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
+ std::vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
local_old_dof_values_v,
right_hand_side1,
right_hand_side2);
- level_difference = max (l+1, level_difference);
+ level_difference = std::max (l+1, level_difference);
}
else
{
fe_values.reinit (new_child);
const FullMatrix<double> &values = fe_values.get_shape_values ();
- const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const vector<double> &weights = fe_values.get_JxW_values ();
+ const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
+ const std::vector<double> &weights = fe_values.get_JxW_values ();
cell_matrix.clear ();
- vector<double> density_values(fe_values.n_quadrature_points);
+ std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
cell_matrix.vmult (local_M_v, local_old_dof_values_v);
cell_matrix.clear ();
- vector<double> stiffness_values(fe_values.n_quadrature_points);
+ std::vector<double> stiffness_values(fe_values.n_quadrature_points);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
template <int dim>
-const FiniteElement<dim> & FEHelper<dim>::get_fe (const string &name) {
+const FiniteElement<dim> & FEHelper<dim>::get_fe (const std::string &name) {
if (name=="linear")
return fe_linear;
else
template <int dim>
-const Quadrature<dim> &FEHelper<dim>::get_quadrature (const string &name) {
+const Quadrature<dim> &FEHelper<dim>::get_quadrature (const std::string &name) {
if (name=="linear")
return q_gauss_2;
else
template <>
-const Quadrature<0> &FEHelper<1>::get_quadrature_face (const string &) {
+const Quadrature<0> &FEHelper<1>::get_quadrature_face (const std::string &) {
static const Quadrature<0> dummy_quadrature(1);
return dummy_quadrature;
};
template <int dim>
-const Quadrature<dim-1> &FEHelper<dim>::get_quadrature_face (const string &name) {
+const Quadrature<dim-1> &FEHelper<dim>::get_quadrature_face (const std::string &name) {
if (name=="linear")
return q_gauss_2_face;
else
};
-string int_to_string (const unsigned int i, const unsigned int digits) {
- string s;
+std::string int_to_string (const unsigned int i, const unsigned int digits) {
+ std::string s;
switch (digits)
{
case 4:
int main ()
{
deallog.attach(logfile);
- logfile.setf(ios::fixed);
+ logfile.setf(std::ios::fixed);
logfile.precision (2);
deallog.depth_console(0);
{
input_data.read_input ("wave-test-3.prm");
}
- catch (exception &e)
+ catch (std::exception &e)
{
- cerr << endl << endl
+ std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
- << endl;
- cerr << "Exception on input: " << e.what() << endl
- << "Aborting!" << endl
+ << std::endl;
+ std::cerr << "Exception on input: " << e.what() << std::endl
+ << "Aborting!" << std::endl
<< "----------------------------------------------------"
- << endl;
+ << std::endl;
return 1;
};
{
input_data.loop (waves);
}
- catch (exception &e)
+ catch (std::exception &e)
{
- cerr << endl << endl
+ std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
- << endl;
- cerr << "Exception on processing: " << e.what() << endl
- << "Aborting!" << endl
+ << std::endl;
+ std::cerr << "Exception on processing: " << e.what() << std::endl
+ << "Aborting!" << std::endl
<< "----------------------------------------------------"
- << endl;
+ << std::endl;
return 2;
}
catch (...)
{
- cerr << endl << endl
+ std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
- << endl;
- cerr << "Unknown exception!" << endl
- << "Aborting!" << endl
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
<< "----------------------------------------------------"
- << endl;
+ << std::endl;
return 3;
};