Changed: SIMgeneric::createDefaultModel returns true if successful.

Removed unused/obsolete method SIMdummy::createDefaultGeometry.
This commit is contained in:
Knut Morten Okstad 2016-11-29 05:46:16 +01:00
parent 9615f33c30
commit 4e260b96e2
4 changed files with 14 additions and 13 deletions

View File

@ -401,7 +401,7 @@ LR::LRSplineVolume* ASMu3D::scRecovery (const IntegrandBase& integrand) const
#if SP_DEBUG > 1
std::cout <<"Greville point "<< ip <<" (u,v,w) = "
<< gpar[0][ip-1] <<" "<< gpar[1][ip-1] <<" "<< gpar[2][ip-1] <<" :";
for (k = 1; k <= nCmp; k++)
for (size_t k = 1; k <= nCmp; k++)
std::cout <<" "<< sValues(k,ip);
std::cout << std::endl;
#endif

View File

@ -43,9 +43,6 @@ protected:
//! \brief Preprocesses a user-defined Dirichlet boundary property.
virtual bool addConstraint(int,int,int,int,int,int&,char)
{ return false; }
//! \brief Creates a default single-patch geometry.
virtual ASMbase* createDefaultGeometry(const TiXmlElement*) const
{ return nullptr; }
//! \brief Preprocesses the result sampling points.
virtual void preprocessResultPoints() {}
//! \brief Creates a model generator.

View File

@ -12,18 +12,22 @@
//==============================================================================
#include "SIMgeneric.h"
#include "ASMbase.h"
#include "ModelGenerator.h"
#include "ASMbase.h"
void SIMgeneric::createDefaultModel ()
bool SIMgeneric::createDefaultModel ()
{
if (!myModel.empty()) return;
if (!myModel.empty()) return false;
ModelGenerator* gen = this->createModelGenerator(nullptr);
if (!gen) return false;
myModel = gen->createGeometry(*this);
nGlPatches = myModel.size();
delete gen;
return nGlPatches > 0;
}
@ -33,7 +37,7 @@ Vector SIMgeneric::getSolution (const Vector& psol, const double* par,
if (psol.empty() || !par || opt.discretization < ASM::Spline)
return Vector();
ASMbase* pch = this->getPatch(this->getLocalPatchIndex(patch));
ASMbase* pch = this->getPatch(patch,true);
if (!pch) return Vector();
size_t ndim = pch->getNoParamDim();
@ -54,7 +58,7 @@ Vector SIMgeneric::getSolution (const Vector& psol, const double* par,
int SIMgeneric::evalPoint (const double* xi, Vec3& X, double* param,
int patch) const
{
ASMbase* pch = this->getPatch(this->getLocalPatchIndex(patch));
ASMbase* pch = this->getPatch(patch,true);
if (!pch) return -1;
double dummy[3];

View File

@ -21,7 +21,7 @@
\brief Generic SIM class with some added functionalities.
\details This class extends the SIMbase class with some added functionalities
of generic character, which can be used to access the FE data and structures
on a more flexible way.
in a more flexible way.
*/
class SIMgeneric : public SIMoutput
@ -35,13 +35,13 @@ public:
virtual ~SIMgeneric() {}
//! \brief Creates a model with the default geometry (line, plane, cube).
void createDefaultModel();
bool createDefaultModel();
//! \brief Evaluates the primary solution at the given point.
//! \param[in] psol Primary solution vector
//! \param[in] par Parameters of the point to evaluate at
//! \param[in] deriv Derivative order of the solution
//! \param[in] patch 1-based patch index contining the evaluation point
//! \param[in] patch 1-based patch index containing the evaluation point
//! \return Evaluated solution values
Vector getSolution(const Vector& psol, const double* par,
int deriv = 0, int patch = 1) const;
@ -50,7 +50,7 @@ public:
//! \param[in] xi Dimensionless parameters in range [0,1] of the point
//! \param[out] X The Cartesian coordinates of the point
//! \param[out] param The parameters of the point in the knot-span domain
//! \param[in] patch 1-based patch index contining the evaluation point
//! \param[in] patch 1-based patch index containing the evaluation point
//! \return Local node number within the patch that matches the point
int evalPoint(const double* xi, Vec3& X,
double* param = nullptr, int patch = 1) const;