diff --git a/CMakeLists.txt b/CMakeLists.txt index 87255c6..037b594 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -616,4 +616,8 @@ install(TARGETS OndselSolver LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/OndselSolver) install(FILES ${CMAKE_BINARY_DIR}/OndselSolver.pc - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) \ No newline at end of file + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) + +add_executable(testappexe testapp/OndselSolver.cpp) +target_link_libraries(testappexe OndselSolver) +target_include_directories(testappexe PUBLIC "../OndselSolver") diff --git a/OndselSolver/EulerAngles.cpp b/OndselSolver/EulerAngles.cpp index a33456d..5c3033f 100644 --- a/OndselSolver/EulerAngles.cpp +++ b/OndselSolver/EulerAngles.cpp @@ -65,14 +65,6 @@ namespace MbD { { assert(false); } - template - inline void EulerAngles::setRotOrder(int i, int j, int k) - { - rotOrder = std::make_shared>(3); - rotOrder->at(0) = i; - rotOrder->at(1) = j; - rotOrder->at(2) = k; - } // type-specific helper functions std::shared_ptr>> differentiateWRT(EulerAngles>& ref, std::shared_ptr var) { diff --git a/OndselSolver/EulerAngles.h b/OndselSolver/EulerAngles.h index 48bceae..216e6ad 100644 --- a/OndselSolver/EulerAngles.h +++ b/OndselSolver/EulerAngles.h @@ -36,5 +36,14 @@ namespace MbD { template class EulerAngles>; template class EulerAngles; std::shared_ptr>> differentiateWRT(EulerAngles>& ref, std::shared_ptr var); + template + + void EulerAngles::setRotOrder(int i, int j, int k) + { + rotOrder = std::make_shared>(3); + rotOrder->at(0) = i; + rotOrder->at(1) = j; + rotOrder->at(2) = k; + } } diff --git a/OndselSolver/EulerParametersDot.h b/OndselSolver/EulerParametersDot.h index 6389f13..283408c 100644 --- a/OndselSolver/EulerParametersDot.h +++ b/OndselSolver/EulerParametersDot.h @@ -185,7 +185,8 @@ namespace MbD { inline FColDsptr EulerParametersDot::omeOpO() { auto aaa = this->aB(); - auto bbb = aaa->timesFullColumn((MbD::FColsptr)this); +// auto bbb = aaa->timesFullColumn((MbD::FColsptr)this); + auto bbb = aaa->timesFullColumn(this); auto ccc = bbb->times(2.0); return ccc; //return this->aB->timesFullColumn(this)->times(2.0); diff --git a/OndselSolver/FullMatrix.cpp b/OndselSolver/FullMatrix.cpp index 0377eca..fa2053f 100644 --- a/OndselSolver/FullMatrix.cpp +++ b/OndselSolver/FullMatrix.cpp @@ -15,7 +15,18 @@ namespace MbD { FColsptr FullMatrixDouble::timesFullColumn(FColsptr fullCol) { -// return this->timesFullColumn(fullCol.get()); + return this->timesFullColumn(fullCol.get()); +// auto nrow = this->nrow(); +// auto answer = std::make_shared>(nrow); +// for (int i = 0; i < nrow; i++) +// { +// answer->at(i) = this->at(i)->timesFullColumn(fullCol); +// } +// return answer; + } + FColsptr FullMatrixDouble::timesFullColumn(FullColumn* fullCol) // local + { + //"a*b = a(i,j)b(j) sum j." auto nrow = this->nrow(); auto answer = std::make_shared>(nrow); for (int i = 0; i < nrow; i++) @@ -24,17 +35,6 @@ namespace MbD { } return answer; } -// FColsptr timesFullColumn(FullColumn* fullCol) // local -// { -// //"a*b = a(i,j)b(j) sum j." -// auto nrow = this->nrow(); -// auto answer = std::make_shared>(nrow); -// for (int i = 0; i < nrow; i++) -// { -// answer->at(i) = this->at(i)->timesFullColumn(fullCol); -// } -// return answer; -// } std::shared_ptr FullMatrixDouble::rotatex(double the) { auto sthe = std::sin(the); diff --git a/OndselSolver/FullMatrix.h b/OndselSolver/FullMatrix.h index 91684ef..8e2c535 100644 --- a/OndselSolver/FullMatrix.h +++ b/OndselSolver/FullMatrix.h @@ -97,7 +97,7 @@ namespace MbD { void conditionSelfWithTol(double tol); std::ostream& printOn(std::ostream& s) const override; FColsptr timesFullColumn(FColsptr fullCol); - // FColsptr timesFullColumn(FullColumn* fullCol); + FColsptr timesFullColumn(FullColumn* fullCol); }; // diff --git a/testapp/CMakeLists.txt b/testapp/CMakeLists.txt deleted file mode 100644 index f75fd3d..0000000 --- a/testapp/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.16) - -project(OndselSolverLibrary VERSION 1.0.1 DESCRIPTION "Assembly Constraints and Multibody Dynamics code") - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED True) - -add_executable(testapp OndselSolver.cpp) -target_link_libraries(testapp OndselSolver) -target_include_directories(testapp PUBLIC "../OndselSolver") diff --git a/testapp/OndselSolver.cpp b/testapp/OndselSolver.cpp index 0e6e2b3..165f70d 100644 --- a/testapp/OndselSolver.cpp +++ b/testapp/OndselSolver.cpp @@ -25,21 +25,21 @@ void runSpMat(); int main() { -// // ASMTAssembly::readWriteFile("piston.asmt"); -// MBDynSystem::runFile("MBDynCase.mbd"); //To be completed -// MBDynSystem::runFile("crank_slider.mbd"); //To be completed -// //ASMTAssembly::runSinglePendulumSuperSimplified(); //Mass is missing -// //ASMTAssembly::runSinglePendulumSuperSimplified2(); //DOF has infinite acceleration due to zero mass and inertias -// ASMTAssembly::runSinglePendulumSimplified(); -// ASMTAssembly::runSinglePendulum(); -// ASMTAssembly::runFile("piston.asmt"); -// ASMTAssembly::runFile("00backhoe.asmt"); -// //ASMTAssembly::runFile("circular.asmt"); //Needs checking -// //ASMTAssembly::runFile("cirpendu.asmt"); //Under constrained. Testing ICKine. -// //ASMTAssembly::runFile("engine1.asmt"); //Needs checking -// ASMTAssembly::runFile("fourbar.asmt"); -// //ASMTAssembly::runFile("fourbot.asmt"); //Very large but works -// ASMTAssembly::runFile("wobpump.asmt"); + // ASMTAssembly::readWriteFile("piston.asmt"); + // MBDynSystem::runFile("MBDynCase.mbd"); //To be completed + // MBDynSystem::runFile("crank_slider.mbd"); //To be completed + //ASMTAssembly::runSinglePendulumSuperSimplified(); //Mass is missing + //ASMTAssembly::runSinglePendulumSuperSimplified2(); //DOF has infinite acceleration due to zero mass and inertias + ASMTAssembly::runSinglePendulumSimplified(); + ASMTAssembly::runSinglePendulum(); + ASMTAssembly::runFile("../testapp/piston.asmt"); + ASMTAssembly::runFile("../testapp/00backhoe.asmt"); + //ASMTAssembly::runFile("circular.asmt"); //Needs checking + //ASMTAssembly::runFile("cirpendu.asmt"); //Under constrained. Testing ICKine. + //ASMTAssembly::runFile("engine1.asmt"); //Needs checking + ASMTAssembly::runFile("../testapp/fourbar.asmt"); + //ASMTAssembly::runFile("fourbot.asmt"); //Very large but works + ASMTAssembly::runFile("../testapp/wobpump.asmt"); auto cadSystem = std::make_shared(); cadSystem->runOndselSinglePendulum();