Added: TimeDomain& argument in the virtual externalEnergy method
This commit is contained in:
parent
c0d97367eb
commit
0aab0de863
@ -156,6 +156,8 @@ bool SIMbase::preprocess (const IntVec& ignored, bool fixDup)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PROFILE1("Model preprocessing");
|
||||||
|
|
||||||
static int substep = 10;
|
static int substep = 10;
|
||||||
this->printHeading(substep);
|
this->printHeading(substep);
|
||||||
|
|
||||||
@ -1267,10 +1269,10 @@ bool SIMbase::solutionNorms (const TimeDomain& time,
|
|||||||
const Vectors& psol, const Vectors& ssol,
|
const Vectors& psol, const Vectors& ssol,
|
||||||
Vectors& gNorm, Matrix* eNorm, const char* name)
|
Vectors& gNorm, Matrix* eNorm, const char* name)
|
||||||
{
|
{
|
||||||
PROFILE1("Norm integration");
|
|
||||||
|
|
||||||
if (!mySam) return true; // Silently ignore when uninitialized system
|
if (!mySam) return true; // Silently ignore when uninitialized system
|
||||||
|
|
||||||
|
PROFILE1("Norm integration");
|
||||||
|
|
||||||
NormBase* norm = myProblem->getNormIntegrand(mySol);
|
NormBase* norm = myProblem->getNormIntegrand(mySol);
|
||||||
if (!norm)
|
if (!norm)
|
||||||
{
|
{
|
||||||
@ -1454,7 +1456,7 @@ bool SIMbase::solutionNorms (const TimeDomain& time,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add problem-dependent external norm contributions
|
// Add problem-dependent external norm contributions
|
||||||
norm->addBoundaryTerms(gNorm,this->externalEnergy(psol));
|
norm->addBoundaryTerms(gNorm,this->externalEnergy(psol,time));
|
||||||
|
|
||||||
delete norm;
|
delete norm;
|
||||||
|
|
||||||
@ -1468,7 +1470,7 @@ bool SIMbase::solutionNorms (const TimeDomain& time,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double SIMbase::externalEnergy (const Vectors& psol) const
|
double SIMbase::externalEnergy (const Vectors& psol, const TimeDomain&) const
|
||||||
{
|
{
|
||||||
const Vector* reactionForces = this->getReactionForces();
|
const Vector* reactionForces = this->getReactionForces();
|
||||||
if (!reactionForces || !mySam || psol.empty()) return 0.0;
|
if (!reactionForces || !mySam || psol.empty()) return 0.0;
|
||||||
|
@ -33,6 +33,7 @@ class FunctionBase;
|
|||||||
class RealFunc;
|
class RealFunc;
|
||||||
class VecFunc;
|
class VecFunc;
|
||||||
class TractionFunc;
|
class TractionFunc;
|
||||||
|
class ScalarFunc;
|
||||||
class Vec4;
|
class Vec4;
|
||||||
class Vec3;
|
class Vec3;
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ public:
|
|||||||
//! \brief Returns whether a mixed formulation is used (used by HDF5 output).
|
//! \brief Returns whether a mixed formulation is used (used by HDF5 output).
|
||||||
virtual bool mixedProblem() const { return false; }
|
virtual bool mixedProblem() const { return false; }
|
||||||
|
|
||||||
//! \brief Obtain the linear solver parameters.
|
//! \brief Returns the linear equation solver parameters (for PETSc).
|
||||||
const LinSolParams* getSolParams() const { return mySolParams; }
|
const LinSolParams* getSolParams() const { return mySolParams; }
|
||||||
|
|
||||||
//! \brief Returns the number of parameter dimensions in the model.
|
//! \brief Returns the number of parameter dimensions in the model.
|
||||||
@ -380,10 +381,8 @@ public:
|
|||||||
nullptr,name);
|
nullptr,name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Apply app-specific post-processing to element norms.
|
//! \brief Applies app-specific post-processing to element norms.
|
||||||
//! \param gNorm Vector with global norms
|
virtual bool postProcessNorms(Vectors&, Matrix*) { return true; }
|
||||||
//! \param eNorm Matrix with element norms
|
|
||||||
virtual bool postProcessNorms(Vectors& gNorm, Matrix* eNorm) { return true; }
|
|
||||||
|
|
||||||
//! \brief Prints out load/time step identification.
|
//! \brief Prints out load/time step identification.
|
||||||
//! \param[in] istep Load- or time step counter
|
//! \param[in] istep Load- or time step counter
|
||||||
@ -639,7 +638,7 @@ protected:
|
|||||||
const TimeDomain&) { return true; }
|
const TimeDomain&) { return true; }
|
||||||
|
|
||||||
//! \brief Computes (possibly problem-dependent) external energy contribution.
|
//! \brief Computes (possibly problem-dependent) external energy contribution.
|
||||||
virtual double externalEnergy(const Vectors& psol) const;
|
virtual double externalEnergy(const Vectors& psol, const TimeDomain&) const;
|
||||||
|
|
||||||
//! \brief Generates element groups for multi-threading of boundary integrals.
|
//! \brief Generates element groups for multi-threading of boundary integrals.
|
||||||
//! \param[in] p Property object identifying a patch boundary
|
//! \param[in] p Property object identifying a patch boundary
|
||||||
|
Loading…
Reference in New Issue
Block a user