Skip to content

Commit

Permalink
handle more unused parameters and virtual/real name conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAD committed Nov 21, 2023
1 parent b2aba99 commit 3ae60d6
Show file tree
Hide file tree
Showing 24 changed files with 117 additions and 4 deletions.
5 changes: 4 additions & 1 deletion OndselSolver/ASMTAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,16 +788,19 @@ void MbD::ASMTAssembly::readMotionSeries(std::vector<std::string>& lines)

void MbD::ASMTAssembly::outputFor(AnalysisType type)
{
(void) type; // to suppress compiler warning of unused parameters
assert(false);
}

void MbD::ASMTAssembly::logString(std::string& str)
{
(void) str; // to suppress compiler warning of unused parameters
assert(false);
}

void MbD::ASMTAssembly::logString(double value)
{
(void) value; // to suppress compiler warning of unused parameters
assert(false);
}

Expand Down Expand Up @@ -833,7 +836,7 @@ double MbD::ASMTAssembly::calcCharacteristicMass()
{
auto n = parts->size();
double sumOfSquares = 0.0;
for (int i = 0; i < n; i++)
for (unsigned long i = 0; i < n; i++)
{
auto mass = parts->at(i)->principalMassMarker->mass;
sumOfSquares += mass * mass;
Expand Down
1 change: 1 addition & 0 deletions OndselSolver/ASMTMarker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ namespace MbD {

void ASMTMarker::createMbD(std::shared_ptr<System> mbdSys, std::shared_ptr<Units> mbdUnits)
{
(void) mbdSys; // to suppress compiler warning of unused parameters
auto mkr = CREATE<MarkerFrame>::With(name.c_str());
auto prt = std::static_pointer_cast<Part>(partOrAssembly()->mbdObject);
prt->partFrame->addMarkerFrame(mkr);
Expand Down
2 changes: 2 additions & 0 deletions OndselSolver/ASMTRefSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ void MbD::ASMTRefSurface::parseASMT(std::vector<std::string>& lines)

void MbD::ASMTRefSurface::storeOnLevel(std::ofstream& os, int level)
{
(void) os; // to suppress compiler warning of unused parameters
(void) level; // to suppress compiler warning of unused parameters
assert(false);
}
4 changes: 4 additions & 0 deletions OndselSolver/ASMTSpatialContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void MbD::ASMTSpatialContainer::readRefCurves(std::vector<std::string>& lines)

void MbD::ASMTSpatialContainer::readRefCurve(std::vector<std::string>& lines)
{
(void) lines; // to suppress compiler warning of unused parameters
assert(false);
}

Expand All @@ -139,6 +140,7 @@ void MbD::ASMTSpatialContainer::readRefSurfaces(std::vector<std::string>& lines)

void MbD::ASMTSpatialContainer::readRefSurface(std::vector<std::string>& lines)
{
(void) lines; // to suppress compiler warning of unused parameters
assert(false);
}

Expand Down Expand Up @@ -371,6 +373,7 @@ void MbD::ASMTSpatialContainer::updateFromMbD()

void MbD::ASMTSpatialContainer::compareResults(AnalysisType type)
{
(void) type; // to suppress compiler warning of unused parameters
if (inxs == nullptr || inxs->empty()) return;
auto mbdUnts = mbdUnits();
auto factor = 1.0e-6;
Expand Down Expand Up @@ -442,6 +445,7 @@ void MbD::ASMTSpatialContainer::compareResults(AnalysisType type)

void MbD::ASMTSpatialContainer::outputResults(AnalysisType type)
{
(void) type; // to suppress compiler warning of unused parameters
if (inxs != nullptr && !inxs->empty()) return;
auto i = xs->size() - 1;
std::cout << i << " ";
Expand Down
2 changes: 2 additions & 0 deletions OndselSolver/ASMTTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ void MbD::ASMTTime::createMbD(std::shared_ptr<System> mbdSys, std::shared_ptr<Un

Symsptr MbD::ASMTTime::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
(void) set; // to suppress compiler warning of unused parameters
return sptr;
}

Symsptr MbD::ASMTTime::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
(void) set; // to suppress compiler warning of unused parameters
return sptr;
}

Expand Down
3 changes: 3 additions & 0 deletions OndselSolver/CADSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ using namespace MbD;

void CADSystem::outputFor(AnalysisType type)
{
(void) type; // to suppress compiler warning of unused parameters
auto str = std::to_string(mbdSystem->mbdTimeValue());
this->logString(str);
mbdSystem->partsJointsMotionsForcesTorquesDo([](std::shared_ptr<Item> item) {
Expand All @@ -47,6 +48,7 @@ void CADSystem::logString(std::string& str)

void CADSystem::logString(double value)
{
(void) value; // to suppress compiler warning of unused parameters
}

void CADSystem::runOndselSinglePendulum()
Expand Down Expand Up @@ -836,6 +838,7 @@ void CADSystem::runPiston()

void MbD::CADSystem::preMbDrun(std::shared_ptr<System> mbdSys)
{
(void) mbdSys; // to suppress compiler warning of unused parameters
}

void CADSystem::postMbDrun()
Expand Down
7 changes: 6 additions & 1 deletion OndselSolver/Constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Constant::Constant(double val) : Variable(val)

Symsptr MbD::Constant::differentiateWRT(Symsptr var)
{
(void) var; // to suppress compiler warning of unused parameters
return sptrConstant(0.0);
}

Expand All @@ -39,7 +40,8 @@ Symsptr MbD::Constant::integrateWRT(Symsptr var)

Symsptr MbD::Constant::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
return sptr;
(void) set; // to suppress compiler warning of unused parameters
return sptr;
}

bool Constant::isConstant()
Expand All @@ -64,6 +66,8 @@ bool MbD::Constant::isOne()

void MbD::Constant::createMbD(std::shared_ptr<System> mbdSys, std::shared_ptr<Units> mbdUnits)
{
(void) mbdSys; // to suppress compiler warning of unused parameters
(void) mbdUnits; // to suppress compiler warning of unused parameters
return;
}

Expand All @@ -74,6 +78,7 @@ double MbD::Constant::getValue()

double MbD::Constant::getValue(double arg)
{
(void) arg; // to suppress compiler warning of unused parameters
return value;
}

Expand Down
3 changes: 3 additions & 0 deletions OndselSolver/Constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void Constraint::removeRedundantConstraints(std::shared_ptr<std::vector<int>> re

void MbD::Constraint::setConstant(double value)
{
(void) value; // to suppress compiler warning of unused parameters
}

void Constraint::reactivateRedundantConstraints()
Expand Down Expand Up @@ -163,10 +164,12 @@ void Constraint::setqsuddotlam(FColDsptr col)

void Constraint::addToJointForceI(FColDsptr col)
{
(void) col; // to suppress compiler warning of unused parameters
}

void Constraint::addToJointTorqueI(FColDsptr col)
{
(void) col; // to suppress compiler warning of unused parameters
}

void Constraint::fillConstraints(std::shared_ptr<std::vector<std::shared_ptr<Constraint>>> allConstraints) {
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/EulerAngleszxz.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace MbD {
template<typename T>
inline void EulerAngleszxz<T>::calc()
{
double zero = 0.0;
// double zero = 0.0;
double phi = this->at(0);
double sphi = sin(phi);
double cphi = cos(phi);
Expand Down
2 changes: 2 additions & 0 deletions OndselSolver/ExternalSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ void MbD::ExternalSystem::outputFor(AnalysisType type)

void MbD::ExternalSystem::logString(std::string& str)
{
(void) str; // to suppress compiler warning of unused parameters
}

void MbD::ExternalSystem::logString(double value)
{
(void) value; // to suppress compiler warning of unused parameters
}

void MbD::ExternalSystem::runOndselPiston()
Expand Down
1 change: 1 addition & 0 deletions OndselSolver/FullMotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ MbD::FullMotion::FullMotion()

MbD::FullMotion::FullMotion(const char* str)
{
(void) str; // to suppress compiler warning of unused parameters
}

void MbD::FullMotion::connectsItoJ(EndFrmsptr frmi, EndFrmsptr frmj)
Expand Down
3 changes: 3 additions & 0 deletions OndselSolver/GEFullMat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ FColDsptr GEFullMat::basicSolvewithsaveOriginal(FMatDsptr fullMat, FColDsptr ful

FColDsptr GEFullMat::basicSolvewithsaveOriginal(SpMatDsptr spMat, FColDsptr fullCol, bool saveOriginal)
{
(void) spMat; // to suppress compiler warning of unused parameters
(void) fullCol; // to suppress compiler warning of unused parameters
(void) saveOriginal; // to suppress compiler warning of unused parameters
assert(false);
return FColDsptr();
}
9 changes: 9 additions & 0 deletions OndselSolver/GESpMat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,26 @@ FColDsptr GESpMat::basicSolvewithsaveOriginal(SpMatDsptr spMat, FColDsptr fullCo

FColDsptr GESpMat::basicSolvewithsaveOriginal(FMatDsptr fullMat, FColDsptr fullCol, bool saveOriginal)
{
(void) fullMat; // to suppress compiler warning of unused parameters
(void) fullCol; // to suppress compiler warning of unused parameters
(void) saveOriginal; // to suppress compiler warning of unused parameters
assert(false);
return FColDsptr();
}

void GESpMat::preSolvewithsaveOriginal(FMatDsptr fullMat, FColDsptr fullCol, bool saveOriginal)
{
(void) fullMat; // to suppress compiler warning of unused parameters
(void) fullCol; // to suppress compiler warning of unused parameters
(void) saveOriginal; // to suppress compiler warning of unused parameters
assert(false);
}

void GESpMat::preSolvewithsaveOriginal(SpMatDsptr spMat, FColDsptr fullCol, bool saveOriginal)
{
(void) spMat; // to suppress compiler warning of unused parameters
(void) fullCol; // to suppress compiler warning of unused parameters
(void) saveOriginal; // to suppress compiler warning of unused parameters
assert(false);
}

Expand Down
1 change: 1 addition & 0 deletions OndselSolver/GearJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ MbD::GearJoint::GearJoint()

MbD::GearJoint::GearJoint(const char* str)
{
(void) str; // to suppress compiler warning of unused parameters
}

void MbD::GearJoint::initializeGlobally()
Expand Down
3 changes: 2 additions & 1 deletion OndselSolver/GeneralSpline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ void MbD::GeneralSpline::calcNonCyclicIndexAndDelta()

void MbD::GeneralSpline::calcIndexAndDelta()
{
if (!(index < xs->size() - 1) || !(xs->at(index) <= xvalue) || !(xvalue < xs->at((size_t)index + 1))) {
int xsLast = int(xs->size()) - 1;
if (!(index < xsLast) || !(xs->at(index) <= xvalue) || !(xvalue < xs->at((size_t)index + 1))) {
searchIndexFromto(0, (int)xs->size()); //Using range.
}
delta = xvalue - xs->at(index);
Expand Down
1 change: 1 addition & 0 deletions OndselSolver/InLineJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ MbD::InLineJoint::InLineJoint()

MbD::InLineJoint::InLineJoint(const char* str)
{
(void) str; // to suppress compiler warning of unused parameters
}

void MbD::InLineJoint::createInLineConstraints()
Expand Down
4 changes: 4 additions & 0 deletions OndselSolver/Integral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using namespace MbD;

MbD::Integral::Integral(Symsptr var, Symsptr integrand)
{
(void) var; // to suppress compiler warning of unused parameters
(void) integrand; // to suppress compiler warning of unused parameters
assert(false);
}

Expand All @@ -17,6 +19,7 @@ void MbD::Integral::arguments(Symsptr args)

Symsptr MbD::Integral::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
(void) sptr; // to suppress compiler warning of unused parameters
auto expand = expression->expandUntil(expression, set);
auto answer = std::make_shared<Integral>();
answer->xx = xx;
Expand All @@ -28,6 +31,7 @@ Symsptr MbD::Integral::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_

Symsptr MbD::Integral::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
(void) sptr; // to suppress compiler warning of unused parameters
auto simple = expression->simplifyUntil(expression, set);
auto answer = std::make_shared<Integral>();
answer->xx = xx;
Expand Down
1 change: 1 addition & 0 deletions OndselSolver/Integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ using namespace MbD;

void Integrator::setSystem(Solver* sys)
{
(void) sys; // to suppress compiler warning of unused parameters
}
Loading

0 comments on commit 3ae60d6

Please sign in to comment.