MBDyn spherical hinge (#33)

* moved misc files to project resource

* MBDyn Sperical Hinge

* Werner compil warning (#32)

* Replace int by size_t in for loops.

* Various dtor missing and some other warning fixes.

* fixed size_t vs int

* fixed size_t vs int

---------

Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
Co-authored-by: Aik-Siong Koh <askoh@askoh.com>

* moved misc files to project resource

* MBDyn Sperical Hinge

* gravity fix

---------

Co-authored-by: PaddleStroke <pierrelouis.boyer@gmail.com>
Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
This commit is contained in:
aiksiongkoh
2023-11-27 14:48:58 -07:00
committed by GitHub
parent 3952f45945
commit 810c8d2f0e
24 changed files with 2547 additions and 4627 deletions

View File

@@ -21,6 +21,7 @@
#include "BasicUserFunction.h"
#include "MBDynReference.h"
#include "MBDynDrive.h"
#include "MBDynGravity.h"
using namespace MbD;
@@ -94,6 +95,7 @@ void MbD::MBDynSystem::createASMT()
for (auto& node : *nodes) node->createASMT();
for (auto& body : *bodies) body->createASMT();
for (auto& joint : *joints) joint->createASMT();
if (gravity) gravity->createASMT();
}
std::shared_ptr<MBDynNode> MbD::MBDynSystem::nodeAt(std::string nodeName)
@@ -134,11 +136,12 @@ std::vector<std::string> MbD::MBDynSystem::nodeNames()
void MbD::MBDynSystem::runKINEMATIC()
{
createASMT();
asmtAssembly()->outputFile("assembly.asmt");
auto debugFile1 = filename.substr(0, filename.find_last_of('.')) + "debug1.asmt";
asmtAssembly()->outputFile(debugFile1);
std::static_pointer_cast<ASMTAssembly>(asmtItem)->runKINEMATIC();
outputFiles();
asmtAssembly()->outputFile("assembly2.asmt");
asmtAssembly()->outputFile("smalltalk.asmt");
auto debugFile2 = filename.substr(0, filename.find_last_of('.')) + "debug2.asmt";
asmtAssembly()->outputFile(debugFile2);
}
void MbD::MBDynSystem::outputFiles()
@@ -325,6 +328,7 @@ void MbD::MBDynSystem::parseMBDynElements(std::vector<std::string>& lines)
std::vector<std::string> bodyTokens{ "body:" };
std::vector<std::string> jointTokens{ "joint:" };
std::vector<std::string> driveTokens{ "drive", "caller:" };
std::vector<std::string> gravityTokens{ "gravity" };
std::vector<std::string>::iterator it;
while (true) {
it = findLineWith(lines, bodyTokens);
@@ -354,6 +358,15 @@ void MbD::MBDynSystem::parseMBDynElements(std::vector<std::string>& lines)
lines.erase(it);
continue;
}
it = findLineWith(lines, gravityTokens);
if (it != lines.end()) {
auto grav = std::make_shared<MBDynGravity>();
grav->owner = this;
grav->parseMBDyn(*it);
gravity = grav;
lines.erase(it);
continue;
}
break;
}
assert(lines[0].find("end: elements") != std::string::npos);