};
// sort the lines
- sort (lines.begin(), lines.end());
+ std::sort (lines.begin(), lines.end());
#ifdef DEBUG
// if in debug mode: check that no
ConstraintLine test_line;
test_line.line = entry->first;
const std::vector<ConstraintLine>::const_iterator
- test_line_position = lower_bound (lines.begin(),
- lines.end(),
- test_line);
+ test_line_position = std::lower_bound (lines.begin(),
+ lines.end(),
+ test_line);
Assert ((test_line_position == lines.end())
||
(test_line_position->line != entry->first),
ConstraintLine index_comparison;
index_comparison.line = index;
- return binary_search (lines.begin (),
- lines.end (),
- index_comparison);
+ return std::binary_search (lines.begin (),
+ lines.end (),
+ index_comparison);
}
else
{
if (true)
{
std::vector<unsigned int> tmp(new_numbers);
- sort (tmp.begin(), tmp.end());
+ std::sort (tmp.begin(), tmp.end());
std::vector<unsigned int>::const_iterator p = tmp.begin();
unsigned int i = 0;
for (; p!=tmp.end(); ++p, ++i)
next_round_dofs.push_back (sparsity.get_column_numbers()[j]);
// sort dof numbers
- sort (next_round_dofs.begin(), next_round_dofs.end());
+ std::sort (next_round_dofs.begin(), next_round_dofs.end());
// delete multiple entries
std::vector<unsigned int>::iterator end_sorted;
- end_sorted = unique (next_round_dofs.begin(), next_round_dofs.end());
+ end_sorted = std::unique (next_round_dofs.begin(), next_round_dofs.end());
next_round_dofs.erase (end_sorted, next_round_dofs.end());
// eliminate dofs which are
// In any case, if not all DoFs
// have been reached, renumbering
// will not be possible
- if (find (new_number.begin(), new_number.end(), DoFHandler<dim>::invalid_dof_index)
+ if (std::find (new_number.begin(), new_number.end(), DoFHandler<dim>::invalid_dof_index)
!=
new_number.end())
Assert (false, ExcRenumberingIncomplete());
next_round_dofs.push_back (sparsity.get_column_numbers()[j]);
// sort dof numbers
- sort (next_round_dofs.begin(), next_round_dofs.end());
+ std::sort (next_round_dofs.begin(), next_round_dofs.end());
// delete multiple entries
std::vector<unsigned int>::iterator end_sorted;
#ifdef DEBUG
// test for all indices numbered
- if (find (new_number.begin(), new_number.end(),
- DoFHandler<dim>::invalid_dof_index)
+ if (std::find (new_number.begin(), new_number.end(),
+ DoFHandler<dim>::invalid_dof_index)
!=
new_number.end())
Assert (false, ExcRenumberingIncomplete());
Assert (component_order.size() == dof_handler.get_fe().n_components(),
ExcInvalidComponentOrder());
for (unsigned int i=0; i<dof_handler.get_fe().n_components(); ++i)
- Assert (find (component_order.begin(), component_order.end(), i)
+ Assert (std::find (component_order.begin(), component_order.end(), i)
!= component_order.end(),
ExcInvalidComponentOrder ());
// entries
for (unsigned int component=0; component<dof_handler.get_fe().n_components(); ++component)
{
- sort (component_to_dof_map[component].begin(),
- component_to_dof_map[component].end());
- component_to_dof_map[component].erase (unique (component_to_dof_map[component].begin(),
- component_to_dof_map[component].end()),
+ std::sort (component_to_dof_map[component].begin(),
+ component_to_dof_map[component].end());
+ component_to_dof_map[component].erase (std::unique (component_to_dof_map[component].begin(),
+ component_to_dof_map[component].end()),
component_to_dof_map[component].end());
};
for(cell = cells.begin(); cell != cells.end(); ++cell)
{
(*cell)->get_dof_indices(cell_dofs);
- sort(cell_dofs.begin(), cell_dofs.end());
+ std::sort(cell_dofs.begin(), cell_dofs.end());
for (unsigned int i=0;i<n_cell_dofs;++i)
{
Assert ((*cell)->level() == (int) level, ExcInternalError());
(*cell)->get_mg_dof_indices(cell_dofs);
- sort(cell_dofs.begin(), cell_dofs.end());
+ std::sort(cell_dofs.begin(), cell_dofs.end());
for (unsigned int i=0;i<n_cell_dofs;++i)
{
for (unsigned i=0; i<n_dofs; ++i)
new_indices[i] = i;
- random_shuffle (new_indices.begin(), new_indices.end());
+ std::random_shuffle (new_indices.begin(), new_indices.end());
dof_handler.renumber_dofs(new_indices);
};
present_cell->get_interpolated_dof_values(fe_function, dof_values);
// initialize with zero
- fill_n (values.begin(), n_quadrature_points, 0);
+ std::fill_n (values.begin(), n_quadrature_points, 0);
// add up contributions of trial
// functions
present_cell->get_interpolated_dof_values(fe_function, dof_values);
// initialize with zero
- fill_n (gradients.begin(), n_quadrature_points, Tensor<1,dim>());
+ std::fill_n (gradients.begin(), n_quadrature_points, Tensor<1,dim>());
// add up contributions of trial
// functions
// initialize with zero
for (unsigned i=0;i<gradients.size();++i)
- fill_n (gradients[i].begin(), gradients[i].size(), Tensor<1,dim>());
+ std::fill_n (gradients[i].begin(), gradients[i].size(), Tensor<1,dim>());
// add up contributions of trial
// functions
// initialize with zero
for (unsigned i=0;i<second_derivs.size();++i)
- fill_n (second_derivs[i].begin(), second_derivs[i].size(), Tensor<2,dim>());
+ std::fill_n (second_derivs[i].begin(), second_derivs[i].size(), Tensor<2,dim>());
// add up contributions of trial
// functions
coordinate_axis /= h;
const double alpha = std::atan2(coordinate_axis[1], coordinate_axis[0]);
- const double b = ((face_vertex_normals[0][1] * sin(alpha)
- +face_vertex_normals[0][0] * cos(alpha)) /
- (face_vertex_normals[0][1] * cos(alpha)
- -face_vertex_normals[0][0] * sin(alpha))),
- c = ((face_vertex_normals[1][1] * sin(alpha)
- +face_vertex_normals[1][0] * cos(alpha)) /
- (face_vertex_normals[1][1] * cos(alpha)
- -face_vertex_normals[1][0] * sin(alpha)));
+ const double b = ((face_vertex_normals[0][1] * std::sin(alpha)
+ +face_vertex_normals[0][0] * std::cos(alpha)) /
+ (face_vertex_normals[0][1] * std::cos(alpha)
+ -face_vertex_normals[0][0] * std::sin(alpha))),
+ c = ((face_vertex_normals[1][1] * std::sin(alpha)
+ +face_vertex_normals[1][0] * std::cos(alpha)) /
+ (face_vertex_normals[1][1] * std::cos(alpha)
+ -face_vertex_normals[1][0] * std::sin(alpha)));
// next evaluate the so
// determined cubic
// scaling and shifting
for (unsigned int i=0; i<2; ++i)
{
- Point<2> real_point (cos(alpha) * new_unit_points[i][0]
- - sin(alpha) * new_unit_points[i][1],
- sin(alpha) * new_unit_points[i][0]
- + cos(alpha) * new_unit_points[i][1]);
+ Point<2> real_point (std::cos(alpha) * new_unit_points[i][0]
+ - std::sin(alpha) * new_unit_points[i][1],
+ std::sin(alpha) * new_unit_points[i][0]
+ + std::cos(alpha) * new_unit_points[i][1]);
real_point *= h;
real_point += line->vertex(0);
a.push_back (real_point);
// shape functions of the Qp
// mapping.
renumber.resize(n_shape_functions,0);
- std::vector<unsigned int> dpo(dim+1, 1);
+ std::vector<unsigned int> dpo(dim+1, static_cast<unsigned int>(1));
for (unsigned int i=1; i<dpo.size(); ++i)
dpo[i] = dpo[i-1]*(degree-1);
FiniteElementData<dim> fe_data(dpo, 1);
// at the outer rim should be
// one. check this
for (unsigned int unit_point=0; unit_point<loqvs.size(); ++unit_point)
- Assert(fabs(std::accumulate(loqvs[unit_point].begin(),
- loqvs[unit_point].end(),0.)-1)<1e-13,
+ Assert(std::fabs(std::accumulate(loqvs[unit_point].begin(),
+ loqvs[unit_point].end(),0.)-1)<1e-13,
ExcInternalError());
// TEST output
Tensor<1,dim> tangential;
tangential[(nindex+1)%dim] = (normal_directions[i]%2) ? -1 : 1;
data.unit_tangentials[i].resize(n_original_q_points);
- fill (data.unit_tangentials[i].begin(),
- data.unit_tangentials[i].end(),
- tangential);
+ std::fill (data.unit_tangentials[i].begin(),
+ data.unit_tangentials[i].end(),
+ tangential);
if (dim>2)
{
{
Assert (quadrature_points.size() == npts,
ExcDimensionMismatch(quadrature_points.size(), npts));
- fill(quadrature_points.begin(),
- quadrature_points.end(),
- Point<dim>());
+ std::fill(quadrature_points.begin(),
+ quadrature_points.end(),
+ Point<dim>());
}
if (update_flags & update_covariant_transformation)
{
Assert (data.contravariant.size() == npts,
ExcDimensionMismatch(data.contravariant.size(), npts));
- fill(data.contravariant.begin(),
- data.contravariant.end(),
- Tensor<2,dim>());
+ std::fill(data.contravariant.begin(),
+ data.contravariant.end(),
+ Tensor<2,dim>());
}
if (update_flags & update_jacobian_grads)
| update_JxW_values))
for (unsigned int i=0;i<boundary_forms.size();++i)
{
- double f = sqrt(contract(boundary_forms[i],
- boundary_forms[i]));
+ double f = std::sqrt(contract(boundary_forms[i],
+ boundary_forms[i]));
if (update_flags & update_JxW_values)
{
JxW_values[i] = f * weights[i];
// equilibrate cell sizes at
// transition from the inner part
// to the radial cells
- const double a = 1./(1+sqrt(2.0));
- const Point<2> vertices[8] = { p+Point<2>(-1,-1)*(radius/sqrt(2.0)),
- p+Point<2>(+1,-1)*(radius/sqrt(2.0)),
- p+Point<2>(-1,-1)*(radius/sqrt(2.0)*a),
- p+Point<2>(+1,-1)*(radius/sqrt(2.0)*a),
- p+Point<2>(-1,+1)*(radius/sqrt(2.0)*a),
- p+Point<2>(+1,+1)*(radius/sqrt(2.0)*a),
- p+Point<2>(-1,+1)*(radius/sqrt(2.0)),
- p+Point<2>(+1,+1)*(radius/sqrt(2.0)) };
+ const double a = 1./(1+std::sqrt(2.0));
+ const Point<2> vertices[8] = { p+Point<2>(-1,-1)*(radius/std::sqrt(2.0)),
+ p+Point<2>(+1,-1)*(radius/std::sqrt(2.0)),
+ p+Point<2>(-1,-1)*(radius/std::sqrt(2.0)*a),
+ p+Point<2>(+1,-1)*(radius/std::sqrt(2.0)*a),
+ p+Point<2>(-1,+1)*(radius/std::sqrt(2.0)*a),
+ p+Point<2>(+1,+1)*(radius/std::sqrt(2.0)*a),
+ p+Point<2>(-1,+1)*(radius/std::sqrt(2.0)),
+ p+Point<2>(+1,+1)*(radius/std::sqrt(2.0)) };
const int cell_vertices[5][4] = {{0, 1, 3, 2},
{0, 2, 4, 6},
// radii)
const unsigned int N = (n_cells == 0 ?
static_cast<unsigned int>
- (ceil((2*pi* (outer_radius + inner_radius)/2) /
- (outer_radius - inner_radius))) :
+ (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
+ (outer_radius - inner_radius))) :
n_cells);
// set up N vertices on the
std::vector<Point<2> > vertices(2*N);
for (unsigned int i=0; i<N; ++i)
{
- vertices[i] = Point<2>( cos(2*pi * i/N),
- sin(2*pi * i/N)) * outer_radius;
+ vertices[i] = Point<2>( std::cos(2*pi * i/N),
+ std::sin(2*pi * i/N)) * outer_radius;
vertices[i+N] = vertices[i] * (inner_radius/outer_radius);
vertices[i] += center;
// radii)
const unsigned int N = (n_cells == 0 ?
static_cast<unsigned int>
- (ceil((pi* (outer_radius + inner_radius)/2) /
- (outer_radius - inner_radius))) :
+ (std::ceil((pi* (outer_radius + inner_radius)/2) /
+ (outer_radius - inner_radius))) :
n_cells);
// set up N+1 vertices on the
// value of pi)
vertices[i] = Point<2>( ( (i==0) || (i==N) ?
0 :
- cos(pi * i/N - pi/2) ),
- sin(pi * i/N - pi/2)) * outer_radius;
+ std::cos(pi * i/N - pi/2) ),
+ std::sin(pi * i/N - pi/2)) * outer_radius;
vertices[i+N+1] = vertices[i] * (inner_radius/outer_radius);
vertices[i] += center;
// block this to have local
// variables destroyed after
// use
- time_t time1= time (0);
- tm *time = localtime(&time1);
+ std::time_t time1= std::time (0);
+ std::tm *time = std::localtime(&time1);
out << "# This file was generated by the deal.II library." << std::endl
<< "# Date = "
<< time->tm_year+1900 << "/"
const double pi = 3.141592653589793238462;
const double z_angle = eps_flags_3.azimut_angle;
const double turn_angle = eps_flags_3.turn_angle;
- const Point<dim> view_direction(-sin(z_angle * 2.*pi / 360.) * sin(turn_angle * 2.*pi / 360.),
- +sin(z_angle * 2.*pi / 360.) * cos(turn_angle * 2.*pi / 360.),
- -cos(z_angle * 2.*pi / 360.));
+ const Point<dim> view_direction(-std::sin(z_angle * 2.*pi / 360.) * std::sin(turn_angle * 2.*pi / 360.),
+ +std::sin(z_angle * 2.*pi / 360.) * std::cos(turn_angle * 2.*pi / 360.),
+ -std::cos(z_angle * 2.*pi / 360.));
// decide about the two unit vectors
// in this plane. we chose the first one
// to this plane
const Point<dim> vector1
= Point<dim>(0,0,1) - ((Point<dim>(0,0,1) * view_direction) * view_direction);
- const Point<dim> unit_vector1 = vector1 / sqrt(vector1.square());
+ const Point<dim> unit_vector1 = vector1 / std::sqrt(vector1.square());
// now the third vector is fixed. we
// chose the projection of a more or
// block this to have local
// variables destroyed after
// use
- time_t time1= time (0);
- tm *time = localtime(&time1);
+ std::time_t time1= std::time (0);
+ std::tm *time = std::localtime(&time1);
out << "%!PS-Adobe-2.0 EPSF-1.2" << std::endl
<< "%%Title: deal.II Output" << std::endl
<< "%%Creator: the deal.II library" << std::endl
const unsigned int n_cells = criteria.size();
for (unsigned int index=0; index<n_cells; ++cell, ++index)
- if (fabs(criteria(index)) >= threshold)
+ if (std::fabs(criteria(index)) >= threshold)
cell->set_refine_flag();
};
const unsigned int n_cells = criteria.size();
for (unsigned int index=0; index<n_cells; ++cell, ++index)
- if (fabs(criteria(index)) <= threshold)
+ if (std::fabs(criteria(index)) <= threshold)
cell->set_coarsen_flag();
};
const unsigned int
new_cell_number = rotation_states.size()-1;
const unsigned int
- old_cell_number = find (new_cell_numbers.begin(),
- new_cell_numbers.end(),
- new_cell_number) - new_cell_numbers.begin();
+ old_cell_number = std::find (new_cell_numbers.begin(),
+ new_cell_numbers.end(),
+ new_cell_number) - new_cell_numbers.begin();
Assert (old_cell_number < cells.size(), ExcInternalError());
original_cells[old_cell_number].rotate (rotation_states.back());
// next_round_cells array,
// which is needed for the next
// loop iteration anyway
- sort (new_next_round_cells.begin(), new_next_round_cells.end());
+ std::sort (new_next_round_cells.begin(), new_next_round_cells.end());
next_round_cells.clear ();
unique_copy (new_next_round_cells.begin(), new_next_round_cells.end(),
back_inserter(next_round_cells));
};
- Assert (find (new_cell_numbers.begin(), new_cell_numbers.end(), invalid_cell_number)
+ Assert (std::find (new_cell_numbers.begin(), new_cell_numbers.end(), invalid_cell_number)
==
new_cell_numbers.end(),
ExcInternalError());
// is at least two. if not so,
// then clean triangulation and
// exit with an exception
- if ( ! (* (min_element(vertex_touch_count.begin(),
- vertex_touch_count.end())) >= 2))
+ if ( ! (* (std::min_element(vertex_touch_count.begin(),
+ vertex_touch_count.end())) >= 2))
{
// clear will only work if
// there are no
// first compute a random shift vector
for (unsigned int d=0; d<dim; ++d)
- shift_vector(d) = rand()*1.0/RAND_MAX;
+ shift_vector(d) = std::rand()*1.0/RAND_MAX;
shift_vector *= factor * minimal_length[vertex] /
- sqrt(shift_vector.square());
+ std::sqrt(shift_vector.square());
// finally move the vertex
vertices[vertex] += shift_vector;
template <int dim>
double TriaObjectAccessor<1, dim>::diameter () const
{
- return sqrt((vertex(1)-vertex(0)).square());
+ return std::sqrt((vertex(1)-vertex(0)).square());
};
template <int dim>
double TriaObjectAccessor<1, dim>::measure () const
{
- return sqrt((vertex(1)-vertex(0)).square());
+ return std::sqrt((vertex(1)-vertex(0)).square());
};
template <int dim>
double TriaObjectAccessor<2, dim>::diameter () const
{
- return sqrt(std::max((vertex(2)-vertex(0)).square(),
- (vertex(3)-vertex(1)).square()));
+ return std::sqrt(std::max((vertex(2)-vertex(0)).square(),
+ (vertex(3)-vertex(1)).square()));
};
if (compute_radius_automatically)
{
const Point<dim> vertex_relative = line->vertex(0) - center;
- r = sqrt(vertex_relative.square());
+ r = std::sqrt(vertex_relative.square());
}
else
r=radius;
// project to boundary
- middle *= r / sqrt(middle.square());
+ middle *= r / std::sqrt(middle.square());
middle += center;
return middle;
if (compute_radius_automatically)
{
const Point<dim> vertex_relative = quad->vertex(0) - center;
- r = sqrt(vertex_relative.square());
+ r = std::sqrt(vertex_relative.square());
}
else
r=radius;
// project to boundary
- middle *= r / sqrt(middle.square());
+ middle *= r / std::sqrt(middle.square());
middle += center;
return middle;
const Point<dim> v0=p0-center,
v1=p1-center;
- const double length=sqrt((v1-v0).square());
+ const double length=std::sqrt((v1-v0).square());
double eps=1e-14;
double r=0;
else
r=radius;
- Assert(fabs(v0.square()-r*r)<eps, ExcInternalError());
- Assert(fabs(v1.square()-r*r)<eps, ExcInternalError());
+ Assert(std::fabs(v0.square()-r*r)<eps, ExcInternalError());
+ Assert(std::fabs(v1.square()-r*r)<eps, ExcInternalError());
- const double alpha=acos((v0*v1)/sqrt(v0.square()*v1.square()));
+ const double alpha=std::acos((v0*v1)/sqrt(v0.square()*v1.square()));
const double d_alpha=alpha/(n+1);
const Point<dim> pm=0.5*(v0+v1);
- const double h=sqrt(pm.square());
+ const double h=std::sqrt(pm.square());
double beta=0;
unsigned int left_index=0, right_index=0;
// now sort the list of interior boundary
// dofs and eliminate duplicates
- sort (boundary_dofs.begin(), boundary_dofs.end());
- boundary_dofs.erase (unique (boundary_dofs.begin(),
- boundary_dofs.end()),
+ std::sort (boundary_dofs.begin(), boundary_dofs.end());
+ boundary_dofs.erase (std::unique (boundary_dofs.begin(),
+ boundary_dofs.end()),
boundary_dofs.end());
// now finally copy the result
const unsigned int n_q_points = patch_points.n_quadrature_points;
unsigned int cell_number = 0;
- typename std::vector<DataOutBase::Patch<dim> >::iterator patch = patches.begin();
+ typename std::vector<typename DataOutBase::Patch<dim> >::iterator patch = patches.begin();
typename DoFHandler<dim>::cell_iterator cell=first_cell();
// get first cell in this thread
std::vector<Point<dim+1> > angle_directions (n_patches_per_circle+1);
for (unsigned int i=0; i<=n_patches_per_circle; ++i)
{
- angle_directions[i][0] = cos(2*pi*i/n_patches_per_circle);
- angle_directions[i][1] = sin(2*pi*i/n_patches_per_circle);
+ angle_directions[i][0] = std::cos(2*pi*i/n_patches_per_circle);
+ angle_directions[i][1] = std::sin(2*pi*i/n_patches_per_circle);
};
// get first cell in this thread
for (unsigned int i=0; (i<data.this_thread)&&(cell != dofs->end()); ++i)
{
- advance (patch, n_patches_per_circle);
+ std::advance (patch, n_patches_per_circle);
++cell_number;
cell=next_cell(cell);
}
// belonging to this thread.
const int skip_threads = static_cast<signed int>(data.n_threads)-1;
for (int i=0; (i<skip_threads) && (cell != dofs->end()); ++i)
- advance (patch, n_patches_per_circle);
+ std::advance (patch, n_patches_per_circle);
// however, cell and cell
// number have not yet been
double s = 0;
for (unsigned int i=0; i<dim; ++i)
s += d[i]*d[i];
- return sqrt(s);
+ return std::sqrt(s);
};
// d_12=d_21=c
const double radicand = ::sqr(d[0][0] - d[1][1]) + 4*::sqr(d[0][1]);
const double eigenvalues[2]
- = { 0.5*(d[0][0] + d[1][1] + sqrt(radicand)),
- 0.5*(d[0][0] + d[1][1] - sqrt(radicand)) };
+ = { 0.5*(d[0][0] + d[1][1] + std::sqrt(radicand)),
+ 0.5*(d[0][0] + d[1][1] - std::sqrt(radicand)) };
return std::max (std::fabs (eigenvalues[0]),
std::fabs (eigenvalues[1]));
// the centers of two
// cells
Point<dim> y = neighbor_center - this_center;
- const double distance = sqrt(y.square());
+ const double distance = std::sqrt(y.square());
// normalize y
y /= distance;
// *** note that unlike in
};
for (unsigned int n=0; n<n_solution_vectors; ++n)
- (*errors[n])(present_cell) = sqrt((*errors[n])(present_cell));
+ (*errors[n])(present_cell) = std::sqrt((*errors[n])(present_cell));
};
};
case logarithmic:
{
- const float delta = (log(max_value)-log(min_value))/n_intervals;
+ const float delta = (std::log(max_value)-std::log(min_value))/n_intervals;
for (unsigned int n=0; n<n_intervals; ++n)
- intervals[0].push_back (Interval(exp(log(min_value)+n*delta),
- exp(log(min_value)+(n+1)*delta)));
+ intervals[0].push_back (Interval(std::exp(std::log(min_value)+n*delta),
+ std::exp(std::log(min_value)+(n+1)*delta)));
break;
};
// diagonal entry.
double max_diag_entry = 0;
for (unsigned int i=0; i<dofs_per_cell; ++i)
- if (fabs(cell_matrix(i,i)) > max_diag_entry)
+ if (std::fabs(cell_matrix(i,i)) > max_diag_entry)
max_diag_entry = fabs(cell_matrix(i,i));
#endif
//TODO:[?] We assume here that shape functions that have support also on the boundary also have their support point on the boundary (by having their indices in dof_is_on_face set true). This is not true, however, e.g. for discontinuous elements.
// compare here for relative
// smallness
- Assert (fabs(cell_matrix(i,j)) <= 1e-10 * max_diag_entry,
+ Assert (std::fabs(cell_matrix(i,j)) <= 1e-10 * max_diag_entry,
ExcInternalError ());
};
{
// compare here for relative
// smallness
- Assert (fabs(cell_vector(j)) <= 1e-10 * max_diag_entry,
+ Assert (std::fabs(cell_vector(j)) <= 1e-10 * max_diag_entry,
ExcInternalError());
};
mutex.release ();
TimeDependent::insert_timestep (const TimeStepBase *position,
TimeStepBase *new_timestep)
{
- Assert ((find(timesteps.begin(), timesteps.end(), position) != timesteps.end()) ||
+ Assert ((std::find(timesteps.begin(), timesteps.end(), position) != timesteps.end()) ||
(position == 0),
ExcInvalidPosition());
{
// inner time step
std::vector<TimeStepBase*>::iterator insert_position
- = find(timesteps.begin(), timesteps.end(), position);
+ = std::find(timesteps.begin(), timesteps.end(), position);
(*(insert_position-1))->set_next_timestep (new_timestep);
new_timestep->set_previous_timestep (*(insert_position-1));
// array
timesteps.insert ((position == 0 ?
timesteps.end() :
- find(timesteps.begin(), timesteps.end(), position)),
+ std::find(timesteps.begin(), timesteps.end(), position)),
new_timestep);
};
std::vector<std::vector<Tensor<1,dim> > > function_grads (n_q_points,
std::vector<Tensor<1,dim> >(n_components));
std::vector<double> weight_values (n_q_points);
- std::vector<Vector<double> > weight_vectors (n_q_points, n_components);
+ std::vector<Vector<double> > weight_vectors (n_q_points,
+ Vector<double>(n_components));
std::vector<Vector<double> > psi_values (n_q_points,
Vector<double>(n_components));
psi_scalar[q] = psi_values[q].norm_sqr();
// Integration on one cell
- diff = inner_product (psi_scalar.begin(), psi_scalar.end(),
- fe_values.get_JxW_values().begin(),
- 0.0);
+ diff = std::inner_product (psi_scalar.begin(), psi_scalar.end(),
+ fe_values.get_JxW_values().begin(),
+ 0.0);
if (norm == L2_norm)
diff=sqrt(diff);
break;
psi_scalar[q] = 0;
// weighted scalar product
for (unsigned int i=0; i<n_components; ++i)
- psi_scalar[q] += fabs(psi_values[q](i))
+ psi_scalar[q] += std::fabs(psi_values[q](i))
* weight_vectors[q](i);
}
else // weight->n_components == 1
psi_scalar[q] = 0;
for (unsigned int i=0; i<n_components; ++i)
{
- double newval = fabs(psi_values[q](i))
+ double newval = std::fabs(psi_values[q](i))
* weight_vectors[q](i);
if (psi_scalar[q]<newval)
psi_scalar[q] = newval;
* @name 5: Mixed stuff
*/
//@{
- /**
- * Output of vector in user-defined format.
- */
- void print (FILE* fp, const char* format = 0) const;
-
/**
* Output of vector in user-defined format.
*/
template <typename Number>
Number BlockVector<Number>::l2_norm () const
{
- return sqrt(norm_sqr());
+ return std::sqrt(norm_sqr());
}
dst(i) = s;
res += s*s;
}
- return sqrt(res);
+ return std::sqrt(res);
}
{
sum=0;
for (unsigned int row=0; row<n_rows; ++row)
- sum += fabs(el(row,col));
+ sum += std::fabs(el(row,col));
if (sum > max)
max = sum;
}
{
sum=0;
for (unsigned int col=0; col<n_cols; ++col)
- sum += fabs(el(row,col));
+ sum += std::fabs(el(row,col));
if (sum > max)
max = sum;
}
number s = 0.;
for (unsigned int i=0;i<n_rows()*n_cols();++i)
s += data()[i]*data()[i];
- return sqrt(s);
+ return std::sqrt(s);
}
s += (*this)(i,j)*(*this)(i,j);
}
if (s!=0.)
- return sqrt(a)/sqrt(s);
+ return std::sqrt(a)/std::sqrt(s);
return 0;
}
for (unsigned int j=0; j<n(); ++j)
{
// pivotsearch
- number max = fabs(el(j,j));
+ number max = std::fabs(el(j,j));
unsigned int r = j;
for (unsigned int i=j+1; i<n(); ++i)
{
- if (fabs(el(i,j)) > max)
+ if (std::fabs(el(i,j)) > max)
{
- max = fabs(el(i,j));
+ max = std::fabs(el(i,j));
r = i;
}
}
number2 sigma = 0;
unsigned int i;
for (i=j ; i<m() ; ++i) sigma += el(i,j)*el(i,j);
- if (fabs(sigma) < 1.e-15) return;
+ if (std::fabs(sigma) < 1.e-15) return;
number2 s = el(j,j);
- s = (s<0) ? sqrt(sigma) : -sqrt(sigma);
+ s = (s<0) ? std::sqrt(sigma) : -std::sqrt(sigma);
number2 dj = s;
number2 beta = 1./(s*el(j,j)-sigma);
number2 sum = 0.;
for (unsigned int i=n() ; i<m() ; ++i) sum += src(i) * src(i);
- return sqrt(sum);
+ return std::sqrt(sum);
}
double
SolverCG<VECTOR>::criterion()
{
- return sqrt(res2);
+ return std::sqrt(res2);
}
number rowsum = 0;
for (unsigned int global_index=rowstart;
global_index<rowstart+rowlength; ++global_index)
- rowsum += fabs(global_entry(global_index));
+ rowsum += std::fabs(global_entry(global_index));
*diagonal_element += strengthen_diagonal * rowsum;
};
if (filename != "")
{
- int status = remove (filename.c_str());
+ int status = std::remove (filename.c_str());
AssertThrow (status == 0, ExcInternalError());
filename = "";
* @name 5: Mixed stuff
*/
//@{
- /**
- * Output of vector in user-defined format.
- */
- void print (FILE* fp, const char* format = 0) const;
-
/**
* Output of vector in user-defined format.
*/
eptr = ptr + (dim/4)*4;
while (ptr!=eptr)
{
- sum0 += fabs(*ptr++);
- sum1 += fabs(*ptr++);
- sum2 += fabs(*ptr++);
- sum3 += fabs(*ptr++);
+ sum0 += std::fabs(*ptr++);
+ sum1 += std::fabs(*ptr++);
+ sum2 += std::fabs(*ptr++);
+ sum3 += std::fabs(*ptr++);
};
// add up remaining elements
while (ptr != end())
- sum0 += fabs(*ptr++);
+ sum0 += std::fabs(*ptr++);
return sum0+sum1+sum2+sum3;
};
template <typename Number>
Number Vector<Number>::l2_norm () const
{
- return sqrt(norm_sqr());
+ return std::sqrt(norm_sqr());
};
max3=0.;
for (unsigned int i=0; i<(dim/4); ++i)
{
- if (max0<fabs(val[4*i])) max0=fabs(val[4*i]);
- if (max1<fabs(val[4*i+1])) max1=fabs(val[4*i+1]);
- if (max2<fabs(val[4*i+2])) max2=fabs(val[4*i+2]);
- if (max3<fabs(val[4*i+3])) max3=fabs(val[4*i+3]);
+ if (max0<std::fabs(val[4*i])) max0=std::fabs(val[4*i]);
+ if (max1<std::fabs(val[4*i+1])) max1=std::fabs(val[4*i+1]);
+ if (max2<std::fabs(val[4*i+2])) max2=std::fabs(val[4*i+2]);
+ if (max3<std::fabs(val[4*i+3])) max3=std::fabs(val[4*i+3]);
};
// add up remaining elements
for (unsigned int i=(dim/4)*4; i<dim; ++i)
- if (max0<fabs(val[i]))
- max0 = fabs(val[i]);
+ if (max0<std::fabs(val[i]))
+ max0 = std::fabs(val[i]);
return std::max (std::max(max0, max1),
std::max(max2, max3));
-template <typename Number>
-void Vector<Number>::print (FILE* f, const char* format) const
-{
- Assert (dim!=0, ExcEmptyVector());
- if (!format) format = " %5.2f";
- for (unsigned int j=0;j<size();j++)
- fprintf(f, format, val[j]);
- fputc('\n',f);
-}
-
-
-
template <typename Number>
void Vector<Number>::print (const char* format) const
{
Assert (dim!=0, ExcEmptyVector());
if (!format) format = " %5.2f";
for (unsigned int j=0;j<size();j++)
- printf (format, val[j]);
- printf ("\n");
+ std::printf (format, val[j]);
+ std::printf ("\n");
}
const unsigned int sz = size();
char buf[16];
- sprintf(buf, "%d", sz);
- strcat(buf, "\n[");
+ std::sprintf(buf, "%d", sz);
+ std::strcat(buf, "\n[");
- out.write(buf, strlen(buf));
+ out.write(buf, std::strlen(buf));
out.write (reinterpret_cast<const char*>(begin()),
reinterpret_cast<const char*>(end())
- reinterpret_cast<const char*>(begin()));
in.getline(buf,16,'\n');
- sz=atoi(buf);
+ sz=std::atoi(buf);
// fast initialization, since the
// data elements are overwritten anyway
for (unsigned int row=0; row<rows; ++row)
for (std::set<unsigned int>::const_iterator i=column_indices[row].begin();
i!=column_indices[row].end(); ++i)
- if (static_cast<unsigned int>(abs(static_cast<int>(row-*i))) > b)
- b = abs(static_cast<signed int>(row-*i));
+ if (static_cast<unsigned int>(std::abs(static_cast<int>(row-*i))) > b)
+ b = std::abs(static_cast<signed int>(row-*i));
return b;
};
for (unsigned int j=rowstart[i]; j<rowstart[i+1]; ++j)
if (colnums[j] != invalid_entry)
{
- if (static_cast<unsigned int>(abs(static_cast<int>(i-colnums[j]))) > b)
- b = abs(static_cast<signed int>(i-colnums[j]));
+ if (static_cast<unsigned int>(std::abs(static_cast<int>(i-colnums[j]))) > b)
+ b = std::abs(static_cast<signed int>(i-colnums[j]));
}
else
// leave if at the end of