diff --git a/src/ASM/LR/ASMu3Drecovery.C b/src/ASM/LR/ASMu3Drecovery.C index 4c37dbf8..122b8d15 100644 --- a/src/ASM/LR/ASMu3Drecovery.C +++ b/src/ASM/LR/ASMu3Drecovery.C @@ -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 diff --git a/src/SIM/SIMdummy.h b/src/SIM/SIMdummy.h index 80b8cd85..94a09216 100644 --- a/src/SIM/SIMdummy.h +++ b/src/SIM/SIMdummy.h @@ -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. diff --git a/src/SIM/SIMgeneric.C b/src/SIM/SIMgeneric.C index 921bb695..9a4c1970 100644 --- a/src/SIM/SIMgeneric.C +++ b/src/SIM/SIMgeneric.C @@ -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]; diff --git a/src/SIM/SIMgeneric.h b/src/SIM/SIMgeneric.h index f3fbcec4..7e14f428 100644 --- a/src/SIM/SIMgeneric.h +++ b/src/SIM/SIMgeneric.h @@ -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;