now works fully!

This commit is contained in:
John Dupuy
2023-11-10 11:06:17 -06:00
parent e2c4510e92
commit 74dbe1d6ef
8 changed files with 44 additions and 48 deletions

View File

@@ -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)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
add_executable(testappexe testapp/OndselSolver.cpp)
target_link_libraries(testappexe OndselSolver)
target_include_directories(testappexe PUBLIC "../OndselSolver")

View File

@@ -65,14 +65,6 @@ namespace MbD {
{
assert(false);
}
template<typename T>
inline void EulerAngles<T>::setRotOrder(int i, int j, int k)
{
rotOrder = std::make_shared<FullColumn<int>>(3);
rotOrder->at(0) = i;
rotOrder->at(1) = j;
rotOrder->at(2) = k;
}
// type-specific helper functions
std::shared_ptr<EulerAnglesDot<std::shared_ptr<MbD::Symbolic>>> differentiateWRT(EulerAngles<std::shared_ptr<MbD::Symbolic>>& ref, std::shared_ptr<MbD::Symbolic> var)
{

View File

@@ -36,5 +36,14 @@ namespace MbD {
template class EulerAngles<std::shared_ptr<MbD::Symbolic>>;
template class EulerAngles<double>;
std::shared_ptr<EulerAnglesDot<std::shared_ptr<MbD::Symbolic>>> differentiateWRT(EulerAngles<std::shared_ptr<MbD::Symbolic>>& ref, std::shared_ptr<MbD::Symbolic> var);
template<typename T>
void EulerAngles<T>::setRotOrder(int i, int j, int k)
{
rotOrder = std::make_shared<FullColumn<int>>(3);
rotOrder->at(0) = i;
rotOrder->at(1) = j;
rotOrder->at(2) = k;
}
}

View File

@@ -185,7 +185,8 @@ namespace MbD {
inline FColDsptr EulerParametersDot<T>::omeOpO()
{
auto aaa = this->aB();
auto bbb = aaa->timesFullColumn((MbD::FColsptr<double>)this);
// auto bbb = aaa->timesFullColumn((MbD::FColsptr<double>)this);
auto bbb = aaa->timesFullColumn(this);
auto ccc = bbb->times(2.0);
return ccc;
//return this->aB->timesFullColumn(this)->times(2.0);

View File

@@ -15,7 +15,18 @@
namespace MbD {
FColsptr<double> FullMatrixDouble::timesFullColumn(FColsptr<double> fullCol)
{
// return this->timesFullColumn(fullCol.get());
return this->timesFullColumn(fullCol.get());
// auto nrow = this->nrow();
// auto answer = std::make_shared<FullColumn<double>>(nrow);
// for (int i = 0; i < nrow; i++)
// {
// answer->at(i) = this->at(i)->timesFullColumn(fullCol);
// }
// return answer;
}
FColsptr<double> FullMatrixDouble::timesFullColumn(FullColumn<double>* fullCol) // local
{
//"a*b = a(i,j)b(j) sum j."
auto nrow = this->nrow();
auto answer = std::make_shared<FullColumn<double>>(nrow);
for (int i = 0; i < nrow; i++)
@@ -24,17 +35,6 @@ namespace MbD {
}
return answer;
}
// FColsptr<double> timesFullColumn(FullColumn<double>* fullCol) // local
// {
// //"a*b = a(i,j)b(j) sum j."
// auto nrow = this->nrow();
// auto answer = std::make_shared<FullColumn<double>>(nrow);
// for (int i = 0; i < nrow; i++)
// {
// answer->at(i) = this->at(i)->timesFullColumn(fullCol);
// }
// return answer;
// }
std::shared_ptr<FullMatrixDouble> FullMatrixDouble::rotatex(double the)
{
auto sthe = std::sin(the);

View File

@@ -97,7 +97,7 @@ namespace MbD {
void conditionSelfWithTol(double tol);
std::ostream& printOn(std::ostream& s) const override;
FColsptr<double> timesFullColumn(FColsptr<double> fullCol);
// FColsptr<double> timesFullColumn(FullColumn<double>* fullCol);
FColsptr<double> timesFullColumn(FullColumn<double>* fullCol);
};
//

View File

@@ -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")

View File

@@ -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>();
cadSystem->runOndselSinglePendulum();