Added: Option to use projected solution for boundary integrands.
Fixed: Be more forgiving on the length of the norm prefix.
This commit is contained in:
parent
0b0a365b38
commit
d108607d35
@ -302,6 +302,9 @@ bool NormBase::initElement (const std::vector<int>& MNPC,
|
|||||||
bool NormBase::initElementBou (const std::vector<int>& MNPC,
|
bool NormBase::initElementBou (const std::vector<int>& MNPC,
|
||||||
LocalIntegral& elmInt)
|
LocalIntegral& elmInt)
|
||||||
{
|
{
|
||||||
|
if (projBou && !this->initProjection(MNPC,elmInt))
|
||||||
|
return false;
|
||||||
|
|
||||||
return myProblem.initElementBou(MNPC,elmInt);
|
return myProblem.initElementBou(MNPC,elmInt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,6 +314,9 @@ bool NormBase::initElementBou (const std::vector<int>& MNPC,
|
|||||||
const std::vector<size_t>& basis_sizes,
|
const std::vector<size_t>& basis_sizes,
|
||||||
LocalIntegral& elmInt)
|
LocalIntegral& elmInt)
|
||||||
{
|
{
|
||||||
|
if (projBou && !this->initProjection(MNPC,elmInt))
|
||||||
|
return false;
|
||||||
|
|
||||||
return myProblem.initElementBou(MNPC,elem_sizes,basis_sizes,elmInt);
|
return myProblem.initElementBou(MNPC,elem_sizes,basis_sizes,elmInt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,18 +325,9 @@ std::string NormBase::getName (size_t i, size_t j, const char* prefix) const
|
|||||||
{
|
{
|
||||||
char comp[32];
|
char comp[32];
|
||||||
sprintf(comp,"norm_%lu.%lu",i,j);
|
sprintf(comp,"norm_%lu.%lu",i,j);
|
||||||
if (prefix)
|
if (!prefix) return comp;
|
||||||
{
|
|
||||||
std::string tmp(comp);
|
|
||||||
if (strlen(prefix)+1+tmp.size() < sizeof(comp))
|
|
||||||
strcpy(comp,prefix);
|
|
||||||
else
|
|
||||||
strncpy(comp,prefix,sizeof(comp)-1-tmp.size());
|
|
||||||
strcat(comp," ");
|
|
||||||
strcat(comp,tmp.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
return comp;
|
return prefix + std::string(" ") + comp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -208,12 +208,13 @@ public:
|
|||||||
virtual bool diverged(size_t = 0) const { return false; }
|
virtual bool diverged(size_t = 0) const { return false; }
|
||||||
|
|
||||||
//! \brief Returns a pointer to an Integrand for solution norm evaluation.
|
//! \brief Returns a pointer to an Integrand for solution norm evaluation.
|
||||||
virtual NormBase* getNormIntegrand(AnaSol* = 0) const { return 0; }
|
virtual NormBase* getNormIntegrand(AnaSol* = nullptr) const
|
||||||
|
{ return nullptr; }
|
||||||
//! \brief Returns a pointer to an Integrand for boundary force evaluation.
|
//! \brief Returns a pointer to an Integrand for boundary force evaluation.
|
||||||
virtual ForceBase* getForceIntegrand(const Vec3*, AnaSol* = 0) const
|
virtual ForceBase* getForceIntegrand(const Vec3*, AnaSol* = nullptr) const
|
||||||
{ return 0; }
|
{ return nullptr; }
|
||||||
//! \brief Returns a pointer to an Integrand for nodal force evaluation.
|
//! \brief Returns a pointer to an Integrand for nodal force evaluation.
|
||||||
virtual ForceBase* getForceIntegrand() const { return 0; }
|
virtual ForceBase* getForceIntegrand() const { return nullptr; }
|
||||||
|
|
||||||
//! \brief Returns the number of spatial dimensions.
|
//! \brief Returns the number of spatial dimensions.
|
||||||
size_t getNoSpaceDim() const { return nsd; }
|
size_t getNoSpaceDim() const { return nsd; }
|
||||||
@ -284,8 +285,8 @@ class NormBase : public Integrand
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
//! \brief The default constructor is protected to allow sub-classes only.
|
//! \brief The default constructor is protected to allow sub-classes only.
|
||||||
NormBase(IntegrandBase& p) : myProblem(p), nrcmp(0), lints(0),
|
NormBase(IntegrandBase& p) : myProblem(p), projBou(false), nrcmp(0),
|
||||||
finalOp(ASM::SQRT) {}
|
lints(nullptr), finalOp(ASM::SQRT) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//! \brief Empty destructor.
|
//! \brief Empty destructor.
|
||||||
@ -370,6 +371,7 @@ protected:
|
|||||||
IntegrandBase& myProblem; //!< The problem-specific data
|
IntegrandBase& myProblem; //!< The problem-specific data
|
||||||
|
|
||||||
Vectors prjsol; //!< Projected secondary solution vectors for current patch
|
Vectors prjsol; //!< Projected secondary solution vectors for current patch
|
||||||
|
bool projBou; //!< If \e true, the boundary integrand needs prjsol too
|
||||||
|
|
||||||
unsigned short int nrcmp; //!< Number of projected solution components
|
unsigned short int nrcmp; //!< Number of projected solution components
|
||||||
LintegralVec* lints; //!< Local integrals used during norm integration
|
LintegralVec* lints; //!< Local integrals used during norm integration
|
||||||
|
Loading…
Reference in New Issue
Block a user