Skip to content

Commit

Permalink
Rename {P,Q}1Element to {P,Q}1Element2
Browse files Browse the repository at this point in the history
Now all element names have a suffix corresponding to the number of dimensions.
  • Loading branch information
ckhroulev committed Oct 14, 2020
1 parent 414dedb commit f81a918
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/inverse/IP_SSAHardavForwardProblem.hh
Expand Up @@ -192,7 +192,7 @@ protected:
IceModelVec2S m_hardav;

fem::ElementIterator m_element_index;
fem::Q1Element m_element;
fem::Q1Element2 m_element;

/// KSP used in \ref apply_linearization and \ref apply_linearization_transpose
petsc::KSP m_ksp;
Expand Down
2 changes: 1 addition & 1 deletion src/inverse/IP_SSATaucForwardProblem.hh
Expand Up @@ -194,7 +194,7 @@ protected:
IceModelVec2V m_du_local;

fem::ElementIterator m_element_index;
fem::Q1Element m_element;
fem::Q1Element2 m_element;

/// KSP used in \ref apply_linearization and \ref apply_linearization_transpose
petsc::KSP m_ksp;
Expand Down
2 changes: 1 addition & 1 deletion src/inverse/functional/IPFunctional.hh
Expand Up @@ -70,7 +70,7 @@ protected:
IceGrid::ConstPtr m_grid;

fem::ElementIterator m_element_index;
fem::Q1Element m_element;
fem::Q1Element2 m_element;

private:
// Hide copy/assignment operations
Expand Down
30 changes: 15 additions & 15 deletions src/stressbalance/ssa/SSAFEM.cc
Expand Up @@ -567,12 +567,12 @@ void SSAFEM::cache_residual_cfbc(const Inputs &inputs) {

const unsigned int Nk = fem::q1::n_chi;

using fem::P1Element;
using fem::P1Element2;
fem::P1Quadrature3 Q_p1;
P1Element p1_element[Nk] = {P1Element(*m_grid, Q_p1, 0),
P1Element(*m_grid, Q_p1, 1),
P1Element(*m_grid, Q_p1, 2),
P1Element(*m_grid, Q_p1, 3)};
P1Element2 p1_element[Nk] = {P1Element2(*m_grid, Q_p1, 0),
P1Element2(*m_grid, Q_p1, 1),
P1Element2(*m_grid, Q_p1, 2),
P1Element2(*m_grid, Q_p1, 3)};

using mask::ocean;

Expand Down Expand Up @@ -737,12 +737,12 @@ void SSAFEM::compute_local_function(Vector2 const *const *const velocity_global,
const unsigned int Nk = fem::q1::n_chi;
const unsigned int Nq_max = fem::MAX_QUADRATURE_SIZE;

using fem::P1Element;
using fem::P1Element2;
fem::P1Quadrature3 Q_p1;
P1Element p1_element[Nk] = {P1Element(*m_grid, Q_p1, 0),
P1Element(*m_grid, Q_p1, 1),
P1Element(*m_grid, Q_p1, 2),
P1Element(*m_grid, Q_p1, 3)};
P1Element2 p1_element[Nk] = {P1Element2(*m_grid, Q_p1, 0),
P1Element2(*m_grid, Q_p1, 1),
P1Element2(*m_grid, Q_p1, 2),
P1Element2(*m_grid, Q_p1, 3)};

IceModelVec::AccessList list{&m_node_type, &m_coefficients, &m_boundary_integral};

Expand Down Expand Up @@ -956,12 +956,12 @@ void SSAFEM::compute_local_jacobian(Vector2 const *const *const velocity_global,
const unsigned int Nk = fem::q1::n_chi;
const unsigned int Nq_max = fem::MAX_QUADRATURE_SIZE;

using fem::P1Element;
using fem::P1Element2;
fem::P1Quadrature3 Q_p1;
P1Element p1_element[Nk] = {P1Element(*m_grid, Q_p1, 0),
P1Element(*m_grid, Q_p1, 1),
P1Element(*m_grid, Q_p1, 2),
P1Element(*m_grid, Q_p1, 3)};
P1Element2 p1_element[Nk] = {P1Element2(*m_grid, Q_p1, 0),
P1Element2(*m_grid, Q_p1, 1),
P1Element2(*m_grid, Q_p1, 2),
P1Element2(*m_grid, Q_p1, 3)};

// Zero out the Jacobian in preparation for updating it.
PetscErrorCode ierr = MatZeroEntries(Jac);
Expand Down
2 changes: 1 addition & 1 deletion src/stressbalance/ssa/SSAFEM.hh
Expand Up @@ -137,7 +137,7 @@ protected:
double m_epsilon_ssa;

fem::ElementIterator m_element_index;
fem::Q1Element m_q1_element;
fem::Q1Element2 m_q1_element;
// fem::P1Element m_p1_element;

// Support for direct specification of driving stress to the FEM SSA solver. This helps
Expand Down
4 changes: 2 additions & 2 deletions src/util/fem/Element.cc
Expand Up @@ -243,7 +243,7 @@ void Element::add_contribution(const double *K, Mat J) const {
PISM_CHK(ierr, "MatSetValuesBlockedStencil");
}

Q1Element::Q1Element(const IceGrid &grid, const Quadrature &quadrature)
Q1Element2::Q1Element2(const IceGrid &grid, const Quadrature &quadrature)
: Element2(grid, quadrature.weights().size(), q1::n_chi, q1::n_chi) {

double dx = grid.dx();
Expand All @@ -268,7 +268,7 @@ Q1Element::Q1Element(const IceGrid &grid, const Quadrature &quadrature)
reset(0, 0);
}

P1Element::P1Element(const IceGrid &grid, const Quadrature &quadrature, int type)
P1Element2::P1Element2(const IceGrid &grid, const Quadrature &quadrature, int type)
: Element2(grid, quadrature.weights().size(), p1::n_chi, q1::n_chi) {

double dx = grid.dx();
Expand Down
10 changes: 5 additions & 5 deletions src/util/fem/Element.hh
Expand Up @@ -248,15 +248,15 @@ protected:
};

//! Q1 element with sides parallel to X and Y axes
class Q1Element : public Element2 {
class Q1Element2 : public Element2 {
public:
Q1Element(const IceGrid &grid, const Quadrature &quadrature);
Q1Element2(const IceGrid &grid, const Quadrature &quadrature);
};

//! P1 element embedded in Q1Element
class P1Element : public Element2 {
//! P1 element embedded in Q1Element2
class P1Element2 : public Element2 {
public:
P1Element(const IceGrid &grid, const Quadrature &quadrature, int N);
P1Element2(const IceGrid &grid, const Quadrature &quadrature, int N);
};

class Element3 : public Element {
Expand Down

0 comments on commit f81a918

Please sign in to comment.