runPosIC, initializeGlobally

This commit is contained in:
Aik-Siong Koh
2023-05-27 21:43:09 -06:00
parent 6a577c052c
commit 9ddbdca742
139 changed files with 2401 additions and 431 deletions

View File

@@ -5,6 +5,7 @@
#include "Joint.h"
#include "SystemSolver.h"
#include "Time.h"
#include "CREATE.h"
using namespace MbD;
@@ -18,7 +19,7 @@ System::System(const char* str) : Item(str) {
void MbD::System::initialize()
{
time = std::make_shared<Time>();
time = CREATE<Time>::With();
parts = std::make_shared<std::vector<std::shared_ptr<Part>>>();
jointsMotions = std::make_shared<std::vector<std::shared_ptr<Joint>>>();
systemSolver = std::make_shared<SystemSolver>(this);
@@ -84,3 +85,13 @@ void MbD::System::partsJointsMotionsDo(const std::function<void(std::shared_ptr<
std::for_each(parts->begin(), parts->end(), f);
std::for_each(jointsMotions->begin(), jointsMotions->end(), f);
}
void MbD::System::logString(std::string& str)
{
std::cout << str << std::endl;
}
double MbD::System::mbdTimeValue()
{
return time->getValue();
}