*/
class LogStream
{
- private:
-
- /**
- * Stack of strings which are printed
- * at the beginning of each line to
- * allow identification where the
- * output was generated.
- */
- std::stack<std::string> prefixes;
-
- /**
- * Default stream, where the output
- * is to go to. This stream defaults
- * to @p{std::cerr}, but can be set to another
- * stream through the constructor.
- */
- std::ostream *std_out;
-
- /**
- * Pointer to a stream, where a copy of
- * the output is to go to. Usually, this
- * will be a file stream.
- *
- * You can set and reset this stream
- * by the @p{attach} function.
- */
- std::ostream *file;
-
- /**
- * Flag which stores whether the
- * last operation was a
- * newline-generation. We use this flag
- * to generate the list of prefixes at
- * the next output, rather than
- * immediately after the newline, since
- * this might disturb the screen lay-out.
- */
- bool was_endl;
-
- /**
- * Value denoting the number of
- * prefixes to be printed to the
- * standard output. If more than
- * this number of prefixes is
- * pushed to the stack, then no
- * output will be generated until
- * the number of prefixes shrinks
- * back below this number.
- */
- unsigned int std_depth;
-
- /**
- * Same for the maximum depth of
- * prefixes for output to a file.
- */
- unsigned int file_depth;
-
- /**
- * Flag for printing execution time.
- */
- bool print_utime;
-
- /**
- * Flag for printing time differences.
- */
- bool diff_utime;
-
- /**
- * Time of last output line.
- */
- double last_time;
-
public:
/**
* Standard constructor, since we
LogStream & operator << (const T &t);
/**
- * Output a function. This really is not
- * to output the function, but calls the
- * function on the present object. It
- * works the same way as it is possible
- * to output the stream manipulators
- * (like @p{std::endl}, etc) work on standard
- * streams: @p{stream << std::endl;}. We need
- * to overload this function in order
- * to know when we have to print the
- * prefixes, since a user may use several
- * calls to @p{operator <<} before the
- * line is complete. The overloaded
- * function @p{void std::endl(LogStream &)}
- * tells the @p{LogStream} that the end of
- * the line is reached.
+ * Treat ostream
+ * manipulators. This passes on
+ * the whole thing to the
+ * template function with the
+ * exception of the @p{std::endl}
+ * manipulator, for which special
+ * action is performed: set the
+ * @p{was_endl} variable that
+ * forces this object to generate
+ * a line head the next time
+ * something is written by this
+ * stream.
*/
- LogStream & operator << (void (f)(LogStream &));
-
+ LogStream & operator<< (std::ostream& (*p) (std::ostream&));
/**
* Determine an estimate for
DeclException0 (ExcNoFileStreamGiven);
private:
+
+ /**
+ * Stack of strings which are printed
+ * at the beginning of each line to
+ * allow identification where the
+ * output was generated.
+ */
+ std::stack<std::string> prefixes;
+
+ /**
+ * Default stream, where the output
+ * is to go to. This stream defaults
+ * to @p{std::cerr}, but can be set to another
+ * stream through the constructor.
+ */
+ std::ostream *std_out;
+
+ /**
+ * Pointer to a stream, where a copy of
+ * the output is to go to. Usually, this
+ * will be a file stream.
+ *
+ * You can set and reset this stream
+ * by the @p{attach} function.
+ */
+ std::ostream *file;
+
+ /**
+ * Flag which stores whether the
+ * last operation was a
+ * newline-generation. We use this flag
+ * to generate the list of prefixes at
+ * the next output, rather than
+ * immediately after the newline, since
+ * this might disturb the screen lay-out.
+ */
+ bool was_endl;
+
+ /**
+ * Value denoting the number of
+ * prefixes to be printed to the
+ * standard output. If more than
+ * this number of prefixes is
+ * pushed to the stack, then no
+ * output will be generated until
+ * the number of prefixes shrinks
+ * back below this number.
+ */
+ unsigned int std_depth;
+
+ /**
+ * Same for the maximum depth of
+ * prefixes for output to a file.
+ */
+ unsigned int file_depth;
+
+ /**
+ * Flag for printing execution time.
+ */
+ bool print_utime;
+
+ /**
+ * Flag for printing time differences.
+ */
+ bool diff_utime;
+
+ /**
+ * Time of last output line.
+ */
+ double last_time;
+
/**
* Print head of line. This prints
* optional time information and
* the contents of the prefix stack.
*/
void print_line_head();
-
- /**
- * Declare this function as a friend.
- */
- friend void endl (LogStream &);
};
}
-/**
- * Replacement of @p{std::endl} for @p{LogStream}.
- *
- * Overloaded version of the stream manipulator function @p{std::endl} which
- * results in calling the original version of @p{std::endl} for each of the
- * two streams, if the present prefix number does not exceed the
- * specified maximal number.
- *
- * @author Guido Kanschat, 1999
- */
-inline void endl(LogStream& s)
+
+inline
+LogStream &
+LogStream::operator<< (std::ostream& (*p) (std::ostream&))
{
- if (s.prefixes.size() <= s.std_depth)
- *s.std_out << std::endl;
+ // first pass on to the other
+ // (templatized function)
+ this->template operator<< <std::ostream & (*)(std::ostream&)> (p);
- if (s.file && (s.prefixes.size() <= s.file_depth))
- *s.file << std::endl;
+ // next check whether this is the
+ // @p{endl} manipulator, and if so
+ // set a flag
+ if (p == &std::endl)
+ was_endl = true;
- s.was_endl = true;
+ return *this;
};
+
/**
* The standard log object of DEAL.
*
}
-LogStream&
-LogStream::operator << (void (f)(LogStream &))
-{
- f(*this);
- return *this;
-}
-
-
-
unsigned int
LogStream::memory_consumption () const
{
// in the Changed tree and actually
// differs from the default value
out << ptr->first << ": "
- << pc->entries[ptr->first].first << endl;
+ << pc->entries[ptr->first].first << std::endl;
else
out << ptr->first << ": "
- << ptr->second.first << endl;
+ << ptr->second.first << std::endl;
};
<ol>
<li> <p>
- The <code class="class">Threads</code> now has a barrier
+ Changed: The <code class="class">LogStream</code> class was
+ changed such that it understand the usual <code
+ class="member">std::endl</code> manipulator instead of the
+ special one needed previously. There is therefore no more need
+ to write <code class="member">std::endl</code> at some places
+ and <code class="member">endl</code> at others. The special
+ function <code class="member">endl</code> has gone.
+ <br>
+ (WB 2001/03/28)
+ </p>
+
+ <li> <p>
+ New: The <code class="class">Threads</code> now has a barrier
class in order to synchronise multiple threads. In
multithreaded mode, this is an alias to the <code
class="class">ACE_Barrier</code> class of the ACE library, if
</p>
<li> <p>
- We now support the output format of the <a
+ New: We now support the output format of the <a
href="http://www.kitware.com/vtk.html"
target="_top">Visualization Toolkit (Vtk)</a> from the <code
class="class">DataOutBase</code> class and all derived classes.
if (same_diagonal)
{
- deallog << "PreconditionBlock uses only one diagonal block" << endl;
+ deallog << "PreconditionBlock uses only one diagonal block" << std::endl;
// Invert only the first block
// This is a copy of the code in the
// 'else' part, stripped of the outer loop
do
{
if (step)
- deallog << "Restart step " << step << endl;
+ deallog << "Restart step " << step << std::endl;
if (start(A) == SolverControl::success) break;
state = iterate(A, precondition);
}
print_vectors(it, x, g, d);
if (additional_data.log_coefficients)
- deallog << "alpha-beta:" << alpha << '\t' << beta << endl;
+ deallog << "alpha-beta:" << alpha << '\t' << beta << std::endl;
conv = control().check(it,res);
if (conv)
// double condition = s[0]/s[dim_range-1];
if (info!=0)
- deallog << "inverting error " << info << ' ' << erg << endl;
+ deallog << "inverting error " << info << ' ' << erg << std::endl;
if (rank<(int)dim_range)
- deallog << "rank deficiency " << rank << endl;
+ deallog << "rank deficiency " << rank << std::endl;
delete[] work;
delete[] s;
delete[] matrix;
const double check_value)
{
if (_log_history && ((step % _log_frequency) == 0))
- deallog << "Check " << step << "\t" << check_value << endl;
+ deallog << "Check " << step << "\t" << check_value << std::endl;
lstep = step;
lvalue = check_value;
failure_residual=relative_failure_residual*check_value;
if (_log_result)
- deallog << "Starting value " << check_value << endl;
+ deallog << "Starting value " << check_value << std::endl;
}
{
if (_log_result)
deallog << "Failure step " << step
- << " value " << check_value << endl;
+ << " value " << check_value << std::endl;
return failure;
}
{
if (_log_result)
deallog << "Convergence step " << step
- << " value " << check_value << endl;
+ << " value " << check_value << std::endl;
return success;
}
{
if (_log_result)
deallog << "Convergence step " << step
- << " value " << check_value << endl;
+ << " value " << check_value << std::endl;
return success;
}
else
deallog.attach(logfile);
deallog.depth_console(0);
- deallog << "Test" << endl;
+ deallog << "Test" << std::endl;
deallog.push("l1");
- deallog << "Test1" << endl;
+ deallog << "Test1" << std::endl;
deallog.push("l2");
- deallog << "Test2" << "Test3" << endl;
+ deallog << "Test2" << "Test3" << std::endl;
deallog.push("l3");
deallog << "Test4";
deallog.pop();
- deallog << "Test5" << endl;
+ deallog << "Test5" << std::endl;
deallog.pop();
- deallog << "Test6" << endl;
+ deallog << "Test6" << std::endl;
deallog.pop();
- deallog << "Test7" << endl;
+ deallog << "Test7" << std::endl;
}
deallog.depth_console(0);
vector<double> values(1);
- deallog << "LagrangeEquidistant polynoms:" << endl;
+ deallog << "LagrangeEquidistant polynoms:" << std::endl;
for (unsigned int order=1; order<=4; ++order)
{
- deallog << "Polynomial p of order " << order << endl;
+ deallog << "Polynomial p of order " << order << std::endl;
for (unsigned int s_point=0; s_point<=order; ++s_point)
{
LagrangeEquidistant polynom(order, s_point);
deallog << " ok";
else
deallog << " false";
- deallog << endl;
+ deallog << std::endl;
// now also check
// whether the other
if (polynom.value(x) != values[0])
{
deallog << "The two `value' functions return different results!"
- << endl;
+ << std::endl;
abort ();
};
}
}
}
- deallog << endl << "Test derivatives computed by the Horner scheme:" << endl;
+ deallog << std::endl << "Test derivatives computed by the Horner scheme:" << std::endl;
LagrangeEquidistant pol(4, 2);
vector<double> v_horner(6);
for (unsigned int i=0; i<=10; ++i)
for (unsigned int i=0; i<v_exact.size(); ++i)
{
// deallog << "v_horner[i]=" << v_horner[i]
-// << " v_exact[i]=" << v_exact[i] << endl;
+// << " v_exact[i]=" << v_exact[i] << std::endl;
if (fabs(v_horner[i]-v_exact[i])>1e-12)
ok=false;
}
else
deallog << "false";
- deallog << endl;
+ deallog << std::endl;
}
- deallog << endl << "Test of TensorProductPolynomials:" << endl;
- deallog << "2D Example:" << endl;
+ deallog << std::endl << "Test of TensorProductPolynomials:" << std::endl;
+ deallog << "2D Example:" << std::endl;
unsigned int p=3,
n_tensor_pols=(p+1)*(p+1);
vector<SmartPointer<Polynomial> > pols;
Q3_4th_shape_function_values_and_grads_dim2(point, v_exact, grad_exact, grad_grad_exact);
unsigned int i=1;
- deallog << "v_" << i << "=" << vs[i] << endl;
- deallog << "v_exact=" << v_exact << endl;
- deallog << "grad_v_" << i << "=" << grads[i] << endl;
- deallog << "grad_exact=" << grad_exact << endl;
+ deallog << "v_" << i << "=" << vs[i] << std::endl;
+ deallog << "v_exact=" << v_exact << std::endl;
+ deallog << "grad_v_" << i << "=" << grads[i] << std::endl;
+ deallog << "grad_exact=" << grad_exact << std::endl;
for (unsigned int j=0; j<grad_grads[i].dimension; ++j)
for (unsigned int k=0; k<grad_grads[i].dimension; ++k)
{
deallog << "grad_grads_" << i<< "[" << j << "][" << k << "]="
- << grad_grads[i][j][k] << endl;
+ << grad_grads[i][j][k] << std::endl;
deallog << "grad2_exact[" << j << "][" << k << "]="
- << grad_grad_exact[j][k] << endl;
+ << grad_grad_exact[j][k] << std::endl;
}
}
while (err<1e-15);
// Uncomment here for testing
// deallog << " (Int " << quadrature_int << ',' << exact_int << ")";
- deallog << " is exact for polynomials of degree " << i-1 << endl;
+ deallog << " is exact for polynomials of degree " << i-1 << std::endl;
if (dim==1)
{
}
if (!in_order)
for (unsigned int x=0; x<quadrature.n_quadrature_points; ++x)
- deallog << points[x] << endl;
+ deallog << points[x] << std::endl;
}
}
}
while (err<5e-15);
// Uncomment here for testing
// deallog << " (Int " << quadrature_int << '-' << exact_int << '=' << err << ")";
- deallog << " is exact for polynomials of degree " << i-1 << endl;
+ deallog << " is exact for polynomials of degree " << i-1 << std::endl;
}
deallog.pop();
}
Test(const char* n) :
name(n)
{
- deallog << "Construct " << name << endl;
+ deallog << "Construct " << name << std::endl;
}
~Test()
{
- deallog << "Destruct " << name << endl;
+ deallog << "Destruct " << name << std::endl;
}
void f()
{
- deallog << "mutable" << endl;
+ deallog << "mutable" << std::endl;
}
void f() const
{
- deallog << "const" << endl;
+ deallog << "const" << std::endl;
}
};
deallog << "unrolled:";
for (unsigned i=0;i<9;i++)
deallog << ' ' << unrolled(i);
- deallog << endl;
+ deallog << std::endl;
- deallog << "t=" << endl;
+ deallog << "t=" << std::endl;
for (unsigned int i=0; i<dim; ++i)
{
for (unsigned int j=0; j<dim; ++j)
deallog << t[i][j] << ' ';
- deallog << endl;
+ deallog << std::endl;
};
- deallog << endl;
+ deallog << std::endl;
contract (tt,t,t);
- deallog << "tt=" << endl;
+ deallog << "tt=" << std::endl;
for (unsigned int i=0; i<dim; ++i)
{
for (unsigned int j=0; j<dim; ++j)
deallog << tt[i][j] << ' ';
- deallog << endl;
+ deallog << std::endl;
};
- deallog << endl;
+ deallog << std::endl;
if (true)
{
cross_product(result,e1,e2);
deallog << '\t' << result[0]
<< '\t' << result[1]
- << '\t' << result[2] << endl;
+ << '\t' << result[2] << std::endl;
cross_product(result,e2,e3);
deallog << '\t' << result[0]
<< '\t' << result[1] << '\t'
- << result[2] << endl;
+ << result[2] << std::endl;
cross_product(result,e3,e1);
deallog << '\t' << result[0]
<< '\t' << result[1]
- << '\t' << result[2] << endl;
+ << '\t' << result[2] << std::endl;
deallog.pop();
}
if (tt==result)
{
- deallog << "Result OK." << endl;
+ deallog << "Result OK." << std::endl;
}
else
{
- deallog << "Result WRONG!" << endl;
+ deallog << "Result WRONG!" << std::endl;
};
};
DEAL::1.00 2.00 3.00
DEAL::3.00 4.00 5.00
DEAL::6.00 7.00 8.00
-
+DEAL::
DEAL::tt=
DEAL::25.0 31.0 37.0
DEAL::45.0 57.0 69.0
DEAL::75.0 96.0 117.
-
+DEAL::
DEAL:Cross product:: 0.00 0.00 1.00
DEAL:Cross product:: 1.00 0.00 0.00
DEAL:Cross product:: 0.00 1.00 0.00
// relative error < 10%?
if (d <= .1)
{
- deallog << "OK" << endl;
+ deallog << "OK" << std::endl;
} else {
- deallog << "Ratio " << r << " should be " << ratio << endl;
+ deallog << "Ratio " << r << " should be " << ratio << std::endl;
}
}
triangulation.refine_global (3);
deallog << "Number of active cells: "
<< triangulation.n_active_cells()
- << endl;
+ << std::endl;
deallog << "Total number of cells: "
<< triangulation.n_cells()
- << endl;
+ << std::endl;
dof_handler.distribute_dofs (fe);
deallog << "Number of degrees of freedom: "
<< dof_handler.n_dofs()
- << endl;
+ << std::endl;
reinit_sparsity ();
DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
//<< ' '
//<< typeid(Matrix).name ()
//<< '-'
- << i << ' ' << solution(i) << endl;
+ << i << ' ' << solution(i) << std::endl;
};
};
const unsigned int n_datasets = solutions.size();
- deallog << "Checking " << n_datasets << " data sets." << endl;
+ deallog << "Checking " << n_datasets << " data sets." << std::endl;
for (unsigned int i=1; i<n_datasets; ++i)
Assert (solutions[i].size() == solutions[i].size(),
deallog << "Discrepancy: i=" << i << ", j=" << j
<< ", sol[i][j]=" << solutions[i][j]
<< ", sol[0][j]=" << solutions[0][j]
- << endl;
+ << std::endl;
deallog << flush;
Assert (false, ExcInternalError());
};
for (int step=0; step<9; ++step)
{
- deallog << "Element=" << element << ", Step=" << step << endl;
+ deallog << "Element=" << element << ", Step=" << step << std::endl;
Triangulation<3> tria;
make_tria (tria, step);
// release fe
dof.clear ();
- deallog << endl;
+ deallog << std::endl;
};
delete fe;
15 6: 0.50
18 6: 0.50
18 7: 0.50
-
+DEAL::
DEAL::Element=0, Step=1
0.00 1.00 0.00 0 0
1.00 1.00 0.00 0 0
29 2: 0.50
30 2: 0.50
30 3: 0.50
-
+DEAL::
DEAL::Element=0, Step=2
0.00 0.00 0.00 0 0
1.00 0.00 0.00 0 0
23 6: 0.50
26 5: 0.50
26 6: 0.50
-
+DEAL::
DEAL::Element=0, Step=3
1.00 0.00 0.00 0 0
2.00 0.00 0.00 0 0
20 7: 0.50
28 4: 0.50
28 7: 0.50
-
+DEAL::
DEAL::Element=0, Step=4
0.00 0.00 0.00 0 0
1.00 0.00 0.00 0 0
16 6: 0.50
24 6: 0.50
24 7: 0.50
-
+DEAL::
DEAL::Element=0, Step=5
0.00 0.00 1.00 0 0
1.00 0.00 1.00 0 0
23 4: 0.50
30 4: 0.50
30 5: 0.50
-
+DEAL::
DEAL::Element=0, Step=6
1.00 0.00 0.00 0 0
2.00 0.00 0.00 0 0
35 7: 0.50
36 7: 0.50
36 9: 0.50
-
+DEAL::
DEAL::Element=0, Step=7
0.00 1.00 0.00 0 0
1.00 1.00 0.00 0 0
49 9: 0.50
50 2: 0.50
50 9: 0.50
-
+DEAL::
DEAL::Element=0, Step=8
1.00 0.00 0.00 0 0
2.00 0.00 0.00 0 0
47 12: 0.50
50 11: 0.50
50 12: 0.50
-
+DEAL::
DEAL::Element=1, Step=0
0.00 0.00 0.00 0 0
1.00 0.00 0.00 0 0
93 14: 0.28
93 15: 0.28
93 21: 0.56
-
+DEAL::
DEAL::Element=1, Step=1
0.00 1.00 0.00 0 0
1.00 1.00 0.00 0 0
144 10: 0.28
144 11: 0.28
144 20: 0.56
-
+DEAL::
DEAL::Element=1, Step=2
0.00 0.00 0.00 0 0
1.00 0.00 0.00 0 0
146 17: -0.09
146 18: 0.28
146 23: 0.56
-
+DEAL::
DEAL::Element=1, Step=3
1.00 0.00 0.00 0 0
2.00 0.00 0.00 0 0
136 16: -0.09
136 19: 0.28
136 25: 0.56
-
+DEAL::
DEAL::Element=1, Step=4
0.00 0.00 0.00 0 0
1.00 0.00 0.00 0 0
124 18: 0.28
124 19: -0.09
124 24: 0.56
-
+DEAL::
DEAL::Element=1, Step=5
0.00 0.00 1.00 0 0
1.00 0.00 1.00 0 0
145 16: 0.28
145 17: -0.09
145 22: 0.56
-
+DEAL::
DEAL::Element=1, Step=6
1.00 0.00 0.00 0 0
2.00 0.00 0.00 0 0
178 34: 0.28
178 35: 0.28
178 44: 0.56
-
+DEAL::
DEAL::Element=1, Step=7
0.00 1.00 0.00 0 0
1.00 1.00 0.00 0 0
261 32: -0.09
261 33: 0.28
261 39: 0.56
-
+DEAL::
DEAL::Element=1, Step=8
1.00 0.00 0.00 0 0
2.00 0.00 0.00 0 0
284 41: -0.09
284 42: 0.28
284 47: 0.56
-
+DEAL::
deallog << " Number of active cells: "
<< triangulation.n_active_cells()
- << endl
+ << std::endl
<< " Total number of cells: "
<< triangulation.n_cells()
- << endl;
+ << std::endl;
dof_handler.distribute_dofs (fe);
deallog << " Number of degrees of freedom: "
<< dof_handler.n_dofs()
- << endl;
+ << std::endl;
sparsity_pattern.reinit (dof_handler.n_dofs(),
dof_handler.n_dofs(),
}
}
}
- deallog << "L2: " << l2 << endl;
- deallog << "H1: " << h1 << endl;
- deallog << "H2: " << h2 << endl;
+ deallog << "L2: " << l2 << std::endl;
+ deallog << "H1: " << h1 << std::endl;
+ deallog << "H2: " << h2 << std::endl;
}
template <int dim>
void TestCases<dim>::run (const unsigned int test_case)
{
deallog << "Dimension = " << dim
- << ", Test case = " << test_case << endl
- << endl;
+ << ", Test case = " << test_case << std::endl
+ << std::endl;
- deallog << " Making grid..." << endl;
+ deallog << " Making grid..." << std::endl;
switch (test_case)
{
};
- deallog << " Distributing degrees of freedom..." << endl;
+ deallog << " Distributing degrees of freedom..." << std::endl;
FE_Q<dim> fe(1);
dof->distribute_dofs (fe);
- deallog << " Renumbering degrees of freedom..." << endl;
+ deallog << " Renumbering degrees of freedom..." << std::endl;
DoFRenumbering::Cuthill_McKee (*dof);
SparsityPattern sparsity (dof->n_dofs(),
DoFTools::make_sparsity_pattern (*dof, sparsity);
int unconstrained_bandwidth = sparsity.bandwidth();
- deallog << " Writing sparsity pattern..." << endl;
+ deallog << " Writing sparsity pattern..." << std::endl;
sparsity.print_gnuplot (logfile);
// computing constraints
- deallog << " Computing constraints..." << endl;
+ deallog << " Computing constraints..." << std::endl;
ConstraintMatrix constraints;
DoFTools::make_hanging_node_constraints (*dof, constraints);
constraints.close ();
constraints.condense (sparsity);
- deallog << " Writing condensed sparsity pattern..." << endl;
+ deallog << " Writing condensed sparsity pattern..." << std::endl;
sparsity.print_gnuplot (logfile);
- deallog << endl
- << " Total number of cells = " << tria->n_cells() << endl
- << " Total number of active cells = " << tria->n_active_cells() << endl
- << " Number of DoFs = " << dof->n_dofs() << endl
- << " Number of constraints = " << constraints.n_constraints() << endl
- << " Unconstrained matrix bandwidth= " << unconstrained_bandwidth << endl
+ deallog << std::endl
+ << " Total number of cells = " << tria->n_cells() << std::endl
+ << " Total number of active cells = " << tria->n_active_cells() << std::endl
+ << " Number of DoFs = " << dof->n_dofs() << std::endl
+ << " Number of constraints = " << constraints.n_constraints() << std::endl
+ << " Unconstrained matrix bandwidth= " << unconstrained_bandwidth << std::endl
<< " Constrained matrix bandwidth = " << sparsity.bandwidth()
- << endl << endl;
+ << std::endl << std::endl;
// release the lock that dof has to the
// finite element object
DEAL::Dimension = 2, Test case = 1
-
+DEAL::
DEAL:: Making grid...
DEAL:: Distributing degrees of freedom...
DEAL:: Renumbering degrees of freedom...
47 -58
48 -58
56 -58
-
+DEAL::
DEAL:: Total number of cells = 53
DEAL:: Total number of active cells = 40
DEAL:: Number of DoFs = 59
DEAL:: Number of constraints = 20
DEAL:: Unconstrained matrix bandwidth= 30
DEAL:: Constrained matrix bandwidth = 36
-
+DEAL::
DEAL::Dimension = 2, Test case = 2
-
+DEAL::
DEAL:: Making grid...
DEAL:: Distributing degrees of freedom...
DEAL:: Renumbering degrees of freedom...
56 -72
70 -72
71 -72
-
+DEAL::
DEAL:: Total number of cells = 69
DEAL:: Total number of active cells = 52
DEAL:: Number of DoFs = 73
DEAL:: Number of constraints = 8
DEAL:: Unconstrained matrix bandwidth= 34
DEAL:: Constrained matrix bandwidth = 34
-
+DEAL::
DEAL::Dimension = 3, Test case = 1
-
+DEAL::
DEAL:: Making grid...
DEAL:: Distributing degrees of freedom...
DEAL:: Renumbering degrees of freedom...
231 -234
232 -234
233 -234
-
+DEAL::
DEAL:: Total number of cells = 137
DEAL:: Total number of active cells = 120
DEAL:: Number of DoFs = 235
DEAL:: Number of constraints = 90
DEAL:: Unconstrained matrix bandwidth= 175
DEAL:: Constrained matrix bandwidth = 200
-
+DEAL::
DEAL::Dimension = 3, Test case = 2
-
+DEAL::
DEAL:: Making grid...
DEAL:: Distributing degrees of freedom...
DEAL:: Renumbering degrees of freedom...
120 -124
122 -124
123 -124
-
+DEAL::
DEAL:: Total number of cells = 73
DEAL:: Total number of active cells = 64
DEAL:: Number of DoFs = 125
DEAL:: Number of constraints = 0
DEAL:: Unconstrained matrix bandwidth= 85
DEAL:: Constrained matrix bandwidth = 85
-
+DEAL::
ofstream logfile("fe_tables.output");
#define TEST_ELEMENT(e) { deallog.push(#e); e el;\
- print_fe_statistics(el); deallog.pop(); deallog << endl; }
+ print_fe_statistics(el); deallog.pop(); deallog << std::endl; }
#define TEST_MULTIPLE(e,n,d) { deallog.push(#e "x" #n); e eb; FESystem<d> el(eb,n); \
- print_fe_statistics(el); deallog.pop(); deallog << endl; }
+ print_fe_statistics(el); deallog.pop(); deallog << std::endl; }
#define TEST_MIXED2(e1,n1,e2,n2,d) { deallog.push(#e1 "x" #n1 "-" #e2 "x" #n2);\
e1 eb1; e2 eb2; FESystem<d> el(eb1,n1,eb2,n2);\
- print_fe_statistics(el); deallog.pop(); deallog << endl; }
+ print_fe_statistics(el); deallog.pop(); deallog << std::endl; }
#define TEST_MATRIX(e1,e2) { deallog.push( #e1 " onto " #e2); e1 el1; e2 el2;\
- print_fe_matrices(el1,el2); deallog.pop(); deallog << endl; }
+ print_fe_matrices(el1,el2); deallog.pop(); deallog << std::endl; }
template<int dim>
inline void
deallog << "dofs_per_cell" << " " << fe.dofs_per_cell;
deallog << ": vertex" << " " << fe.dofs_per_vertex;
deallog << " line" << " " << fe.dofs_per_line;
- deallog << " quad" << " " <<fe.dofs_per_quad << endl;
- deallog << "n_transform_fct " << fe.n_transform_functions() << endl;
- deallog << "n_components " << fe.n_components() << endl;
+ deallog << " quad" << " " <<fe.dofs_per_quad << std::endl;
+ deallog << "n_transform_fct " << fe.n_transform_functions() << std::endl;
+ deallog << "n_components " << fe.n_components() << std::endl;
deallog.push("components");
for (unsigned i=0;i<fe.dofs_per_cell;++i)
{
<< p.first << "," << p.second << ") -> "
<< fe.component_to_system_index(p.first, p.second)
<< " support " << support_points[i] << " unit: " << unit_points[i]
- << endl;
+ << std::endl;
}
for (unsigned i=0;i<fe.dofs_per_face;++i)
{
<< p.first << "," << p.second << ") -> "
<< fe.face_component_to_system_index(p.first, p.second)
<< " support " << face_support_points[i]
- << endl;
+ << std::endl;
}
deallog.pop();
}
{
FullMatrix<double> interpolation(low.dofs_per_cell, high.dofs_per_cell);
FETools::get_interpolation_matrix(high, low, interpolation);
- deallog << "Interpolation" << endl;
+ deallog << "Interpolation" << std::endl;
interpolation.print(logfile);
}
<< " lines: " << GeometryInfo<1>::lines_per_cell
<< " quads: " << GeometryInfo<1>::quads_per_cell
<< " hexes: " << GeometryInfo<1>::hexes_per_cell
- << endl;
+ << std::endl;
deallog.pop();
deallog.push("2D");
<< " lines: " << GeometryInfo<2>::lines_per_cell
<< " quads: " << GeometryInfo<2>::quads_per_cell
<< " hexes: " << GeometryInfo<2>::hexes_per_cell
- << endl;
+ << std::endl;
deallog.pop();
deallog.push("3D");
<< " lines: " << GeometryInfo<3>::lines_per_cell
<< " quads: " << GeometryInfo<3>::quads_per_cell
<< " hexes: " << GeometryInfo<3>::hexes_per_cell
- << endl;
+ << std::endl;
deallog.pop();
deallog.push("4D");
<< " lines: " << GeometryInfo<4>::lines_per_cell
<< " quads: " << GeometryInfo<4>::quads_per_cell
<< " hexes: " << GeometryInfo<4>::hexes_per_cell
- << endl;
+ << std::endl;
deallog.pop();
deallog.pop();
Vector<double> val(4);
- deallog << "Testing transformation of gradients of shape function:" << endl;
+ deallog << "Testing transformation of gradients of shape function:" << std::endl;
// test for each of the four
// shape functions
deallog << " Shape function " << vertex
<< ": "
<< (ok ? "OK" : "WRONG!")
- << endl;
+ << std::endl;
if (!ok)
testcase_succeeded = false;
sprintf(testname, "Test%d.dim%d", test_case , dim);
deallog.push(testname);
- deallog << "Start" << endl;
+ deallog << "Start" << std::endl;
Triangulation<dim> tria;
GridGenerator::hyper_cube(tria);
if ((dim==1) && ((test_case==2) || (test_case==3)))
{
- deallog << "Impossible for this dimension." << endl;
+ deallog << "Impossible for this dimension." << std::endl;
return;
};
GridOut().write_ucd (tria, logfile);
- deallog << " Total number of cells = " << tria.n_cells() << endl
- << " Total number of active cells = " << tria.n_active_cells() << endl;
+ deallog << " Total number of cells = " << tria.n_cells() << std::endl
+ << " Total number of active cells = " << tria.n_active_cells() << std::endl;
deallog.pop();
};
void check ()
{
deallog << "Checking in " << dim << " space dimensions"
- << endl
- << "---------------------------------------" << endl;
+ << std::endl
+ << "---------------------------------------" << std::endl;
// create two grids
Triangulation<dim> tria_1, tria_2;
// two grids
for (unsigned int i=0; i<3; ++i)
{
- deallog << "Refinement step " << i << endl;
+ deallog << "Refinement step " << i << std::endl;
DoFHandler<dim> dof_1 (tria_1);
DoFHandler<dim> dof_2 (tria_2);
DoFRenumbering::Cuthill_McKee (dof_2);
deallog << " Grid 1: " << tria_1.n_active_cells() << " cells, "
- << dof_1.n_dofs() << " dofs" << endl;
+ << dof_1.n_dofs() << " dofs" << std::endl;
deallog << " Grid 2: " << tria_2.n_active_cells() << " cells, "
- << dof_2.n_dofs() << " dofs" << endl;
+ << dof_2.n_dofs() << " dofs" << std::endl;
// now compute intergrid
// constraints
void check ()
{
deallog << "Checking in " << dim << " space dimensions"
- << endl
- << "---------------------------------------" << endl;
+ << std::endl
+ << "---------------------------------------" << std::endl;
// create two grids
Triangulation<dim> tria_1, tria_2;
// two grids
for (unsigned int i=0; i<3; ++i)
{
- deallog << "Refinement step " << i << endl;
+ deallog << "Refinement step " << i << std::endl;
DoFHandler<dim> dof_1 (tria_1);
DoFHandler<dim> dof_2 (tria_2);
<< intergrid_map_1[cell]
<< "->"
<< intergrid_map_2[intergrid_map_1[cell]]
- << endl;
+ << std::endl;
// note that not necessarily intergrid_map_2[intergrid_map_1[cell]] ==
// cell, since the meshes have different refinement steps.
};
hanging_nodes.close();
const unsigned int size = dof.n_dofs();
- deallog << "DoFs " << size << endl;
- deallog << "Levels: " << tr.n_levels() << endl;
+ deallog << "DoFs " << size << std::endl;
+ deallog << "Levels: " << tr.n_levels() << std::endl;
SparsityPattern structure(size, dof.max_couplings_between_dofs());
DoFTools::make_sparsity_pattern(dof, structure);
// deallog.log_execution_time(true);
deallog.depth_console(0);
- deallog << "Test" << endl;
+ deallog << "Test" << std::endl;
Helmholtz equation;
RHSFunction<2> rhs;
dof.distribute_dofs(fe);
const unsigned int size = dof.n_dofs();
- deallog << "DoFs " << size << endl;
- deallog << "Levels: " << tr.n_levels() << endl;
+ deallog << "DoFs " << size << std::endl;
+ deallog << "Levels: " << tr.n_levels() << std::endl;
for (unsigned int step=1;step < 3; ++step)
{
- deallog << "smoothing-steps" << step << endl;
+ deallog << "smoothing-steps" << step << std::endl;
SparsityPattern structure(size, dof.max_couplings_between_dofs());
DoFTools::make_sparsity_pattern(dof, structure);
Vector<double> val(4);
- deallog << "Testing transformation of 2nd derivatives of shape function:" << endl;
+ deallog << "Testing transformation of 2nd derivatives of shape function:" << std::endl;
// test for each of the four
// shape functions. first loop:
// one vertex moved
for (unsigned int loop=0; loop<=2; ++loop)
{
- deallog << "Test loop: " << loop << endl;
+ deallog << "Test loop: " << loop << std::endl;
// move one vertex of the only cell
if (loop==1)
vector<Tensor<2,2> > derivs(4);
fevalues.get_function_2nd_derivatives (val, derivs);
- deallog << "Vertex " << vertex << ": " << endl;
+ deallog << "Vertex " << vertex << ": " << std::endl;
for (unsigned int point=0; point<4; ++point)
for (unsigned int component=0; component<2; ++component)
- deallog << derivs[point][component] << endl;
+ deallog << derivs[point][component] << std::endl;
- deallog << endl;
+ deallog << std::endl;
};
};
};
DEAL::1.00 0.00
DEAL::0.00 1.00
DEAL::1.00 0.00
-
+DEAL::
DEAL::Vertex 1:
DEAL::0.00 -1.00
DEAL::-1.00 0.00
DEAL::-1.00 0.00
DEAL::0.00 -1.00
DEAL::-1.00 0.00
-
+DEAL::
DEAL::Vertex 2:
DEAL::0.00 1.00
DEAL::1.00 0.00
DEAL::1.00 0.00
DEAL::0.00 1.00
DEAL::1.00 0.00
-
+DEAL::
DEAL::Vertex 3:
DEAL::0.00 -1.00
DEAL::-1.00 0.00
DEAL::-1.00 0.00
DEAL::0.00 -1.00
DEAL::-1.00 0.00
-
+DEAL::
DEAL::Test loop: 1
DEAL::Vertex 0:
DEAL::0.00 0.50
DEAL::0.50 0.00
DEAL::0.00 0.50
DEAL::0.50 0.00
-
+DEAL::
DEAL::Vertex 1:
DEAL::0.00 -0.50
DEAL::-0.50 0.00
DEAL::-0.50 0.00
DEAL::0.00 -0.50
DEAL::-0.50 0.00
-
+DEAL::
DEAL::Vertex 2:
DEAL::0.00 0.50
DEAL::0.50 0.00
DEAL::0.50 0.00
DEAL::0.00 0.50
DEAL::0.50 0.00
-
+DEAL::
DEAL::Vertex 3:
DEAL::0.00 -0.50
DEAL::-0.50 0.00
DEAL::-0.50 0.00
DEAL::0.00 -0.50
DEAL::-0.50 0.00
-
+DEAL::
DEAL::Test loop: 2
DEAL::Vertex 0:
DEAL::0.00 1.75
DEAL::0.19 -0.13
DEAL::-0.24 0.22
DEAL::0.22 -0.12
-
+DEAL::
DEAL::Vertex 1:
DEAL::0.00 -0.75
DEAL::-0.75 0.00
DEAL::-0.08 0.05
DEAL::0.10 -0.09
DEAL::-0.09 0.05
-
+DEAL::
DEAL::Vertex 2:
DEAL::0.00 0.50
DEAL::0.50 0.00
DEAL::0.05 -0.03
DEAL::-0.07 0.06
DEAL::0.06 -0.03
-
+DEAL::
DEAL::Vertex 3:
DEAL::0.00 -1.50
DEAL::-1.50 0.00
DEAL::-0.16 0.11
DEAL::0.21 -0.19
DEAL::-0.19 0.10
-
+DEAL::
{
for (unsigned int mx=0;mx<=div;++mx)
{
- deallog << q.point(k) << endl;
+ deallog << q.point(k) << std::endl;
for (unsigned int i=0;i<finel.dofs_per_cell;++i)
{
deallog << "\tGrad " << fe.shape_grad(i,k);
deallog << "\t2nd " << fe.shape_2nd_derivative(i,k);
- deallog << endl;
+ deallog << std::endl;
}
k++;
}
fe_datas.push_back(new FESystem<dim>(FE_Q<dim> (4), 2));
}
- deallog << endl << "dim=" << dim << endl;
+ deallog << std::endl << "dim=" << dim << std::endl;
for (unsigned int n=0; n<fe_datas.size(); ++n)
{
FiniteElementData<dim> *fe_data=fe_datas[n];
- deallog << "fe_data[" << n <<"]:" << endl;
- deallog << "dofs_per_vertex=" << fe_data->dofs_per_vertex << endl;
- deallog << "dofs_per_line=" << fe_data->dofs_per_line << endl;
- deallog << "dofs_per_quad=" << fe_data->dofs_per_quad << endl;
- deallog << "dofs_per_hex=" << fe_data->dofs_per_hex << endl;
- deallog << "first_line_index=" << fe_data->first_line_index << endl;
- deallog << "first_quad_index=" << fe_data->first_quad_index << endl;
- deallog << "first_hex_index=" << fe_data->first_hex_index << endl;
- deallog << "first_face_line_index=" << fe_data->first_face_line_index << endl;
- deallog << "first_face_quad_index=" << fe_data->first_face_quad_index << endl;
- deallog << "dofs_per_face=" << fe_data->dofs_per_face << endl;
- deallog << "dofs_per_cell=" << fe_data->dofs_per_cell << endl;
- deallog << "components=" << fe_data->components << endl;
+ deallog << "fe_data[" << n <<"]:" << std::endl;
+ deallog << "dofs_per_vertex=" << fe_data->dofs_per_vertex << std::endl;
+ deallog << "dofs_per_line=" << fe_data->dofs_per_line << std::endl;
+ deallog << "dofs_per_quad=" << fe_data->dofs_per_quad << std::endl;
+ deallog << "dofs_per_hex=" << fe_data->dofs_per_hex << std::endl;
+ deallog << "first_line_index=" << fe_data->first_line_index << std::endl;
+ deallog << "first_quad_index=" << fe_data->first_quad_index << std::endl;
+ deallog << "first_hex_index=" << fe_data->first_hex_index << std::endl;
+ deallog << "first_face_line_index=" << fe_data->first_face_line_index << std::endl;
+ deallog << "first_face_quad_index=" << fe_data->first_face_quad_index << std::endl;
+ deallog << "dofs_per_face=" << fe_data->dofs_per_face << std::endl;
+ deallog << "dofs_per_cell=" << fe_data->dofs_per_cell << std::endl;
+ deallog << "components=" << fe_data->components << std::endl;
}
// delete all FiniteElementDatas
-
+DEAL::
DEAL::dim=1
DEAL::fe_data[0]:
DEAL::dofs_per_vertex=1
DEAL::dofs_per_face=2
DEAL::dofs_per_cell=10
DEAL::components=2
-
+DEAL::
DEAL::dim=2
DEAL::fe_data[0]:
DEAL::dofs_per_vertex=1
DEAL::dofs_per_face=10
DEAL::dofs_per_cell=50
DEAL::components=2
-
+DEAL::
DEAL::dim=3
DEAL::fe_data[0]:
DEAL::dofs_per_vertex=1
DoFHandler<dim> dof (tr);
dof.distribute_dofs (finel);
- cout << name << '<' << dim << '>' << " cell support points" << endl;
+ cout << name << '<' << dim << '>' << " cell support points" << std::endl;
vector<Point<dim> > cell_points (finel.dofs_per_cell);
finel.get_unit_support_points (cell_points);
for (unsigned int k=0;k<cell_points.size();++k)
- cout << setprecision(3) << cell_points[k] << endl;
+ cout << setprecision(3) << cell_points[k] << std::endl;
vector<Point<dim-1> > face_points;
finel.get_unit_face_support_points (face_points);
unsigned int j=0;
for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
{
- cout << name << '<' << dim << '>' << " face " << i << " support points" << endl;
+ cout << name << '<' << dim << '>' << " face " << i << " support points" << std::endl;
for (unsigned int k=0;k<face_points.size();++k)
cout << setprecision(3) << qp.point(j++)
- << endl;
+ << std::endl;
}
}
inline void
check_matrices (FiniteElement<dim>& fe, const char* name)
{
- cout << name << '<' << dim << '>' << " constraint " << endl;
+ cout << name << '<' << dim << '>' << " constraint " << std::endl;
fe.constraints().print_formatted (cout, 7, false, 10, "~");
for (unsigned int i=0;i<GeometryInfo<dim>::children_per_cell;++i)
{
- cout << name << '<' << dim << '>' << " restriction " << i << endl;
+ cout << name << '<' << dim << '>' << " restriction " << i << std::endl;
fe.restrict(i).print_formatted (cout, 3, false, 6, "~");
- cout << name << '<' << dim << '>' << " embedding " << i << endl;
+ cout << name << '<' << dim << '>' << " embedding " << i << std::endl;
fe.prolongate(i).print_formatted (cout, 3, false, 6, "~");
}
}
double area=0;
for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
area+=JxW[i];
- deallog << " area=" << area << endl;
+ deallog << " area=" << area << std::endl;
}
template<int dim>
void mapping_test()
{
- deallog << "dim=" << dim << endl;
+ deallog << "dim=" << dim << std::endl;
std::vector<Mapping<dim> *> mapping_ptr;
std::vector<std::string> mapping_strings;
dof.distribute_dofs(fe_q4);
DoFHandler<dim>::cell_iterator cell = dof.begin_active();
- deallog << "Triangulation" << i << ":" << endl;
+ deallog << "Triangulation" << i << ":" << std::endl;
- deallog << "exact_area=" << exact_areas[i] << endl;
+ deallog << "exact_area=" << exact_areas[i] << std::endl;
for (unsigned int j=0; j<mapping_size; ++j)
if (show[i][j])
{
std::ostrstream ost(st2, 99);
ost << "Mapping" << dim << "d-" << i << '-'
<< mapping_strings[j] << ".output" << std::ends;
- deallog << st2 << endl;
+ deallog << st2 << std::endl;
plot_transformation(*mapping_ptr[j], fe_q4, cell, st2);
compute_area(*mapping_ptr[j], fe_q4, cell);
}
std::ostrstream ost(st2, 99);
ost << "MappingFace" << dim << "d-" << i << '-'
<< mapping_strings[j] << ".output" << std::ends;
- deallog << st2 << endl;
+ deallog << st2 << std::endl;
plot_faces(*mapping_ptr[j], fe_q4, cell, st2);
}
std::ostrstream ost(st2, 99);
ost << "MappingSubface" << dim << "d-" << i << '-'
<< mapping_strings[j] << ".output" << std::ends;
- deallog << st2 << endl;
+ deallog << st2 << std::endl;
plot_subfaces(*mapping_ptr[j], fe_q4, cell, st2);
}
Point<dim> p_real=mapping.transform_unit_to_real_cell(cell, p_unit);
Point<dim> p_re_unit=mapping.transform_real_to_unit_cell(cell, p_real);
deallog << "p_unit=" << p_unit << ", p_real=" << p_real
- << ", p_re_unit=" << p_re_unit << endl;
+ << ", p_re_unit=" << p_re_unit << std::endl;
}
delete[] st2;
{
Point<2> radius = c1_values.quadrature_point(i);
radius /= std::sqrt(radius.square());
- deallog << "Normalized radius=" << radius << endl;
+ deallog << "Normalized radius=" << radius << std::endl;
- deallog << "C1 normal vector " << i << ": " << c1_values.normal_vector(i) << endl;
- deallog << "Q3 normal vector " << i << ": " << q3_values.normal_vector(i) << endl;
+ deallog << "C1 normal vector " << i << ": " << c1_values.normal_vector(i) << std::endl;
+ deallog << "Q3 normal vector " << i << ": " << q3_values.normal_vector(i) << std::endl;
};
const Quadrature<dim>& quadrature,
UpdateFlags flags)
{
- deallog << "Create dofs" << endl;
+ deallog << "Create dofs" << std::endl;
DoFHandler<dim> dof (tr);
dof.distribute_dofs (fe);
- deallog << "Create FEValues" << endl;
+ deallog << "Create FEValues" << std::endl;
FEValues<dim> val (mapping, fe, quadrature, flags);
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
DoFHandler<dim>::active_cell_iterator end = dof.end();
- deallog << "Loop" << endl;
+ deallog << "Loop" << std::endl;
for (;cell != end ; ++cell)
val.reinit(cell);
- deallog << "End" << endl;
+ deallog << "End" << std::endl;
}
template <int dim>
{
gnuplot << " " << fe.shape_value(i,k) + 1.;
}
- gnuplot << endl;
+ gnuplot << std::endl;
k++;
}
- gnuplot << endl;
+ gnuplot << std::endl;
}
- gnuplot << endl;
+ gnuplot << std::endl;
}
}
{
gnuplot << " " << fe.shape_value(i,k) + 1.;
}
- gnuplot << endl;
+ gnuplot << std::endl;
k++;
}
- gnuplot << endl;
+ gnuplot << std::endl;
}
- gnuplot << endl;
+ gnuplot << std::endl;
} else {
for (unsigned int s=0;s<GeometryInfo<dim>::subfaces_per_face; ++s)
{
{
gnuplot << " " << sub.shape_value(i,k) + 1.;
}
- gnuplot << endl;
+ gnuplot << std::endl;
k++;
}
- gnuplot << endl;
+ gnuplot << std::endl;
}
- gnuplot << endl;
+ gnuplot << std::endl;
}
}
}
Vector<double> in(n_fine);
Vector<double> out(n_coarse);
- of << name << endl;
+ of << name << std::endl;
for (unsigned int i=0;i<n_fine;++i)
{
in = 0.;
transfer.restrict_and_add(level,out,in);
out.print(of, 3, false);
}
- of << endl;
+ of << std::endl;
}
clock_t start;
clock_t diff;
- deallog << "Iterations: " << ITER << endl;
+ deallog << "Iterations: " << ITER << std::endl;
for (unsigned int nx=32; nx<8192 ; nx*=2)
{
const unsigned int dim=(nx-1)*(nx-1);
- deallog << "size = " << nx << " dim = " << dim << endl;
+ deallog << "size = " << nx << " dim = " << dim << std::endl;
start = clock();
for (unsigned int i=0;i<ITER;i++)
v.reinit(dim);
}
diff = clock()-start;
- deallog << "reinit: " << double(diff)/(2*ITER) << endl;
+ deallog << "reinit: " << double(diff)/(2*ITER) << std::endl;
start = clock();
for (unsigned int i=0;i<ITER;i++)
u = (double) i;
}
diff = clock()-start;
- deallog << "operator=(double): " << double(diff)/ITER << endl;
+ deallog << "operator=(double): " << double(diff)/ITER << std::endl;
QuickMatrix<double> A(nx,nx);
A.vmult(v,u);
}
diff = clock()-start;
- deallog << "vmult: " << double(diff)/ITER << endl;
+ deallog << "vmult: " << double(diff)/ITER << std::endl;
}
}
deallog << "Row " << row << " sparsity: ";
for (unsigned int i=0; i<29; ++i)
deallog << t[i];
- deallog << endl;
+ deallog << std::endl;
const unsigned int c=count(t.begin(), t.end(), true);
deallog << "Row=" << row
<< ": expected length=" << c
<< ", actual length=" << ac
- << endl;
+ << std::endl;
total_nonzero_elements += ac;
AssertThrow (c==ac, ExcInternalError());
};
deallog << total_nonzero_elements << "=="
<< bsp.n_nonzero_elements()
- << endl;
+ << std::endl;
AssertThrow (total_nonzero_elements == bsp.n_nonzero_elements(),
ExcInternalError());
BlockSparseMatrix<double> bsm (bsp);
deallog << total_nonzero_elements << "=="
<< bsm.n_nonzero_elements()
- << endl;
+ << std::endl;
AssertThrow (total_nonzero_elements == bsm.n_nonzero_elements(),
ExcInternalError());
// compare to vmult result
Assert (row_sum == dst(row), ExcInternalError());
- deallog << "vmult " << row << ' ' << row_sum << ' ' << dst(row) << endl;
+ deallog << "vmult " << row << ' ' << row_sum << ' ' << dst(row) << std::endl;
};
const double msp1 = dst.norm_sqr ();
const double msp2 = bsm.matrix_scalar_product (dst, src);
Assert (msp1 == msp2, ExcInternalError());
- deallog << "matrix_scalar_product " << msp1 << ' ' << msp2 << endl;
+ deallog << "matrix_scalar_product " << msp1 << ' ' << msp2 << std::endl;
};
}
catch (exception &e)
{
- cerr << endl << endl
+ cerr << std::endl << std::endl
<< "----------------------------------------------------"
- << endl;
- cerr << "Exception on processing: " << e.what() << endl
- << "Aborting!" << endl
+ << std::endl;
+ cerr << "Exception on processing: " << e.what() << std::endl
+ << "Aborting!" << std::endl
<< "----------------------------------------------------"
- << endl;
+ << std::endl;
// abort
return 2;
}
catch (...)
{
- cerr << endl << endl
+ cerr << std::endl << std::endl
<< "----------------------------------------------------"
- << endl;
- cerr << "Unknown exception!" << endl
- << "Aborting!" << endl
+ << std::endl;
+ cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
<< "----------------------------------------------------"
- << endl;
+ << std::endl;
// abort
return 3;
};
// no output expected here
deallog.push("empty constructor");
for (unsigned int i=0 ; i<i3.size() ; ++i)
- deallog << i << '\t' << i3.local_to_global(i,0) << endl;
+ deallog << i << '\t' << i3.local_to_global(i,0) << std::endl;
for (unsigned int i=0 ; i<i3.total_size() ; ++i)
deallog << i
<< '\t' << i3.global_to_local(i).first
<< '\t' << i3.global_to_local(i).second
- << endl;
+ << std::endl;
deallog.pop();
i3.reinit(ivector);
<< '\t' << i2.global_to_local(i).second
<< '\t' << i3.global_to_local(i).first
<< '\t' << i3.global_to_local(i).second
- << endl;
+ << std::endl;
}
deallog.pop();
for (unsigned int i=0 ; i<i1.size() ; ++i)
for (unsigned int j=0 ; j<ivector[i] ; ++j)
deallog << i << '\t' << j << '\t'
- << i1.local_to_global(i,j) << endl;
+ << i1.local_to_global(i,j) << std::endl;
deallog.pop();
deallog << i
<< '\t' << i1.global_to_local(i).first
<< '\t' << i1.global_to_local(i).second
- << endl;
+ << std::endl;
}
- deallog << "---" << endl;
+ deallog << "---" << std::endl;
ivector.erase(ivector.begin());
ivector.erase(ivector.begin());
deallog << i
<< '\t' << i1.global_to_local(i).first
<< '\t' << i1.global_to_local(i).second
- << endl;
+ << std::endl;
}
deallog.pop();
- deallog << "Range" << endl;
+ deallog << "Range" << std::endl;
unsigned int i = i1.global_to_local(3).first;
i = i1.local_to_global(1,2);
i = i1.local_to_global(2,0);
}
catch (exception &e)
{
- cerr << endl << endl
+ cerr << std::endl << std::endl
<< "----------------------------------------------------"
- << endl;
- cerr << "Exception on processing: " << e.what() << endl
- << "Aborting!" << endl
+ << std::endl;
+ cerr << "Exception on processing: " << e.what() << std::endl
+ << "Aborting!" << std::endl
<< "----------------------------------------------------"
- << endl;
+ << std::endl;
// abort
return 2;
}
catch (...)
{
- cerr << endl << endl
+ cerr << std::endl << std::endl
<< "----------------------------------------------------"
- << endl;
- cerr << "Unknown exception!" << endl
- << "Aborting!" << endl
+ << std::endl;
+ cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
<< "----------------------------------------------------"
- << endl;
+ << std::endl;
// abort
return 3;
};
double a = z.l2_norm();
if (a > 1.e-12) deallog << a << ' ';
}
- deallog << endl;
+ deallog << std::endl;
}
if (true)
C(i,i+1) = -sin(i+1);
C.print_formatted (logfile);
- deallog << "l1-norm: " << C.l1_norm() << endl;
+ deallog << "l1-norm: " << C.l1_norm() << std::endl;
D = C;
D.gauss_jordan();
D.print_formatted (logfile);
- deallog << "linfty-norm: " << D.linfty_norm() << endl
- << "Frobenius-norm: " << D.norm2() << endl;
+ deallog << "linfty-norm: " << D.linfty_norm() << std::endl
+ << "Frobenius-norm: " << D.norm2() << std::endl;
// Rotate original matrix
A.mmult(H,C);
von_Mises(control, mem, 0.);
double eigen = 0.;
von_Mises.solve(eigen, A, u);
- deallog << "Eigenvalue: " << eigen << endl;
+ deallog << "Eigenvalue: " << eigen << std::endl;
}
if (true)
{
von_Mises(control, mem, -4.);
double eigen = 0.;
von_Mises.solve(eigen, A, u);
- deallog << "Eigenvalue: " << eigen << endl;
+ deallog << "Eigenvalue: " << eigen << std::endl;
}
H = A;
H.gauss_jordan();
von_Mises(control, mem, 0.);
double eigen = 0.;
von_Mises.solve(eigen, H, u);
- deallog << "Eigenvalue: " << eigen << endl;
+ deallog << "Eigenvalue: " << eigen << std::endl;
}
if (true)
{
von_Mises(control, mem, -4.);
double eigen = 0.;
von_Mises.solve(eigen, H, u);
- deallog << "Eigenvalue: " << eigen << endl;
+ deallog << "Eigenvalue: " << eigen << std::endl;
}
}
}
// for (unsigned int i=0;i<n;++i)
// {
// for (unsigned int j=0;j<n;++j)
-// // s << ((float)i)/n << '\t' << ((float)j)/n << '\t' << v(k++) << endl;
+// // s << ((float)i)/n << '\t' << ((float)j)/n << '\t' << v(k++) << std::endl;
// s << '\t' << v(k++);
-// s << endl;
+// s << std::endl;
// }
-// s << endl;
+// s << std::endl;
// }
class FDMG
const unsigned int size = base * (1 << level);
const unsigned int dim = (size-1)*(size-1);
- deallog << "Level " << level << " size " << size << endl;
+ deallog << "Level " << level << " size " << size << std::endl;
// Make matrix
vector<SparsityPattern> structure(maxlevel+1);
Vector<double>&,
const Vector<double>&) const
{
- deallog << "Prolongating " << l-1 << " to " << l << endl;
+ deallog << "Prolongating " << l-1 << " to " << l << std::endl;
}
void
Vector<double>&,
const Vector<double>&) const
{
- deallog << "Restricting " << l << " to " << l-1 << endl;
+ deallog << "Restricting " << l << " to " << l-1 << std::endl;
}
void
Vector<double> &,
const Vector<double>&) const
{
- deallog << "Smoothing on " << level << endl;
+ deallog << "Smoothing on " << level << std::endl;
}
void
const Vector<double>&,
const Vector<double>&)
{
- deallog << "Residual on " << l << endl;
+ deallog << "Residual on " << l << std::endl;
}
void
Vector<double>&,
const Vector<double>&) const
{
- deallog << "Solving on " << level << endl;
+ deallog << "Solving on " << level << std::endl;
}
{
unsigned int dim = (size-1)*(size-1);
- deallog << "Size " << size << " Unknowns " << dim << endl;
+ deallog << "Size " << size << " Unknowns " << dim << std::endl;
// Make matrix
FDMatrix testproblem(size, size);
A.SOR_step(u,f);
res.add(-1.,u);
- deallog << "SOR-diff:" << res*res << endl;
+ deallog << "SOR-diff:" << res*res << std::endl;
deallog.push("no");
{
unsigned int dim = (size-1)*(size-1);
- deallog << "Size " << size << " Unknowns " << dim << endl;
+ deallog << "Size " << size << " Unknowns " << dim << std::endl;
// Make matrix
FDMatrix testproblem(size, size);
for (unsigned int test=0; test<2; ++test)
{
- deallog << "Test " << test << endl;
+ deallog << "Test " << test << std::endl;
// generate sparse ILU.
//
deallog << "Residual with test vector " << i << ": "
<< " left=" << left_residual
<< ", right=" << right_residual
- << endl;
+ << std::endl;
};
};
{
// Number of the row to be entered
unsigned int row = j+(nx-1)*i;
- s << (j+1)/(float)nx << '\t' << (i+1)/(float)ny << '\t' << V(row) << endl;
+ s << (j+1)/(float)nx << '\t' << (i+1)/(float)ny << '\t' << V(row) << std::endl;
}
- s << endl;
+ s << std::endl;
}
- s << endl;
+ s << std::endl;
}
template <typename number>
void print (const Vector<number> &v)
{
-// deallog << "Check point " << check_point << endl;
+// deallog << "Check point " << check_point << std::endl;
// check_point++;
for (unsigned int i=0; i<v.size(); ++i)
deallog << v(i) << '\t';
- deallog << endl;
+ deallog << std::endl;
};
template <typename number1, typename number2>
void check_vectors (Vector<number1> &d1, Vector<number2> &d2)
{
- deallog << "Fill & Swap" << endl;
+ deallog << "Fill & Swap" << std::endl;
Vector<number1> d3(d1.size());
print (d3);
d1 = 2.5;
print (d1);
- deallog << "Extract number" << endl;
+ deallog << "Extract number" << std::endl;
// Each line should contain two equal numbers
double sum = 0.;
for (unsigned int i=0;i<N;++i)
sum += 4.*i-i*i;
- deallog << d3 * d2 << '\t' << sum << endl;
+ deallog << d3 * d2 << '\t' << sum << std::endl;
sum = 0.;
for (unsigned int i=0;i<N;++i)
sum += 4.*i*i;
- deallog << d2.norm_sqr() << '\t' << sum << endl;
+ deallog << d2.norm_sqr() << '\t' << sum << std::endl;
sum = sqrt(sum);
- deallog << d2.l2_norm() << '\t' << sum << endl;
+ deallog << d2.l2_norm() << '\t' << sum << std::endl;
sum = 0.;
for (unsigned int i=0;i<N;++i)
sum += (2.-.5*i)/N;
- deallog << d3.mean_value() << '\t' << sum << endl;
+ deallog << d3.mean_value() << '\t' << sum << std::endl;
sum = 0.;
for (unsigned int i=0;i<N;++i)
sum += fabs(2.-.5*i);
- deallog << d3.l1_norm() << '\t' << sum << endl;
+ deallog << d3.l1_norm() << '\t' << sum << std::endl;
sum = 0.;
for (unsigned int i=0;i<N;++i)
double t = fabs(2.-.5*i);
if (t>sum) sum = t;
}
- deallog << d3.linfty_norm() << '\t' << sum << endl;
+ deallog << d3.linfty_norm() << '\t' << sum << std::endl;
- deallog << "add & sub" << endl;
+ deallog << "add & sub" << std::endl;
d1 += d2;
print (d1);
d1.add (2., d2, .5, d3);
print (d1);
- deallog << "sadd & scale" << endl;
+ deallog << "sadd & scale" << std::endl;
d2.sadd (2., d1);
print (d2);
d1.scale (4.);
print (d1);
- deallog << "equ" << endl;
+ deallog << "equ" << std::endl;
d2.equ (.25, d1);
print (d2);