Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ASMu2DNastran.C
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,23 @@ bool ASMu2DNastran::checkPressSet (int iEl, size_t idx, int iSet) const
}


bool ASMu2DNastran::getShellNormals (std::vector<Vec3Pair>& normals) const
{
normals.reserve(nel);
for (size_t iel = 0; iel < nel; iel++)
if (const IntVec& mnpc = MNPC[iel]; mnpc.size() == 3 || mnpc.size() == 4)
{
const size_t n1 = mnpc.size() - 3;
const size_t n3 = mnpc.size() == 4 ? 3 : 1;
Vec3 V3(coord[mnpc[n3]]-coord[mnpc[0]], coord[mnpc[2]]-coord[mnpc[n1]]);
V3.normalize();
normals.emplace_back(this->getElementCenter(1+iel),V3);
}

return !normals.empty();
}


#ifdef HAS_ANDES
extern "C" void wavgmconstreqn_(const int& iel, const int& lDof,
const int& nM, const int& nW, const int* indC,
Expand Down
4 changes: 4 additions & 0 deletions ASMu2DNastran.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class ASMu2DNastran : public ASMu2DLag
//! \param[in] iSet Element set index (1-based) for a pressure load
bool checkPressSet(int iEl, size_t idx, int iSet) const;

//! \brief Calculates the shell normal vectors and the element centers
//! \param[out] normals Vector of element-center normal-vector pairs
bool getShellNormals(std::vector<Vec3Pair>& normals) const;

//! \brief Returns an additional geometry to visualize (point masses, etc.).
virtual ElementBlock* immersedGeometry(char* name) const;
//! \brief Returns an additional geometry to visualize (constraints, etc.).
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ ifem_add_regression_test(
TEST_FILES
BeamOnly-dyn.reg
BeamOnly.reg
DroppedBox.reg
Fine-dyn.reg
Fine-mlc.reg
Fine-partial.reg
Expand Down
20 changes: 20 additions & 0 deletions SIMAndesShell.C
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,26 @@ bool SIMAndesShell::writeGlvLoc (std::vector<std::string>& locfiles,
}


bool SIMAndesShell::writeGlvNormal (int& geoBlk, int& nBlock) const
{
VTF* vtf = this->getVTF();
if (!vtf || myProblem->hasTractionValues()) return true;

for (const ASMbase* pch : myModel)
if (const ASMu2DNastran* shl = dynamic_cast<const ASMu2DNastran*>(pch); shl)
if (std::vector<Vec3Pair> normals; shl->getShellNormals(normals))
{
if (msgLevel > 1)
IFEM::cout <<"Writing shell normal vectors"<< std::endl;

// Write shell normals as discrete point vectors to the VTF-file
return vtf->writeVectors(normals,geoBlk,++nBlock,"Normal vectors",1);
}

return true; // No shell elements
}


bool SIMAndesShell::writeGlvG (int& nBlock, const char* inpFile, bool doClear)
{
if (!this->Parent::writeGlvG(nBlock,inpFile,doClear))
Expand Down
5 changes: 5 additions & 0 deletions SIMAndesShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class SIMAndesShell : public SIMElasticity<SIM2D>
bool writeGlvLoc(std::vector<std::string>& locfiles,
bool nodal, int& nBlock) const;

//! \brief Writes shell normal vectors to the VTF-file.
//! \param geoBlk Running geometry block counter
//! \param nBlock Running result block counter
bool writeGlvNormal(int& geoBlk, int& nBlock) const;

//! \brief Writes current model geometry to the VTF-file.
//! \param nBlock Running result block counter
//! \param[in] inpFile File name used to construct the VTF-file name from
Expand Down
Loading