Moved some beam-specific attributes and associated methods to

the elastic beam application, the only place it has any relevance
This commit is contained in:
Knut Morten Okstad 2019-02-05 15:24:44 +01:00
parent ce23569831
commit 34ce829e44
2 changed files with 2 additions and 96 deletions

View File

@ -26,7 +26,6 @@ SIM1D::SIM1D (unsigned char n1, bool)
{
nsd = 1;
nf = n1;
twist = nullptr;
}
@ -35,7 +34,6 @@ SIM1D::SIM1D (const CharVec& fields, bool)
nsd = 1;
nf = fields.empty() ? 1 : fields.front();
std::cerr <<" ** Mixed interpolation not implemented for 1D."<< std::endl;
twist = nullptr;
}
@ -43,13 +41,6 @@ SIM1D::SIM1D (IntegrandBase* itg, unsigned char n) : SIMgeneric(itg)
{
nsd = 1;
nf = n;
twist = nullptr;
}
SIM1D::~SIM1D ()
{
delete twist;
}
@ -199,14 +190,6 @@ bool SIM1D::parseGeometryTag (const TiXmlElement* elem)
static_cast<ASMs1D*>(myModel[patch-1])->closeEnds();
}
else if (!strcasecmp(elem->Value(),"Zdirection"))
{
utl::getAttribute(elem,"x",XZp.x);
utl::getAttribute(elem,"y",XZp.y);
utl::getAttribute(elem,"z",XZp.z);
IFEM::cout <<"\tZ-direction vector: "<< XZp << std::endl;
}
else if (!strcasecmp(elem->Value(),"projection") && !isRefined)
{
bool ok = true;
@ -285,28 +268,6 @@ bool SIM1D::parseBCTag (const TiXmlElement* elem)
}
/*!
The twist angle is used to define the local element axes of beam elements
along the spline curves. The angle described the rotation of the local
Y-axis, relative to the globalized Y-axis of the beam.
*/
bool SIM1D::parseTwist (const TiXmlElement* elem)
{
if (!elem->FirstChild())
return false;
std::string type;
utl::getAttribute(elem,"type",type);
IFEM::cout <<" Continuous twist angle:";
if (!type.empty()) IFEM::cout <<" ("<< type <<")";
twist = utl::parseRealFunc(elem->FirstChild()->Value(),type);
IFEM::cout << std::endl;
return true;
}
bool SIM1D::parse (const TiXmlElement* elem)
{
// Check if the number of dimensions is specified
@ -650,22 +611,6 @@ bool SIM1D::readPatches (std::istream& isp, PatchVec& patches,
}
bool SIM1D::createFEMmodel (char)
{
bool ok = true;
ASMbase::resetNumbering();
for (size_t i = 0; i < myModel.size() && ok; i++)
if (twist)
ok = static_cast<ASMs1D*>(myModel[i])->generateTwistedFEModel(*twist,XZp);
else if (!XZp.isZero())
ok = static_cast<ASMs1D*>(myModel[i])->generateOrientedFEModel(XZp);
else
ok = myModel[i]->generateFEMTopology();
return ok;
}
ModelGenerator* SIM1D::getModelGenerator (const TiXmlElement* geo) const
{
return new DefaultGeometry1D(geo);
@ -677,24 +622,3 @@ Vector SIM1D::getSolution (const Vector& psol, double u,
{
return this->SIMgeneric::getSolution(psol,&u,deriv,patch);
}
bool SIM1D::updateRotations (const Vector& incSol, double alpha)
{
if (nf != 6) return true;
bool ok = true;
for (size_t i = 0; i < myModel.size() && ok; i++)
if (incSol.empty())
// Update the rotations of last converged load/time step
static_cast<ASMs1D*>(myModel[i])->updateRotations();
else
{
Vector locSol;
myModel[i]->extractNodeVec(incSol,locSol);
if (alpha != 0.0 && alpha != 1.0) locSol *= alpha;
ok = static_cast<ASMs1D*>(myModel[i])->updateRotations(locSol,alpha==0.0);
}
return ok;
}

View File

@ -37,8 +37,8 @@ public:
//! \param[in] itg Pointer to the integrand of the problem to solve
//! \param[in] n Dimension of the primary solution field
SIM1D(IntegrandBase* itg, unsigned char n = 1);
//! \brief The destructor deletes the twist angle function.
virtual ~SIM1D();
//! \brief Empty destructor.
virtual ~SIM1D() {}
//! \brief Returns the number of parameter dimensions in the model.
virtual unsigned short int getNoParamDim() const { return 1; }
@ -78,12 +78,6 @@ public:
Vector getSolution(const Vector& psol, double u,
int deriv = 0, int patch = 1) const;
//! \brief Updates the nodal rotations for problems with rotational DOFs.
//! \param[in] incSol Incremental solution to update the rotations with
//! \param[in] alpha Scaling factor for the incremental solution.
//! If 0.0, reinitialize the rotations from unity
virtual bool updateRotations(const Vector& incSol, double alpha);
private:
//! \brief Parses a subelement of the \a geometry XML-tag.
bool parseGeometryTag(const TiXmlElement* elem);
@ -91,9 +85,6 @@ private:
bool parseBCTag(const TiXmlElement* elem);
protected:
//! \brief Parses the twist angle description along the curve.
bool parseTwist(const TiXmlElement* elem);
//! \brief Parses a data section from an XML document.
//! \param[in] elem The XML element to parse
virtual bool parse(const TiXmlElement* elem);
@ -120,17 +111,8 @@ protected:
//! \param[in] geo XML element containing geometry definition
virtual ModelGenerator* getModelGenerator(const TiXmlElement* geo) const;
public:
//! \brief Creates the computational FEM model from the spline patches.
//! \details Reimplemented to account for twist angle in beam problems.
virtual bool createFEMmodel(char = 'y');
protected:
unsigned char nf; //!< Number of scalar fields
private:
RealFunc* twist; //!< Twist angle (for 3D beam problems only)
Vec3 XZp; //!< Local Z-direction vector
};
#endif