Skip to content

Commit

Permalink
Use different name for new class
Browse files Browse the repository at this point in the history
  • Loading branch information
fdrmrc committed Sep 29, 2024
1 parent ef7afad commit 0d73b41
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion examples/poisson.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ class Poisson
Triangulation<dim> tria;
#ifdef HEX
MappingQ1<dim> mapping;
FE_AGGLODGP<dim> dg_fe;
FE_AggloDGP<dim> dg_fe;
#else
MappingFE<dim> mapping;
FE_SimplexDGP<dim> dg_fe;
Expand Down
14 changes: 7 additions & 7 deletions include/fe_agglodgp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DEAL_II_NAMESPACE_OPEN
*
* This finite element implements complete polynomial spaces, that is,
* dim-dimensional polynomials of degree p. For example, in 2d the element
* FE_AGGLODGP(1) would represent the span of the functions $\{1,\hat x,\hat
* FE_AggloDGP(1) would represent the span of the functions $\{1,\hat x,\hat
* y\}$, which is in contrast to the element FE_DGQ(1) that is formed by the
* span of
* $\{1,\hat x,\hat y,\hat x\hat y\}$. Since the DGP space has only three
Expand All @@ -54,7 +54,7 @@ DEAL_II_NAMESPACE_OPEN
*
* The shape functions are defined in the class PolynomialSpace. The
* polynomials used inside PolynomialSpace are Polynomials::Legendre up to
* degree <tt>p</tt> given in FE_AGGLODGP. For the ordering of the basis
* degree <tt>p</tt> given in FE_AggloDGP. For the ordering of the basis
* functions, refer to PolynomialSpace, remembering that the Legendre
* polynomials are ordered by ascending degree.
*
Expand Down Expand Up @@ -84,7 +84,7 @@ DEAL_II_NAMESPACE_OPEN
* described by this element does not contain $P(k)$, even if we use a basis
* of polynomials of degree $k$. Consequently, for example, on meshes with
* non-affine cells, a linear function can not be exactly represented by
* elements of type FE_AGGLODGP(1) or FE_DGPMonomial(1).
* elements of type FE_AggloDGP(1) or FE_DGPMonomial(1).
*
* This can be understood by the following 2-d example: consider the cell with
* vertices at $(0,0),(1,0),(0,1),(s,s)$:
Expand Down Expand Up @@ -308,17 +308,17 @@ DEAL_II_NAMESPACE_OPEN
* <td align="center"></td> </tr> </table>
*/
template <int dim, int spacedim = dim>
class FE_AGGLODGP : public FE_Poly<dim, spacedim>
class FE_AggloDGP : public FE_Poly<dim, spacedim>
{
public:
/**
* Constructor for tensor product polynomials of degree @p p.
*/
FE_AGGLODGP(const unsigned int p);
FE_AggloDGP(const unsigned int p);

/**
* Return a string that uniquely identifies a finite element. This class
* returns <tt>FE_AGGLODGP<dim>(degree)</tt>, with @p dim and @p degree replaced
* returns <tt>FE_AggloDGP<dim>(degree)</tt>, with @p dim and @p degree replaced
* by appropriate values.
*/
virtual std::string
Expand Down Expand Up @@ -377,7 +377,7 @@ class FE_AGGLODGP : public FE_Poly<dim, spacedim>
* Return whether this element implements its hanging node constraints in
* the new way, which has to be used to make elements "hp-compatible".
*
* For the FE_AGGLODGP class the result is always true (independent of the
* For the FE_AggloDGP class the result is always true (independent of the
* degree of the element), as it has no hanging nodes (being a discontinuous
* element).
*/
Expand Down
4 changes: 2 additions & 2 deletions source/agglomeration_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ AgglomerationHandler<dim, spacedim>::distribute_agglomerated_dofs(
{
if (dynamic_cast<const FE_DGQ<dim> *>(&fe_space))
fe = std::make_unique<FE_DGQ<dim>>(fe_space.degree);
else if (dynamic_cast<const FE_AGGLODGP<dim> *>(&fe_space))
fe = std::make_unique<FE_AGGLODGP<dim>>(fe_space.degree);
else if (dynamic_cast<const FE_AggloDGP<dim> *>(&fe_space))
fe = std::make_unique<FE_AggloDGP<dim>>(fe_space.degree);
else if (dynamic_cast<const FE_SimplexDGP<dim> *>(&fe_space))
fe = std::make_unique<FE_SimplexDGP<dim>>(fe_space.degree);
else
Expand Down
54 changes: 27 additions & 27 deletions source/fe_agglodgp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
DEAL_II_NAMESPACE_OPEN

template <int dim, int spacedim>
FE_AGGLODGP<dim, spacedim>::FE_AGGLODGP(const unsigned int degree)
FE_AggloDGP<dim, spacedim>::FE_AggloDGP(const unsigned int degree)
: FE_Poly<dim, spacedim>(
PolynomialSpace<dim>(
Polynomials::Legendre::generate_complete_basis(degree)),
Expand Down Expand Up @@ -57,14 +57,14 @@ FE_AGGLODGP<dim, spacedim>::FE_AGGLODGP(const unsigned int degree)

template <int dim, int spacedim>
std::string
FE_AGGLODGP<dim, spacedim>::get_name() const
FE_AggloDGP<dim, spacedim>::get_name() const
{
// note that the FETools::get_fe_by_name function depends on the
// particular format of the string this function returns, so they have to be
// kept in sync

std::ostringstream namebuf;
namebuf << "FE_AGGLODGP<" << Utilities::dim_string(dim, spacedim) << ">("
namebuf << "FE_AggloDGP<" << Utilities::dim_string(dim, spacedim) << ">("
<< this->degree << ")";

return namebuf.str();
Expand All @@ -74,9 +74,9 @@ FE_AGGLODGP<dim, spacedim>::get_name() const

template <int dim, int spacedim>
std::unique_ptr<FiniteElement<dim, spacedim>>
FE_AGGLODGP<dim, spacedim>::clone() const
FE_AggloDGP<dim, spacedim>::clone() const
{
return std::make_unique<FE_AGGLODGP<dim, spacedim>>(*this);
return std::make_unique<FE_AggloDGP<dim, spacedim>>(*this);
}


Expand All @@ -88,7 +88,7 @@ FE_AGGLODGP<dim, spacedim>::clone() const

template <int dim, int spacedim>
std::vector<unsigned int>
FE_AGGLODGP<dim, spacedim>::get_dpo_vector(const unsigned int deg)
FE_AggloDGP<dim, spacedim>::get_dpo_vector(const unsigned int deg)
{
std::vector<unsigned int> dpo(dim + 1, 0U);
dpo[dim] = deg + 1;
Expand All @@ -104,7 +104,7 @@ FE_AGGLODGP<dim, spacedim>::get_dpo_vector(const unsigned int deg)

template <int dim, int spacedim>
void
FE_AGGLODGP<dim, spacedim>::get_face_interpolation_matrix(
FE_AggloDGP<dim, spacedim>::get_face_interpolation_matrix(
const FiniteElement<dim, spacedim> &x_source_fe,
FullMatrix<double> &interpolation_matrix,
const unsigned int) const
Expand All @@ -115,8 +115,8 @@ FE_AGGLODGP<dim, spacedim>::get_face_interpolation_matrix(
// need to do here.
(void)interpolation_matrix;
using FE = FiniteElement<dim, spacedim>;
using FEDGP = FE_AGGLODGP<dim, spacedim>;
AssertThrow((x_source_fe.get_name().find("FE_AGGLODGP<") == 0) ||
using FEDGP = FE_AggloDGP<dim, spacedim>;
AssertThrow((x_source_fe.get_name().find("FE_AggloDGP<") == 0) ||
(dynamic_cast<const FEDGP *>(&x_source_fe) != nullptr),
typename FE::ExcInterpolationNotImplemented());

Expand All @@ -130,7 +130,7 @@ FE_AGGLODGP<dim, spacedim>::get_face_interpolation_matrix(

template <int dim, int spacedim>
void
FE_AGGLODGP<dim, spacedim>::get_subface_interpolation_matrix(
FE_AggloDGP<dim, spacedim>::get_subface_interpolation_matrix(
const FiniteElement<dim, spacedim> &x_source_fe,
const unsigned int,
FullMatrix<double> &interpolation_matrix,
Expand All @@ -142,8 +142,8 @@ FE_AGGLODGP<dim, spacedim>::get_subface_interpolation_matrix(
// need to do here.
(void)interpolation_matrix;
using FE = FiniteElement<dim, spacedim>;
using FEDGP = FE_AGGLODGP<dim, spacedim>;
AssertThrow((x_source_fe.get_name().find("FE_AGGLODGP<") == 0) ||
using FEDGP = FE_AggloDGP<dim, spacedim>;
AssertThrow((x_source_fe.get_name().find("FE_AggloDGP<") == 0) ||
(dynamic_cast<const FEDGP *>(&x_source_fe) != nullptr),
typename FE::ExcInterpolationNotImplemented());

Expand All @@ -157,7 +157,7 @@ FE_AGGLODGP<dim, spacedim>::get_subface_interpolation_matrix(

template <int dim, int spacedim>
bool
FE_AGGLODGP<dim, spacedim>::hp_constraints_are_implemented() const
FE_AggloDGP<dim, spacedim>::hp_constraints_are_implemented() const
{
return true;
}
Expand All @@ -166,7 +166,7 @@ FE_AGGLODGP<dim, spacedim>::hp_constraints_are_implemented() const

template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int>>
FE_AGGLODGP<dim, spacedim>::hp_vertex_dof_identities(
FE_AggloDGP<dim, spacedim>::hp_vertex_dof_identities(
const FiniteElement<dim, spacedim> &fe_other) const
{
(void)fe_other;
Expand All @@ -177,11 +177,11 @@ FE_AGGLODGP<dim, spacedim>::hp_vertex_dof_identities(

template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int>>
FE_AGGLODGP<dim, spacedim>::hp_line_dof_identities(
FE_AggloDGP<dim, spacedim>::hp_line_dof_identities(
const FiniteElement<dim, spacedim> &fe_other) const
{
// there are no such constraints for DGP elements at all
if (dynamic_cast<const FE_AGGLODGP<dim, spacedim> *>(&fe_other) != nullptr)
if (dynamic_cast<const FE_AggloDGP<dim, spacedim> *>(&fe_other) != nullptr)
return std::vector<std::pair<unsigned int, unsigned int>>();
else
{
Expand All @@ -194,12 +194,12 @@ FE_AGGLODGP<dim, spacedim>::hp_line_dof_identities(

template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int>>
FE_AGGLODGP<dim, spacedim>::hp_quad_dof_identities(
FE_AggloDGP<dim, spacedim>::hp_quad_dof_identities(
const FiniteElement<dim, spacedim> &fe_other,
const unsigned int) const
{
// there are no such constraints for DGP elements at all
if (dynamic_cast<const FE_AGGLODGP<dim, spacedim> *>(&fe_other) != nullptr)
if (dynamic_cast<const FE_AggloDGP<dim, spacedim> *>(&fe_other) != nullptr)
return std::vector<std::pair<unsigned int, unsigned int>>();
else
{
Expand All @@ -212,7 +212,7 @@ FE_AGGLODGP<dim, spacedim>::hp_quad_dof_identities(

template <int dim, int spacedim>
FiniteElementDomination::Domination
FE_AGGLODGP<dim, spacedim>::compare_for_domination(
FE_AggloDGP<dim, spacedim>::compare_for_domination(
const FiniteElement<dim, spacedim> &fe_other,
const unsigned int codim) const
{
Expand All @@ -228,8 +228,8 @@ FE_AGGLODGP<dim, spacedim>::compare_for_domination(

// cell domination
// ---------------
if (const FE_AGGLODGP<dim, spacedim> *fe_dgp_other =
dynamic_cast<const FE_AGGLODGP<dim, spacedim> *>(&fe_other))
if (const FE_AggloDGP<dim, spacedim> *fe_dgp_other =
dynamic_cast<const FE_AggloDGP<dim, spacedim> *>(&fe_other))
{
if (this->degree < fe_dgp_other->degree)
return FiniteElementDomination::this_element_dominates;
Expand Down Expand Up @@ -258,7 +258,7 @@ FE_AGGLODGP<dim, spacedim>::compare_for_domination(

template <int dim, int spacedim>
bool
FE_AGGLODGP<dim, spacedim>::has_support_on_face(const unsigned int,
FE_AggloDGP<dim, spacedim>::has_support_on_face(const unsigned int,
const unsigned int) const
{
// all shape functions have support on all faces
Expand All @@ -269,7 +269,7 @@ FE_AGGLODGP<dim, spacedim>::has_support_on_face(const unsigned int,

template <int dim, int spacedim>
std::pair<Table<2, bool>, std::vector<unsigned int>>
FE_AGGLODGP<dim, spacedim>::get_constant_modes() const
FE_AggloDGP<dim, spacedim>::get_constant_modes() const
{
Table<2, bool> constant_modes(1, this->n_dofs_per_cell());
constant_modes(0, 0) = true;
Expand All @@ -281,7 +281,7 @@ FE_AGGLODGP<dim, spacedim>::get_constant_modes() const

template <int dim, int spacedim>
std::size_t
FE_AGGLODGP<dim, spacedim>::memory_consumption() const
FE_AggloDGP<dim, spacedim>::memory_consumption() const
{
DEAL_II_NOT_IMPLEMENTED();
return 0;
Expand All @@ -290,9 +290,9 @@ FE_AGGLODGP<dim, spacedim>::memory_consumption() const


// explicit instantiations
template class FE_AGGLODGP<1>;
template class FE_AGGLODGP<2>;
template class FE_AGGLODGP<3>;
template class FE_AggloDGP<1>;
template class FE_AggloDGP<2>;
template class FE_AggloDGP<3>;


DEAL_II_NAMESPACE_CLOSE
6 changes: 3 additions & 3 deletions test/polydeal/exact_solutions_dgp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Poisson

Triangulation<dim> tria;
MappingQ<dim> mapping;
FE_AGGLODGP<dim> *dg_fe;
FE_AggloDGP<dim> *dg_fe;
std::unique_ptr<AgglomerationHandler<dim>> ah;
// no hanging node in DG discretization, we define an AffineConstraints
// object
Expand Down Expand Up @@ -275,12 +275,12 @@ Poisson<dim>::Poisson(const SolutionType &solution_type)
{
if (sol_type == SolutionType::LinearSolution)
{
dg_fe = new FE_AGGLODGP<dim>{1};
dg_fe = new FE_AggloDGP<dim>{1};
analytical_solution = new SolutionLinear<dim>();
}
else
{
dg_fe = new FE_AGGLODGP<dim>{2};
dg_fe = new FE_AggloDGP<dim>{2};
analytical_solution = new SolutionQuadratic<dim>();
}
}
Expand Down

0 comments on commit 0d73b41

Please sign in to comment.