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:
@@ -16,6 +16,7 @@ void MbD::MBDynControlData::parseMBDyn(std::vector<std::string>& lines)
|
||||
readStructuralNodes(lines);
|
||||
readRigidBodies(lines);
|
||||
readJoints(lines);
|
||||
readGravity(lines);
|
||||
assert(lines.size() == 2);
|
||||
}
|
||||
|
||||
@@ -131,3 +132,12 @@ void MbD::MBDynControlData::readJoints(std::vector<std::string>& lines)
|
||||
iss >> joints;
|
||||
lines.erase(it);
|
||||
}
|
||||
|
||||
void MbD::MBDynControlData::readGravity(std::vector<std::string>& lines)
|
||||
{
|
||||
//gravity;
|
||||
std::vector<std::string> tokens{ "gravity" };
|
||||
auto it = findLineWith(lines, tokens);
|
||||
if (it == lines.end()) return;
|
||||
lines.erase(it);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace MbD {
|
||||
void readStructuralNodes(std::vector<std::string>& lines);
|
||||
void readRigidBodies(std::vector<std::string>& lines);
|
||||
void readJoints(std::vector<std::string>& lines);
|
||||
void readGravity(std::vector<std::string>& lines);
|
||||
|
||||
int maxIterations = 1000;
|
||||
std::string defaultOrientation = "euler321";
|
||||
|
||||
58
OndselSolver/MBDynGravity.cpp
Normal file
58
OndselSolver/MBDynGravity.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#include <regex>
|
||||
|
||||
#include "MBDynGravity.h"
|
||||
#include "ASMTConstantGravity.h"
|
||||
#include "ASMTAssembly.h"
|
||||
|
||||
using namespace MbD;
|
||||
|
||||
void MbD::MBDynGravity::parseMBDyn(std::string line)
|
||||
{
|
||||
gravityString = line;
|
||||
size_t previousPos = 0;
|
||||
auto pos = line.find(":");
|
||||
auto front = line.substr(previousPos, pos - previousPos);
|
||||
assert(front.find("gravity") != std::string::npos);
|
||||
auto arguments = std::vector<std::string>();
|
||||
std::string argument;
|
||||
while (true) {
|
||||
previousPos = pos;
|
||||
pos = line.find(",", pos + 1);
|
||||
if (pos != std::string::npos) {
|
||||
argument = line.substr(previousPos + 1, pos - previousPos - 1);
|
||||
arguments.push_back(argument);
|
||||
}
|
||||
else {
|
||||
argument = line.substr(previousPos + 1);
|
||||
arguments.push_back(argument);
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(arguments.at(0).find("uniform") != std::string::npos);
|
||||
arguments.erase(arguments.begin());
|
||||
gvec = readPosition(arguments);
|
||||
assert(arguments.at(0).find("string") != std::string::npos);
|
||||
arguments.erase(arguments.begin());
|
||||
auto iss = std::istringstream(arguments.at(0));
|
||||
iss >> formula;
|
||||
formula = std::regex_replace(formula, std::regex("\""), "");
|
||||
double mag;
|
||||
iss = std::istringstream(formula);
|
||||
iss >> mag;
|
||||
|
||||
arguments.erase(arguments.begin());
|
||||
gvec->normalizeSelf();
|
||||
gvec->magnifySelf(mag);
|
||||
}
|
||||
|
||||
void MbD::MBDynGravity::readFunction(std::vector<std::string>& args)
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
|
||||
void MbD::MBDynGravity::createASMT()
|
||||
{
|
||||
auto asmtGravity = std::make_shared<ASMTConstantGravity>();
|
||||
asmtGravity->setg(gvec);
|
||||
asmtAssembly()->setConstantGravity(asmtGravity);
|
||||
}
|
||||
24
OndselSolver/MBDynGravity.h
Normal file
24
OndselSolver/MBDynGravity.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2023 Ondsel, Inc. *
|
||||
* *
|
||||
* This file is part of OndselSolver. *
|
||||
* *
|
||||
* See LICENSE file for details about copyright. *
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include "MBDynElement.h"
|
||||
|
||||
namespace MbD {
|
||||
class MBDynGravity : public MBDynElement
|
||||
{
|
||||
public:
|
||||
void parseMBDyn(std::string line);
|
||||
void readFunction(std::vector<std::string>& args);
|
||||
void createASMT() override;
|
||||
|
||||
std::string gravityString, formula;
|
||||
FColDsptr gvec;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "FullMatrix.h"
|
||||
#include "ASMTItem.h"
|
||||
#include "MBDynBody.h"
|
||||
#include "MBDynDrive.h"
|
||||
#include "MBDynGravity.h"
|
||||
|
||||
|
||||
using namespace MbD;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "MBDynItem.h"
|
||||
#include "MBDynDrive.h"
|
||||
|
||||
namespace MbD {
|
||||
class MBDynData;
|
||||
@@ -22,6 +21,8 @@ namespace MbD {
|
||||
class MBDynVariable;
|
||||
class MBDynLabel;
|
||||
class MBDynReference;
|
||||
class MBDynDrive;
|
||||
class MBDynGravity;
|
||||
|
||||
class MBDynSystem : public MBDynItem
|
||||
{
|
||||
@@ -70,6 +71,7 @@ namespace MbD {
|
||||
std::shared_ptr<std::vector<std::shared_ptr<MBDynBody>>> bodies;
|
||||
std::shared_ptr<std::vector<std::shared_ptr<MBDynJoint>>> joints;
|
||||
std::shared_ptr<std::vector<std::shared_ptr<MBDynDrive>>> drives;
|
||||
std::shared_ptr<MBDynGravity> gravity;
|
||||
std::shared_ptr<std::map<std::string, Symsptr>> variables;
|
||||
std::shared_ptr<std::map<std::string, int>> labels;
|
||||
std::shared_ptr<std::map<std::string, std::shared_ptr<MBDynReference>>> references;
|
||||
|
||||
@@ -230,6 +230,7 @@
|
||||
<ClCompile Include="MBDynData.cpp" />
|
||||
<ClCompile Include="MBDynDrive.cpp" />
|
||||
<ClCompile Include="MBDynElement.cpp" />
|
||||
<ClCompile Include="MBDynGravity.cpp" />
|
||||
<ClCompile Include="MBDynInitialValue.cpp" />
|
||||
<ClCompile Include="MBDynItem.cpp" />
|
||||
<ClCompile Include="MBDynJoint.cpp" />
|
||||
@@ -527,6 +528,7 @@
|
||||
<ClInclude Include="MBDynData.h" />
|
||||
<ClInclude Include="MBDynDrive.h" />
|
||||
<ClInclude Include="MBDynElement.h" />
|
||||
<ClInclude Include="MBDynGravity.h" />
|
||||
<ClInclude Include="MBDynInitialValue.h" />
|
||||
<ClInclude Include="MBDynItem.h" />
|
||||
<ClInclude Include="MBDynJoint.h" />
|
||||
@@ -728,19 +730,36 @@
|
||||
<ResourceCompile Include="OndselSolver.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="00backhoe.asmt" />
|
||||
<None Include="circular.asmt" />
|
||||
<None Include="cirpendu.asmt" />
|
||||
<None Include="ClassDiagram.cd" />
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
<None Include="crank_slider.mbd" />
|
||||
<None Include="engine1.asmt" />
|
||||
<None Include="fourbar.asmt" />
|
||||
<None Include="fourbot.asmt" />
|
||||
<None Include="gyro.asmt" />
|
||||
<None Include="piston.asmt" />
|
||||
<None Include="robot.asmt" />
|
||||
<None Include="wobpump.asmt" />
|
||||
<None Include="..\testapp\00backhoe.asmt" />
|
||||
<None Include="..\testapp\circular.asmt" />
|
||||
<None Include="..\testapp\cirpendu.asmt" />
|
||||
<None Include="..\testapp\cirpendu2.asmt" />
|
||||
<None Include="..\testapp\CrankSlider2.mbd" />
|
||||
<None Include="..\testapp\crank_slider.mbd" />
|
||||
<None Include="..\testapp\crank_sliderX.mbd" />
|
||||
<None Include="..\testapp\engine1.asmt" />
|
||||
<None Include="..\testapp\fourbar.asmt" />
|
||||
<None Include="..\testapp\fourbot.asmt" />
|
||||
<None Include="..\testapp\gyro.asmt" />
|
||||
<None Include="..\testapp\InitialConditions.mbd" />
|
||||
<None Include="..\testapp\MBDynCase.mbd" />
|
||||
<None Include="..\testapp\MBDynCase2.mbd" />
|
||||
<None Include="..\testapp\MBDynCase2orig.mbd" />
|
||||
<None Include="..\testapp\MBDynCaseDebug1.mbd" />
|
||||
<None Include="..\testapp\MBDynCaseDebug2.mbd" />
|
||||
<None Include="..\testapp\piston.asmt" />
|
||||
<None Include="..\testapp\quasikine.asmt" />
|
||||
<None Include="..\testapp\robot.asmt" />
|
||||
<None Include="..\testapp\SphericalHinge.mbd" />
|
||||
<None Include="..\testapp\wobpump.asmt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Media Include="..\testapp\CrankSlider2.mov" />
|
||||
<Media Include="..\testapp\InitialConditionsMBDyn.mov" />
|
||||
<Media Include="..\testapp\InitialConditionsOndselSolver.mov" />
|
||||
<Media Include="..\testapp\MBDynCase.mov" />
|
||||
<Media Include="..\testapp\MBDynCase2.mov" />
|
||||
<Media Include="..\testapp\SphericalHinge.mov" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -885,6 +885,9 @@
|
||||
<ClCompile Include="..\testapp\OndselSolver.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MBDynGravity.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Array.h">
|
||||
@@ -1778,6 +1781,9 @@
|
||||
<ClInclude Include="DiagonalMatrix.ref.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MBDynGravity.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="OndselSolver.rc">
|
||||
@@ -1785,18 +1791,35 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ClassDiagram.cd" />
|
||||
<None Include="piston.asmt" />
|
||||
<None Include="00backhoe.asmt" />
|
||||
<None Include="circular.asmt" />
|
||||
<None Include="cirpendu.asmt" />
|
||||
<None Include="engine1.asmt" />
|
||||
<None Include="fourbar.asmt" />
|
||||
<None Include="fourbot.asmt" />
|
||||
<None Include="gyro.asmt" />
|
||||
<None Include="robot.asmt" />
|
||||
<None Include="wobpump.asmt" />
|
||||
<None Include="crank_slider.mbd" />
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
<None Include="..\testapp\00backhoe.asmt" />
|
||||
<None Include="..\testapp\circular.asmt" />
|
||||
<None Include="..\testapp\cirpendu.asmt" />
|
||||
<None Include="..\testapp\cirpendu2.asmt" />
|
||||
<None Include="..\testapp\CrankSlider2.mbd" />
|
||||
<None Include="..\testapp\crank_slider.mbd" />
|
||||
<None Include="..\testapp\crank_sliderX.mbd" />
|
||||
<None Include="..\testapp\engine1.asmt" />
|
||||
<None Include="..\testapp\fourbar.asmt" />
|
||||
<None Include="..\testapp\fourbot.asmt" />
|
||||
<None Include="..\testapp\gyro.asmt" />
|
||||
<None Include="..\testapp\InitialConditions.mbd" />
|
||||
<None Include="..\testapp\MBDynCase.mbd" />
|
||||
<None Include="..\testapp\MBDynCase2.mbd" />
|
||||
<None Include="..\testapp\MBDynCase2orig.mbd" />
|
||||
<None Include="..\testapp\MBDynCaseDebug1.mbd" />
|
||||
<None Include="..\testapp\MBDynCaseDebug2.mbd" />
|
||||
<None Include="..\testapp\piston.asmt" />
|
||||
<None Include="..\testapp\quasikine.asmt" />
|
||||
<None Include="..\testapp\robot.asmt" />
|
||||
<None Include="..\testapp\SphericalHinge.mbd" />
|
||||
<None Include="..\testapp\wobpump.asmt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Media Include="..\testapp\CrankSlider2.mov" />
|
||||
<Media Include="..\testapp\InitialConditionsMBDyn.mov" />
|
||||
<Media Include="..\testapp\InitialConditionsOndselSolver.mov" />
|
||||
<Media Include="..\testapp\MBDynCase.mov" />
|
||||
<Media Include="..\testapp\MBDynCase2.mov" />
|
||||
<Media Include="..\testapp\SphericalHinge.mov" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
439
testapp/MBDynCase2debug1.asmt
Normal file
439
testapp/MBDynCase2debug1.asmt
Normal file
@@ -0,0 +1,439 @@
|
||||
OndselSolver
|
||||
Assembly
|
||||
Notes
|
||||
(Text string: '' runs: (Core.RunArray runs: #() values: #()))
|
||||
Name
|
||||
Assembly
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
Parts
|
||||
Part
|
||||
Name
|
||||
structural_node_1
|
||||
Position3D
|
||||
-0.121 -1.218180697837851e-18 -0.08
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
FeatureOrder
|
||||
PrincipalMassMarker
|
||||
Name
|
||||
MassMarker
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Mass
|
||||
1
|
||||
MomentOfInertias
|
||||
1 2 3
|
||||
Density
|
||||
10
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
0.121 1.218180697837851e-18 0.08
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker1
|
||||
Position3D
|
||||
0 1.218180697837851e-18 0.05
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker2
|
||||
Position3D
|
||||
0 1.218180697837785e-18 0.08
|
||||
RotationMatrix
|
||||
2.220446049250313e-16 -2.220446049250313e-16 1
|
||||
1 0 -2.220446049250313e-16
|
||||
4.930380657631324e-32 1 2.220446049250313e-16
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker3
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
Part
|
||||
Name
|
||||
structural_node_2
|
||||
Position3D
|
||||
-0.04753704894473842 0.09742200410568831 -0.03029347681223059
|
||||
RotationMatrix
|
||||
0.9512512425641979 -0.1267494082121462 0.2811683855591535
|
||||
0.167731259496521 0.9776506595433678 -0.1267494082121462
|
||||
-0.258819045102521 0.167731259496521 0.9512512425641977
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
FeatureOrder
|
||||
PrincipalMassMarker
|
||||
Name
|
||||
MassMarker
|
||||
Position3D
|
||||
7.105427357601002e-18 0 7.105427357601002e-18
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Mass
|
||||
1.448636188351172
|
||||
MomentOfInertias
|
||||
0.002871751015088 0.002864447840812 0.0007089594589930001
|
||||
Density
|
||||
10
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
-0.03739853284269051 0 0.003286762255221063
|
||||
RotationMatrix
|
||||
1 0 5.204170427930421e-18
|
||||
-0 1 0
|
||||
-5.204170427930421e-18 -0 1
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker1
|
||||
Position3D
|
||||
0.03260146715730949 1.4210854715202e-17 0.05328676225522106
|
||||
RotationMatrix
|
||||
1 -0 5.204170427930421e-18
|
||||
0 1 0
|
||||
-5.204170427930421e-18 0 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
Part
|
||||
Name
|
||||
structural_node_3
|
||||
Position3D
|
||||
0.07099630277370235 -0.07364765799707981 0.05840790082376057
|
||||
RotationMatrix
|
||||
0.9622501868990581 0.01433011691863463 -0.271788935686915
|
||||
-0.08715574274765801 0.9622501868990581 -0.2578341604963
|
||||
0.2578341604963001 0.271788935686915 0.9271743741709766
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
FeatureOrder
|
||||
PrincipalMassMarker
|
||||
Name
|
||||
MassMarker
|
||||
Position3D
|
||||
2.842170943040401e-17 -1.4210854715202e-17 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Mass
|
||||
2.852948655706768
|
||||
MomentOfInertias
|
||||
0.03383792198797 0.033715148099504 0.001956310318013
|
||||
Density
|
||||
10
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
-0.1400000000000079 -1.044497821567347e-15 0.02499999999999804
|
||||
RotationMatrix
|
||||
3.322229154067983e-33 1 -5.551115123125784e-17
|
||||
-1 0 -5.984795992119986e-17
|
||||
-5.984795992119986e-17 5.551115123125784e-17 1
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker1
|
||||
Position3D
|
||||
0.1399999999999913 4.423128530106624e-16 9.79127889877418e-15
|
||||
RotationMatrix
|
||||
0.7254861972346578 0.6882367162699149 2.719509169040251e-15
|
||||
-0.6882367162699149 0.7254861972346578 1.258675848677982e-14
|
||||
6.689702964032028e-15 -1.100318561045113e-14 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
Part
|
||||
Name
|
||||
structural_node_4
|
||||
Position3D
|
||||
0.3723079639890564 0.04333150035096042 0.008140985321785409
|
||||
RotationMatrix
|
||||
0.9659258262890682 -0 0.2588190451025211
|
||||
0 1 0
|
||||
-0.2588190451025211 0 0.9659258262890682
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
FeatureOrder
|
||||
PrincipalMassMarker
|
||||
Name
|
||||
MassMarker
|
||||
Position3D
|
||||
2.842170943040401e-16 2.131628207280301e-17 2.273736754432321e-16
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Mass
|
||||
10.85942720262214
|
||||
MomentOfInertias
|
||||
0.07706742098794901 0.066351815798527 0.061792350456255
|
||||
Density
|
||||
10
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
-0.04558083463411924 -2.029935401992589e-10 1.256225164070202e-08
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker1
|
||||
Position3D
|
||||
-0.04558083463411924 -2.029935401992589e-10 1.256225164070202e-08
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker2
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
KinematicIJs
|
||||
ConstraintSets
|
||||
Joints
|
||||
FixedJoint
|
||||
Name
|
||||
joint_1
|
||||
MarkerI
|
||||
/Assembly/Marker0
|
||||
MarkerJ
|
||||
/Assembly/structural_node_1/Marker0
|
||||
RevoluteJoint
|
||||
Name
|
||||
joint_2
|
||||
MarkerI
|
||||
/Assembly/structural_node_1/Marker1
|
||||
MarkerJ
|
||||
/Assembly/structural_node_2/Marker0
|
||||
RevoluteJoint
|
||||
Name
|
||||
joint_3
|
||||
MarkerI
|
||||
/Assembly/structural_node_2/Marker1
|
||||
MarkerJ
|
||||
/Assembly/structural_node_3/Marker0
|
||||
PointInLineJoint
|
||||
Name
|
||||
joint_4
|
||||
MarkerI
|
||||
/Assembly/structural_node_3/Marker1
|
||||
MarkerJ
|
||||
/Assembly/structural_node_4/Marker0
|
||||
PointInLineJoint
|
||||
Name
|
||||
joint_5
|
||||
MarkerI
|
||||
/Assembly/structural_node_1/Marker2
|
||||
MarkerJ
|
||||
/Assembly/structural_node_4/Marker1
|
||||
NoRotationJoint
|
||||
Name
|
||||
joint_6
|
||||
MarkerI
|
||||
/Assembly/structural_node_1/Marker3
|
||||
MarkerJ
|
||||
/Assembly/structural_node_4/Marker2
|
||||
Motions
|
||||
RotationalMotion
|
||||
Name
|
||||
joint_2Motion
|
||||
MarkerI
|
||||
/Assembly/structural_node_1/Marker1
|
||||
MarkerJ
|
||||
/Assembly/structural_node_2/Marker0
|
||||
MotionJoint
|
||||
/Assembly/joint_2
|
||||
RotationZ
|
||||
integral(time, rampstep(time, 0.0, 0.0, 1.0, 0.0 + 6.28*(1.0 - 0.0)))
|
||||
GeneralConstraintSets
|
||||
ForceTorques
|
||||
ConstantGravity
|
||||
0 0 0
|
||||
SimulationParameters
|
||||
tstart
|
||||
0
|
||||
tend
|
||||
3
|
||||
hmin
|
||||
1e-09
|
||||
hmax
|
||||
1
|
||||
hout
|
||||
0.01
|
||||
errorTol
|
||||
1e-06
|
||||
AnimationParameters
|
||||
nframe
|
||||
1000000
|
||||
icurrent
|
||||
1
|
||||
istart
|
||||
1
|
||||
iend
|
||||
1000000
|
||||
isForward
|
||||
true
|
||||
framesPerSecond
|
||||
30
|
||||
586
testapp/MBDynCase2debug2.asmt
Normal file
586
testapp/MBDynCase2debug2.asmt
Normal file
File diff suppressed because one or more lines are too long
@@ -26,6 +26,7 @@ void sharedptrTest();
|
||||
|
||||
int main()
|
||||
{
|
||||
MBDynSystem::runFile("../testapp/SphericalHinge.mbd");
|
||||
ASMTAssembly::runFile("../testapp/cirpendu2.asmt"); //Under constrained. Testing ICKine.
|
||||
ASMTAssembly::runFile("../testapp/quasikine.asmt"); //Under constrained. Testing ICKine.
|
||||
ASMTAssembly::readWriteFile("../testapp/piston.asmt");
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
begin: initial value;
|
||||
initial time: 0.0;
|
||||
final time: 8.0;
|
||||
final time: 3.0;
|
||||
time step: 0.01;
|
||||
max iterations: 100;
|
||||
tolerance: 1e-06;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
200
testapp/SphericalHingedebug1.asmt
Normal file
200
testapp/SphericalHingedebug1.asmt
Normal file
@@ -0,0 +1,200 @@
|
||||
OndselSolver
|
||||
Assembly
|
||||
Notes
|
||||
(Text string: '' runs: (Core.RunArray runs: #() values: #()))
|
||||
Name
|
||||
Assembly
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
Parts
|
||||
Part
|
||||
Name
|
||||
structural_node_1
|
||||
Position3D
|
||||
1.727420524244408e-18 0.003055045871559638 0.025
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
FeatureOrder
|
||||
PrincipalMassMarker
|
||||
Name
|
||||
MassMarker
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Mass
|
||||
1
|
||||
MomentOfInertias
|
||||
1 2 3
|
||||
Density
|
||||
10
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
-1.727420524244408e-18 -0.003055045871559638 -0.025
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker1
|
||||
Position3D
|
||||
-1.727420524244408e-18 -0.003055045871559638 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
Part
|
||||
Name
|
||||
structural_node_2
|
||||
Position3D
|
||||
0.008191520442889925 -0.01262591275038929 0.04303463608057351
|
||||
RotationMatrix
|
||||
0.5735764363510459 -1.387778780781446e-16 0.8191520442889918
|
||||
-0.6710100716628343 0.5735764363510458 0.4698463103929542
|
||||
-0.469846310392954 -0.8191520442889917 0.3289899283371654
|
||||
Velocity3D
|
||||
0 0 0
|
||||
Omega3D
|
||||
0 0 0
|
||||
FeatureOrder
|
||||
PrincipalMassMarker
|
||||
Name
|
||||
MassMarker
|
||||
Position3D
|
||||
-3.203482812352831e-12 0.01281482425686655 -0.009255846159930699
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Mass
|
||||
0.0064701741006665
|
||||
MomentOfInertias
|
||||
4.27187049e-07 4.10064115e-07 6.3235945e-08
|
||||
Density
|
||||
10
|
||||
RefPoints
|
||||
RefPoint
|
||||
Position3D
|
||||
0 0 0
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
Markers
|
||||
Marker
|
||||
Name
|
||||
Marker0
|
||||
Position3D
|
||||
-3.552713678800501e-18 0.01800000000000001 -0.01000000000000001
|
||||
RotationMatrix
|
||||
1 0 0
|
||||
0 1 0
|
||||
0 0 1
|
||||
RefCurves
|
||||
RefSurfaces
|
||||
KinematicIJs
|
||||
ConstraintSets
|
||||
Joints
|
||||
FixedJoint
|
||||
Name
|
||||
joint_1
|
||||
MarkerI
|
||||
/Assembly/Marker0
|
||||
MarkerJ
|
||||
/Assembly/structural_node_1/Marker0
|
||||
SphericalJoint
|
||||
Name
|
||||
joint_2
|
||||
MarkerI
|
||||
/Assembly/structural_node_2/Marker0
|
||||
MarkerJ
|
||||
/Assembly/structural_node_1/Marker1
|
||||
Motions
|
||||
GeneralConstraintSets
|
||||
ForceTorques
|
||||
ConstantGravity
|
||||
0 -9.807 0
|
||||
SimulationParameters
|
||||
tstart
|
||||
0
|
||||
tend
|
||||
3
|
||||
hmin
|
||||
1e-09
|
||||
hmax
|
||||
1
|
||||
hout
|
||||
0.01
|
||||
errorTol
|
||||
1e-06
|
||||
AnimationParameters
|
||||
nframe
|
||||
1000000
|
||||
icurrent
|
||||
1
|
||||
istart
|
||||
1
|
||||
iend
|
||||
1000000
|
||||
isForward
|
||||
true
|
||||
framesPerSecond
|
||||
30
|
||||
274
testapp/SphericalHingedebug2.asmt
Normal file
274
testapp/SphericalHingedebug2.asmt
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user