Added: Projection of analytical secondary solution

This commit is contained in:
Knut Morten Okstad 2017-05-31 21:51:59 +02:00
parent e45e120a18
commit a3b72a77fb
2 changed files with 37 additions and 2 deletions

View File

@ -26,8 +26,7 @@
#include "GlbNorm.h"
#include "ElmNorm.h"
#include "AnaSol.h"
#include "Function.h"
#include "Vec3.h"
#include "TensorFunction.h"
#include "Vec3Oper.h"
#include "Utilities.h"
#include "Profiler.h"
@ -1724,6 +1723,36 @@ bool SIMbase::project (Vector& ssol, const Vector& psol,
}
bool SIMbase::projectAnaSol (Vector& ssol,
SIMoptions::ProjectionMethod pMethod) const
{
if (!mySol) return true;
FunctionBase* f = mySol->getScalarSecSol();
if (f)
{
ssol.resize(f->dim()*mySam->getNoNodes());
return this->project(ssol,f,0,0,0,pMethod);
}
f = mySol->getVectorSecSol();
if (f)
{
ssol.resize(f->dim()*mySam->getNoNodes());
return this->project(ssol,f,0,0,0,pMethod);
}
f = mySol->getStressSol();
if (f)
{
ssol.resize(f->dim()*mySam->getNoNodes());
return this->project(ssol,f,0,0,0,pMethod);
}
return true;
}
size_t SIMbase::extractPatchSolution (const Vector& sol, Vector& vec,
int pindx, unsigned char nndof,
unsigned char basis) const

View File

@ -420,6 +420,12 @@ public:
bool project(Vector& ssol, const Vector& psol,
SIMoptions::ProjectionMethod pMethod = SIMoptions::GLOBAL) const;
//! \brief Projects the analytical secondary solution, if any.
//! \param[out] ssol Vector of control point values of the secondary solution
//! \param[in] pMethod Projection method to use
bool projectAnaSol(Vector& ssol,
SIMoptions::ProjectionMethod pMethod) const;
//! \brief Projects a function onto the specified basis.
//! \param[out] values Resulting control point values
//! \param[in] f The function to evaluate