Added: Default implementation of IntegrandBase::getNoFields(int group)

returning the number of norm groups when the argument group is zero.
This commit is contained in:
Knut Morten Okstad
2016-01-12 18:27:58 +01:00
parent 57b9ef5864
commit c08b24db68
2 changed files with 16 additions and 1 deletions

View File

@@ -254,6 +254,19 @@ LocalIntegral* NormBase::getLocalIntegral (size_t, size_t iEl, bool) const
}
size_t NormBase::getNoFields (int group) const
{
if (group > 0) return 0;
// Calculate the number of norm groups
size_t nf = 1;
for (size_t i = 0; i < prjsol.size(); i++)
if (!prjsol.empty()) nf++;
return nf;
}
bool NormBase::initElement (const std::vector<int>& MNPC,
const FiniteElement& fe,
const Vec3& Xc, size_t nPt,

View File

@@ -331,7 +331,9 @@ public:
virtual void addBoundaryTerms(Vectors&, double) const {}
//! \brief Returns the number of norm groups or size of a specified group.
virtual size_t getNoFields(int group = 0) const { return 0; }
//! \details If \a group is zero, the number of norm groups is returned.
//! If \a group is greater than zero, the size of that groups is returned.
virtual size_t getNoFields(int group = 0) const;
//! \brief Returns the name of a norm quantity.
//! \param[in] i The norm group