Skip to content

Commit

Permalink
Merge pull request #107 from bangerth/fixes-1
Browse files Browse the repository at this point in the history
Fix some code gallery programs.
  • Loading branch information
marcfehling authored Jul 19, 2022
2 parents 35afdab + e861af7 commit b7c0334
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 104 deletions.
8 changes: 4 additions & 4 deletions Distributed_LDG_Method/LDGPoisson.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ make_dofs()
DoFTools::extract_locally_relevant_dofs(dof_handler,
locally_relevant_dofs);

std::vector<types::global_dof_index> dofs_per_component(dim+1);
DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
const std::vector<types::global_dof_index> dofs_per_component =
DoFTools::count_dofs_per_fe_component(dof_handler);

// Discontinuous Galerkin methods are fantanistic methods in part because
// many of the limitations of traditional finite element methods no longer
Expand Down Expand Up @@ -360,7 +360,7 @@ make_dofs()
dsp);

SparsityTools::distribute_sparsity_pattern(dsp,
dof_handler.n_locally_owned_dofs_per_processor(),
dof_handler.locally_owned_dofs(),
MPI_COMM_WORLD,
locally_relevant_dofs);

Expand Down Expand Up @@ -641,7 +641,7 @@ assemble_system()
// compute the interior fluxes across the children faces
// and the neighbor's face.
for (unsigned int subface_no=0;
subface_no < face->number_of_children();
subface_no < face->n_children();
++subface_no)
{
// We then get the neighbor cell's subface that
Expand Down
6 changes: 3 additions & 3 deletions ElastoplasticTorsion/ElastoplasticTorsion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ namespace nsp
H1_error = difference_per_cell.l2_norm();

// compute W1infty error (save to difference_per_cell)
const QTrapez<1> q_trapez;
const QTrapezoid<1> q_trapez;
const QIterated<dim> q_iterated (q_trapez, 5);
VectorTools::integrate_difference (dof_handler,present_solution,Solution<dim>(),
difference_per_cell,q_iterated,VectorTools::W1infty_seminorm);
Expand Down Expand Up @@ -746,7 +746,7 @@ namespace nsp
std::map<types::global_dof_index,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(),
Functions::ZeroFunction<dim>(),
boundary_values);
MatrixTools::apply_boundary_values (boundary_values,
system_matrix,
Expand Down Expand Up @@ -958,7 +958,7 @@ namespace nsp
double ElastoplasticTorsion<dim>::dual_infty_error () const
{
double obj = 0.0;
const QTrapez<1> q_trapez;
const QTrapezoid<1> q_trapez;
const QIterated<dim> quadrature_formula (q_trapez, 10);

FEValues<dim> fe_values (fe, quadrature_formula,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ namespace LMM
{
Point<dim> operator() (const Point<dim> &in) const
{
static const Tensor<2,dim> rot_mat = Physics::Transformations::Rotations::rotation_matrix_3d(Point<dim>(0,1,0), M_PI/2.0);
static const Tensor<2,dim> rot_mat = Physics::Transformations::Rotations::rotation_matrix_3d(Tensor<1,dim>({0,1,0}), M_PI/2.0);
return Point<dim>(rot_mat*in);
}
};
Expand Down Expand Up @@ -1439,7 +1439,7 @@ namespace LMM
component_mask_x.set(0, true);
VectorTools::interpolate_boundary_values (dof_handler,
parameters.bid_CC_dirichlet_symm_X,
ZeroFunction<dim>(dim),
Functions::ZeroFunction<dim>(dim),
boundary_values,
component_mask_x);
}
Expand All @@ -1449,7 +1449,7 @@ namespace LMM
component_mask_z.set(2, true);
VectorTools::interpolate_boundary_values (dof_handler,
parameters.bid_CC_dirichlet_symm_Z,
ZeroFunction<dim>(dim),
Functions::ZeroFunction<dim>(dim),
boundary_values,
component_mask_z);
}
Expand Down Expand Up @@ -1504,7 +1504,7 @@ namespace LMM
component_mask_x.set(0, true);
VectorTools::interpolate_boundary_values (dof_handler,
parameters.bid_BB_dirichlet_X,
ZeroFunction<dim>(dim),
Functions::ZeroFunction<dim>(dim),
boundary_values,
component_mask_x);
}
Expand Down Expand Up @@ -1562,7 +1562,7 @@ namespace LMM
ComponentMask component_mask_x (dim, true);
VectorTools::interpolate_boundary_values (dof_handler,
parameters.bid_BB_dirichlet_X,
ZeroFunction<dim>(dim),
Functions::ZeroFunction<dim>(dim),
boundary_values,
component_mask_x);
}
Expand All @@ -1573,7 +1573,7 @@ namespace LMM
component_mask_x.set(2, true);
VectorTools::interpolate_boundary_values (dof_handler,
parameters.bid_BB_neumann,
ZeroFunction<dim>(dim),
Functions::ZeroFunction<dim>(dim),
boundary_values,
component_mask_x);
}
Expand Down
2 changes: 1 addition & 1 deletion MCMC-Laplace/mcmc-laplace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ namespace ForwardSimulator

VectorTools::interpolate_boundary_values(dof_handler,
0,
ZeroFunction<dim>(),
Functions::ZeroFunction<dim>(),
boundary_values);
}
}
Expand Down
6 changes: 3 additions & 3 deletions MultipointFluxMixedFiniteElementMethods/mfmfe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ namespace MFMFE

dof_handler.distribute_dofs(fe);
DoFRenumbering::component_wise (dof_handler);
std::vector<types::global_dof_index> dofs_per_component (dim+1);
DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
const std::vector<types::global_dof_index> dofs_per_component
= DoFTools::count_dofs_per_fe_component (dof_handler);

QGaussLobatto<dim> quad(degree+1);
QGauss<dim-1> face_quad(degree);
Expand Down Expand Up @@ -858,7 +858,7 @@ namespace MFMFE

Vector<double> cellwise_errors (triangulation.n_active_cells());

QTrapez<1> q_trapez;
QTrapezoid<1> q_trapez;
QIterated<dim> quadrature(q_trapez,degree+2);
QGauss<dim> quadrature_super(degree);

Expand Down
4 changes: 2 additions & 2 deletions NavierStokes_TRBDF2_DG/navier_stokes_TRBDF2_DG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ namespace NS_TRBDF2 {
auto& inverse_diagonal = this->inverse_diagonal_entries->get_vector();

if(NS_stage == 1) {
MatrixFreeTools::compute_diagonal<dim, Number, VectorizedArray<Number>>
::MatrixFreeTools::compute_diagonal<dim, Number, VectorizedArray<Number>>
(*(this->data),
inverse_diagonal,
[&](const auto& data, auto& dst, const auto& src, const auto& cell_range) {
Expand All @@ -2027,7 +2027,7 @@ namespace NS_TRBDF2 {
0);
}
else if(NS_stage == 2) {
MatrixFreeTools::compute_diagonal<dim, Number, VectorizedArray<Number>>
::MatrixFreeTools::compute_diagonal<dim, Number, VectorizedArray<Number>>
(*(this->data),
inverse_diagonal,
[&](const auto& data, auto& dst, const auto& src, const auto& cell_range) {
Expand Down
Loading

0 comments on commit b7c0334

Please sign in to comment.