diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d77f39..6059710 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,659 +15,11 @@ ELSE() set( ONDSELSOLVER_BUILD_SHARED OFF ) ENDIF () -if ( ONDSELSOLVER_BUILD_SHARED ) - message( STATUS "[OndselSolver] Building shared library" ) - add_library(OndselSolver SHARED) -else() - message( STATUS "[OndselSolver] Building static library" ) - add_library(OndselSolver STATIC) -endif() - - -set(ONDSELSOLVER_SRC - OndselSolver/Abs.cpp - OndselSolver/AbsConstraint.cpp - OndselSolver/AccICKineNewtonRaphson.cpp - OndselSolver/AccICNewtonRaphson.cpp - OndselSolver/AccKineNewtonRaphson.cpp - OndselSolver/AccNewtonRaphson.cpp - OndselSolver/AllowZRotation.cpp - OndselSolver/AllowZRotationConstraintIqctJqc.cpp - OndselSolver/AngleJoint.cpp - OndselSolver/AngleZConstraintIJ.cpp - OndselSolver/AngleZConstraintIqcJc.cpp - OndselSolver/AngleZConstraintIqcJqc.cpp - OndselSolver/AngleZIecJec.cpp - OndselSolver/AngleZIeqcJec.cpp - OndselSolver/AngleZIeqcJeqc.cpp - OndselSolver/AnyGeneralSpline.cpp - OndselSolver/AnyPosICNewtonRaphson.cpp - OndselSolver/ArcSine.cpp - OndselSolver/ArcTan.cpp - OndselSolver/ArcTan2.cpp - OndselSolver/Arguments.cpp - OndselSolver/Array.cpp - OndselSolver/ASMTAllowRotation.cpp - OndselSolver/ASMTAngleJoint.cpp - OndselSolver/ASMTAnimationParameters.cpp - OndselSolver/ASMTAssembly.cpp - OndselSolver/ASMTConeConeContact.cpp - OndselSolver/ASMTContact.cpp - OndselSolver/ASMTCylConeContact.cpp - OndselSolver/ASMTCylCylContact.cpp - OndselSolver/ASMTCompoundJoint.cpp - OndselSolver/ASMTConstantGravity.cpp - OndselSolver/ASMTConstantVelocityJoint.cpp - OndselSolver/ASMTConstraintSet.cpp - OndselSolver/ASMTCylindricalJoint.cpp - OndselSolver/ASMTCylSphJoint.cpp - OndselSolver/ASMTExtrusion.cpp - OndselSolver/ASMTFixedJoint.cpp - OndselSolver/ASMTForceTorque.cpp - OndselSolver/ASMTGearJoint.cpp - OndselSolver/ASMTGeneralMotion.cpp - OndselSolver/ASMTInPlaneJoint.cpp - OndselSolver/ASMTItem.cpp - OndselSolver/ASMTItemIJ.cpp - OndselSolver/ASMTJoint.cpp - OndselSolver/ASMTKinematicIJ.cpp - OndselSolver/ASMTLimit.cpp - OndselSolver/ASMTLineInPlaneJoint.cpp - OndselSolver/ASMTMarker.cpp - OndselSolver/ASMTMotion.cpp - OndselSolver/ASMTNoRotationJoint.cpp - OndselSolver/ASMTParallelAxesJoint.cpp - OndselSolver/ASMTPart.cpp - OndselSolver/ASMTPerpendicularJoint.cpp - OndselSolver/ASMTPlanarJoint.cpp - OndselSolver/ASMTPointInLineJoint.cpp - OndselSolver/ASMTPointInPlaneJoint.cpp - OndselSolver/ASMTPrincipalMassMarker.cpp - OndselSolver/ASMTRackPinionJoint.cpp - OndselSolver/ASMTRefCurve.cpp - OndselSolver/ASMTRefItem.cpp - OndselSolver/ASMTRefPoint.cpp - OndselSolver/ASMTRefSurface.cpp - OndselSolver/ASMTRevCylJoint.cpp - OndselSolver/ASMTRevoluteJoint.cpp - OndselSolver/ASMTRevRevJoint.cpp - OndselSolver/ASMTRotationalMotion.cpp - OndselSolver/ASMTRotationLimit.cpp - OndselSolver/ASMTScrewJoint.cpp - OndselSolver/ASMTSimulationParameters.cpp - OndselSolver/ASMTSpatialContainer.cpp - OndselSolver/ASMTSpatialItem.cpp - OndselSolver/ASMTSphericalJoint.cpp - OndselSolver/ASMTSphSphJoint.cpp - OndselSolver/ASMTTime.cpp - OndselSolver/ASMTTranslationalJoint.cpp - OndselSolver/ASMTTranslationalMotion.cpp - OndselSolver/ASMTTranslationLimit.cpp - OndselSolver/ASMTUniversalJoint.cpp - OndselSolver/AtPointConstraintIJ.cpp - OndselSolver/AtPointConstraintIqcJc.cpp - OndselSolver/AtPointConstraintIqcJqc.cpp - OndselSolver/AtPointConstraintIqctJqc.cpp - OndselSolver/AtPointJoint.cpp - OndselSolver/BasicIntegrator.cpp - OndselSolver/BasicQuasiIntegrator.cpp - OndselSolver/BasicUserFunction.cpp - OndselSolver/CADSystem.cpp - OndselSolver/CartesianFrame.cpp - OndselSolver/CompoundJoint.cpp - OndselSolver/Constant.cpp - OndselSolver/ConstantGravity.cpp - OndselSolver/ConstantVelocityJoint.cpp - OndselSolver/Constraint.cpp - OndselSolver/ConstraintIJ.cpp - OndselSolver/ConstraintSet.cpp - OndselSolver/ConstVelConstraintIJ.cpp - OndselSolver/ConstVelConstraintIqcJc.cpp - OndselSolver/ConstVelConstraintIqcJqc.cpp - OndselSolver/Cosine.cpp - OndselSolver/CREATE.cpp - OndselSolver/CylindricalJoint.cpp - OndselSolver/CylSphJoint.cpp - OndselSolver/DiagonalMatrix.cpp - OndselSolver/DifferenceOperator.cpp - OndselSolver/DifferentiatedGeneralSpline.cpp - OndselSolver/DirectionCosineConstraintIJ.cpp - OndselSolver/DirectionCosineConstraintIqcJc.cpp - OndselSolver/DirectionCosineConstraintIqcJqc.cpp - OndselSolver/DirectionCosineConstraintIqctJqc.cpp - OndselSolver/DirectionCosineIecJec.cpp - OndselSolver/DirectionCosineIeqcJec.cpp - OndselSolver/DirectionCosineIeqcJeqc.cpp - OndselSolver/DirectionCosineIeqctJeqc.cpp - OndselSolver/DiscontinuityError.cpp - OndselSolver/DispCompIecJecIe.cpp - OndselSolver/DispCompIecJecKec.cpp - OndselSolver/DispCompIecJecKeqc.cpp - OndselSolver/DispCompIecJecO.cpp - OndselSolver/DispCompIeqcJecIe.cpp - OndselSolver/DispCompIeqcJecKeqc.cpp - OndselSolver/DispCompIeqcJecO.cpp - OndselSolver/DispCompIeqcJeqcIe.cpp - OndselSolver/DispCompIeqcJeqcKeqc.cpp - OndselSolver/DispCompIeqcJeqcKeqct.cpp - OndselSolver/DispCompIeqcJeqcO.cpp - OndselSolver/DispCompIeqctJeqcIe.cpp - OndselSolver/DispCompIeqctJeqcKeqct.cpp - OndselSolver/DispCompIeqctJeqcO.cpp - OndselSolver/DistanceConstraintIJ.cpp - OndselSolver/DistanceConstraintIqcJc.cpp - OndselSolver/DistanceConstraintIqcJqc.cpp - OndselSolver/DistanceConstraintIqctJqc.cpp - OndselSolver/DistancexyConstraintIJ.cpp - OndselSolver/DistancexyConstraintIqcJc.cpp - OndselSolver/DistancexyConstraintIqcJqc.cpp - OndselSolver/DistIecJec.cpp - OndselSolver/DistIeqcJec.cpp - OndselSolver/DistIeqcJeqc.cpp - OndselSolver/DistIeqctJeqc.cpp - OndselSolver/DistxyIecJec.cpp - OndselSolver/DistxyIeqcJec.cpp - OndselSolver/DistxyIeqcJeqc.cpp - OndselSolver/DistxyIeqctJeqc.cpp - OndselSolver/EigenDecomposition.cpp - OndselSolver/EndFramec.cpp - OndselSolver/EndFrameqc.cpp - OndselSolver/EndFrameqct.cpp - OndselSolver/EndFrameqct2.cpp - OndselSolver/EulerAngles.cpp - OndselSolver/EulerAnglesDDot.cpp - OndselSolver/EulerAnglesDot.cpp - OndselSolver/EulerAngleszxz.cpp - OndselSolver/EulerAngleszxzDDot.cpp - OndselSolver/EulerAngleszxzDot.cpp - OndselSolver/EulerArray.cpp - OndselSolver/EulerConstraint.cpp - OndselSolver/EulerParameters.cpp - OndselSolver/EulerParametersDDot.cpp - OndselSolver/EulerParametersDot.cpp - OndselSolver/Exponential.cpp - OndselSolver/ExpressionX.cpp - OndselSolver/ExternalSystem.cpp - OndselSolver/FixedJoint.cpp - OndselSolver/ForceTorqueData.cpp - OndselSolver/ForceTorqueItem.cpp - OndselSolver/FullColumn.cpp - OndselSolver/FullMatrix.cpp - OndselSolver/FullMotion.cpp - OndselSolver/FullRow.cpp - OndselSolver/FullVector.cpp - OndselSolver/Function.cpp - OndselSolver/FunctionFromData.cpp - OndselSolver/FunctionWithManyArgs.cpp - OndselSolver/FunctionX.cpp - OndselSolver/FunctionXcParameter.cpp - OndselSolver/FunctionXY.cpp - OndselSolver/GearConstraintIJ.cpp - OndselSolver/GearConstraintIqcJc.cpp - OndselSolver/GearConstraintIqcJqc.cpp - OndselSolver/GearJoint.cpp - OndselSolver/GEFullMat.cpp - OndselSolver/GEFullMatFullPv.cpp - OndselSolver/GEFullMatParPv.cpp - OndselSolver/GeneralSpline.cpp - OndselSolver/GESpMat.cpp - OndselSolver/GESpMatFullPv.cpp - OndselSolver/GESpMatFullPvPosIC.cpp - OndselSolver/GESpMatParPv.cpp - OndselSolver/GESpMatParPvMarko.cpp - OndselSolver/GESpMatParPvMarkoFast.cpp - OndselSolver/GESpMatParPvPrecise.cpp - OndselSolver/ICKineIntegrator.cpp - OndselSolver/IndependentVariable.cpp - OndselSolver/InLineJoint.cpp - OndselSolver/InPlaneJoint.cpp - OndselSolver/Integral.cpp - OndselSolver/Integrator.cpp - OndselSolver/IntegratorInterface.cpp - OndselSolver/Item.cpp - OndselSolver/ItemIJ.cpp - OndselSolver/Joint.cpp - OndselSolver/KineIntegrator.cpp - OndselSolver/KinematicIeJe.cpp - OndselSolver/LDUFullMat.cpp - OndselSolver/LDUFullMatParPv.cpp - OndselSolver/LDUSpMat.cpp - OndselSolver/LDUSpMatParPv.cpp - OndselSolver/LDUSpMatParPvMarko.cpp - OndselSolver/LDUSpMatParPvPrecise.cpp - OndselSolver/LimitIJ.cpp - OndselSolver/LinearMultiStepMethod.cpp - OndselSolver/LineInPlaneJoint.cpp - OndselSolver/Ln.cpp - OndselSolver/Log10.cpp - OndselSolver/LogN.cpp - OndselSolver/MarkerFrame.cpp - OndselSolver/MatrixDecomposition.cpp - OndselSolver/MatrixGaussElimination.cpp - OndselSolver/MatrixLDU.cpp - OndselSolver/MatrixSolver.cpp - OndselSolver/MaximumIterationError.cpp - OndselSolver/MbDMath.cpp - OndselSolver/MomentOfInertiaSolver.cpp - OndselSolver/Negative.cpp - OndselSolver/NewtonRaphson.cpp - OndselSolver/NewtonRaphsonError.cpp - OndselSolver/NoRotationJoint.cpp - OndselSolver/NotKinematicError.cpp - OndselSolver/Numeric.cpp - OndselSolver/OrbitAngleZIecJec.cpp - OndselSolver/OrbitAngleZIeqcJec.cpp - OndselSolver/OrbitAngleZIeqcJeqc.cpp - OndselSolver/Orientation.cpp - OndselSolver/ParallelAxesJoint.cpp - OndselSolver/Part.cpp - OndselSolver/PartFrame.cpp - OndselSolver/PerpendicularJoint.cpp - OndselSolver/PiecewiseFunction.cpp - OndselSolver/PlanarJoint.cpp - OndselSolver/PointInLineJoint.cpp - OndselSolver/PointInPlaneJoint.cpp - OndselSolver/Polynomial.cpp - OndselSolver/PosICDragLimitNewtonRaphson.cpp - OndselSolver/PosICDragNewtonRaphson.cpp - OndselSolver/PosICKineNewtonRaphson.cpp - OndselSolver/PosICNewtonRaphson.cpp - OndselSolver/PosKineNewtonRaphson.cpp - OndselSolver/PosNewtonRaphson.cpp - OndselSolver/PosVelAccData.cpp - OndselSolver/Power.cpp - OndselSolver/PrescribedMotion.cpp - OndselSolver/Product.cpp - OndselSolver/QuasiIntegrator.cpp - OndselSolver/RackPinConstraintIJ.cpp - OndselSolver/RackPinConstraintIqcJc.cpp - OndselSolver/RackPinConstraintIqcJqc.cpp - OndselSolver/RackPinJoint.cpp - OndselSolver/RampStepFunction.cpp - OndselSolver/Reciprocal.cpp - OndselSolver/RedundantConstraint.cpp - OndselSolver/RevCylJoint.cpp - OndselSolver/RevoluteJoint.cpp - OndselSolver/RevRevJoint.cpp - OndselSolver/RotationLimitIJ.cpp - OndselSolver/RowTypeMatrix.cpp - OndselSolver/ScalarNewtonRaphson.cpp - OndselSolver/ScrewConstraintIJ.cpp - OndselSolver/ScrewConstraintIqcJc.cpp - OndselSolver/ScrewConstraintIqcJqc.cpp - OndselSolver/ScrewJoint.cpp - OndselSolver/SimulationStoppingError.cpp - OndselSolver/Sine.cpp - OndselSolver/SingularMatrixError.cpp - OndselSolver/Solver.cpp - OndselSolver/SparseColumn.cpp - OndselSolver/SparseMatrix.cpp - OndselSolver/SparseRow.cpp - OndselSolver/SparseVector.cpp - OndselSolver/SphericalJoint.cpp - OndselSolver/SphSphJoint.cpp - OndselSolver/StableBackwardDifference.cpp - OndselSolver/StateData.cpp - OndselSolver/Sum.cpp - OndselSolver/Symbolic.cpp - OndselSolver/SymbolicParser.cpp - OndselSolver/SyntaxError.cpp - OndselSolver/System.cpp - OndselSolver/SystemNewtonRaphson.cpp - OndselSolver/SystemSolver.cpp - OndselSolver/Time.cpp - OndselSolver/TooManyTriesError.cpp - OndselSolver/TooSmallStepSizeError.cpp - OndselSolver/Translation.cpp - OndselSolver/TranslationalJoint.cpp - OndselSolver/TranslationConstraintIJ.cpp - OndselSolver/TranslationConstraintIqcJc.cpp - OndselSolver/TranslationConstraintIqcJqc.cpp - OndselSolver/TranslationConstraintIqctJqc.cpp - OndselSolver/TranslationLimitIJ.cpp - OndselSolver/Units.cpp - OndselSolver/UniversalJoint.cpp - OndselSolver/UserFunction.cpp - OndselSolver/Variable.cpp - OndselSolver/VectorNewtonRaphson.cpp - OndselSolver/VelICKineSolver.cpp - OndselSolver/VelICSolver.cpp - OndselSolver/VelKineSolver.cpp - OndselSolver/VelSolver.cpp - OndselSolver/ZRotation.cpp - OndselSolver/ZTranslation.cpp -) - -set(ONDSELSOLVER_HEADERS - OndselSolver/Abs.h - OndselSolver/AbsConstraint.h - OndselSolver/AccICKineNewtonRaphson.h - OndselSolver/AccICNewtonRaphson.h - OndselSolver/AccKineNewtonRaphson.h - OndselSolver/AccNewtonRaphson.h - OndselSolver/AllowZRotation.h - OndselSolver/AllowZRotationConstraintIqctJqc.h - OndselSolver/AngleJoint.h - OndselSolver/AngleZConstraintIJ.h - OndselSolver/AngleZConstraintIqcJc.h - OndselSolver/AngleZConstraintIqcJqc.h - OndselSolver/AngleZIecJec.h - OndselSolver/AngleZIeqcJec.h - OndselSolver/AngleZIeqcJeqc.h - OndselSolver/AnyGeneralSpline.h - OndselSolver/AnyPosICNewtonRaphson.h - OndselSolver/ArcSine.h - OndselSolver/ArcTan.h - OndselSolver/ArcTan2.h - OndselSolver/Arguments.h - OndselSolver/Array.h - OndselSolver/ASMTAllowRotation.h - OndselSolver/ASMTAngleJoint.h - OndselSolver/ASMTAnimationParameters.h - OndselSolver/ASMTAssembly.h - OndselSolver/ASMTCompoundJoint.h - OndselSolver/ASMTConstantGravity.h - OndselSolver/ASMTConstantVelocityJoint.h - OndselSolver/ASMTConstraintSet.h - OndselSolver/ASMTCylindricalJoint.h - OndselSolver/ASMTCylSphJoint.h - OndselSolver/ASMTExtrusion.h - OndselSolver/ASMTFixedJoint.h - OndselSolver/ASMTForceTorque.h - OndselSolver/ASMTGearJoint.h - OndselSolver/ASMTGeneralMotion.h - OndselSolver/ASMTInPlaneJoint.h - OndselSolver/ASMTItem.h - OndselSolver/ASMTItemIJ.h - OndselSolver/ASMTJoint.h - OndselSolver/ASMTKinematicIJ.h - OndselSolver/ASMTLimit.h - OndselSolver/ASMTLineInPlaneJoint.h - OndselSolver/ASMTMarker.h - OndselSolver/ASMTMotion.h - OndselSolver/ASMTNoRotationJoint.h - OndselSolver/ASMTParallelAxesJoint.h - OndselSolver/ASMTPart.h - OndselSolver/ASMTPerpendicularJoint.h - OndselSolver/ASMTPlanarJoint.h - OndselSolver/ASMTPointInLineJoint.h - OndselSolver/ASMTPointInPlaneJoint.h - OndselSolver/ASMTPrincipalMassMarker.h - OndselSolver/ASMTRackPinionJoint.h - OndselSolver/ASMTRefCurve.h - OndselSolver/ASMTRefItem.h - OndselSolver/ASMTRefPoint.h - OndselSolver/ASMTRefSurface.h - OndselSolver/ASMTRevCylJoint.h - OndselSolver/ASMTRevoluteJoint.h - OndselSolver/ASMTRevRevJoint.h - OndselSolver/ASMTRotationalMotion.h - OndselSolver/ASMTRotationLimit.h - OndselSolver/ASMTScrewJoint.h - OndselSolver/ASMTSimulationParameters.h - OndselSolver/ASMTSpatialContainer.h - OndselSolver/ASMTSpatialItem.h - OndselSolver/ASMTSphericalJoint.h - OndselSolver/ASMTSphSphJoint.h - OndselSolver/ASMTTime.h - OndselSolver/ASMTTranslationalJoint.h - OndselSolver/ASMTTranslationalMotion.h - OndselSolver/ASMTTranslationLimit.h - OndselSolver/ASMTUniversalJoint.h - OndselSolver/AtPointConstraintIJ.h - OndselSolver/AtPointConstraintIqcJc.h - OndselSolver/AtPointConstraintIqcJqc.h - OndselSolver/AtPointConstraintIqctJqc.h - OndselSolver/AtPointJoint.h - OndselSolver/BasicIntegrator.h - OndselSolver/BasicQuasiIntegrator.h - OndselSolver/BasicUserFunction.h - OndselSolver/CADSystem.h - OndselSolver/CartesianFrame.h - OndselSolver/CompoundJoint.h - OndselSolver/ASMTConeConeContact.h - OndselSolver/ASMTContact.h - OndselSolver/ASMTCylConeContact.h - OndselSolver/ASMTCylCylContact.h - OndselSolver/Constant.h - OndselSolver/ConstantGravity.h - OndselSolver/ConstantVelocityJoint.h - OndselSolver/Constraint.h - OndselSolver/ConstraintIJ.h - OndselSolver/ConstraintSet.h - OndselSolver/ConstVelConstraintIJ.h - OndselSolver/ConstVelConstraintIqcJc.h - OndselSolver/ConstVelConstraintIqcJqc.h - OndselSolver/Cosine.h - OndselSolver/CREATE.h - OndselSolver/CylindricalJoint.h - OndselSolver/CylSphJoint.h - OndselSolver/DiagonalMatrix.h - OndselSolver/DifferenceOperator.h - OndselSolver/DifferentiatedGeneralSpline.h - OndselSolver/DirectionCosineConstraintIJ.h - OndselSolver/DirectionCosineConstraintIqcJc.h - OndselSolver/DirectionCosineConstraintIqcJqc.h - OndselSolver/DirectionCosineConstraintIqctJqc.h - OndselSolver/DirectionCosineIecJec.h - OndselSolver/DirectionCosineIeqcJec.h - OndselSolver/DirectionCosineIeqcJeqc.h - OndselSolver/DirectionCosineIeqctJeqc.h - OndselSolver/DiscontinuityError.h - OndselSolver/DispCompIecJecIe.h - OndselSolver/DispCompIecJecKec.h - OndselSolver/DispCompIecJecKeqc.h - OndselSolver/DispCompIecJecO.h - OndselSolver/DispCompIeqcJecIe.h - OndselSolver/DispCompIeqcJecKeqc.h - OndselSolver/DispCompIeqcJecO.h - OndselSolver/DispCompIeqcJeqcIe.h - OndselSolver/DispCompIeqcJeqcKeqc.h - OndselSolver/DispCompIeqcJeqcKeqct.h - OndselSolver/DispCompIeqcJeqcO.h - OndselSolver/DispCompIeqctJeqcIe.h - OndselSolver/DispCompIeqctJeqcKeqct.h - OndselSolver/DispCompIeqctJeqcO.h - OndselSolver/DistanceConstraintIJ.h - OndselSolver/DistanceConstraintIqcJc.h - OndselSolver/DistanceConstraintIqcJqc.h - OndselSolver/DistanceConstraintIqctJqc.h - OndselSolver/DistancexyConstraintIJ.h - OndselSolver/DistancexyConstraintIqcJc.h - OndselSolver/DistancexyConstraintIqcJqc.h - OndselSolver/DistIecJec.h - OndselSolver/DistIeqcJec.h - OndselSolver/DistIeqcJeqc.h - OndselSolver/DistIeqctJeqc.h - OndselSolver/DistxyIecJec.h - OndselSolver/DistxyIeqcJec.h - OndselSolver/DistxyIeqcJeqc.h - OndselSolver/DistxyIeqctJeqc.h - OndselSolver/EigenDecomposition.h - OndselSolver/EndFramec.h - OndselSolver/EndFrameqc.h - OndselSolver/EndFrameqct.h - OndselSolver/EndFrameqct2.h - OndselSolver/enum.h - OndselSolver/EulerAngles.h - OndselSolver/EulerAnglesDDot.h - OndselSolver/EulerAnglesDot.h - OndselSolver/EulerAngleszxz.h - OndselSolver/EulerAngleszxzDDot.h - OndselSolver/EulerAngleszxzDot.h - OndselSolver/EulerArray.h - OndselSolver/EulerConstraint.h - OndselSolver/EulerParameters.h - OndselSolver/EulerParametersDDot.h - OndselSolver/EulerParametersDot.h - OndselSolver/Exponential.h - OndselSolver/ExpressionX.h - OndselSolver/ExternalSystem.h - OndselSolver/FixedJoint.h - OndselSolver/ForceTorqueData.h - OndselSolver/ForceTorqueItem.h - OndselSolver/FullColumn.h - OndselSolver/FullMatrix.h - OndselSolver/FullMotion.h - OndselSolver/FullRow.h - OndselSolver/FullRow.h - OndselSolver/FullVector.h - OndselSolver/Function.h - OndselSolver/FunctionFromData.h - OndselSolver/FunctionWithManyArgs.h - OndselSolver/FunctionX.h - OndselSolver/FunctionXcParameter.h - OndselSolver/FunctionXY.h - OndselSolver/GearConstraintIJ.h - OndselSolver/GearConstraintIqcJc.h - OndselSolver/GearConstraintIqcJqc.h - OndselSolver/GearJoint.h - OndselSolver/GEFullMat.h - OndselSolver/GEFullMatFullPv.h - OndselSolver/GEFullMatParPv.h - OndselSolver/GeneralSpline.h - OndselSolver/GESpMat.h - OndselSolver/GESpMatFullPv.h - OndselSolver/GESpMatFullPvPosIC.h - OndselSolver/GESpMatParPv.h - OndselSolver/GESpMatParPvMarko.h - OndselSolver/GESpMatParPvMarkoFast.h - OndselSolver/GESpMatParPvPrecise.h - OndselSolver/ICKineIntegrator.h - OndselSolver/IndependentVariable.h - OndselSolver/InLineJoint.h - OndselSolver/InPlaneJoint.h - OndselSolver/Integrator.h - OndselSolver/IntegratorInterface.h - OndselSolver/Item.h - OndselSolver/ItemIJ.h - OndselSolver/Joint.h - OndselSolver/KineIntegrator.h - OndselSolver/KinematicIeJe.h - OndselSolver/LDUFullMat.h - OndselSolver/LDUFullMatParPv.h - OndselSolver/LDUSpMat.h - OndselSolver/LDUSpMatParPv.h - OndselSolver/LDUSpMatParPvMarko.h - OndselSolver/LDUSpMatParPvPrecise.h - OndselSolver/LimitIJ.h - OndselSolver/LinearMultiStepMethod.h - OndselSolver/LineInPlaneJoint.h - OndselSolver/Ln.h - OndselSolver/Log10.h - OndselSolver/LogN.h - OndselSolver/MarkerFrame.h - OndselSolver/MatrixDecomposition.h - OndselSolver/MatrixGaussElimination.h - OndselSolver/MatrixLDU.h - OndselSolver/MatrixSolver.h - OndselSolver/MaximumIterationError.h - OndselSolver/MbDMath.h - OndselSolver/MomentOfInertiaSolver.h - OndselSolver/Negative.h - OndselSolver/NewtonRaphson.h - OndselSolver/NewtonRaphsonError.h - OndselSolver/NoRotationJoint.h - OndselSolver/NotKinematicError.h - OndselSolver/Numeric.h - OndselSolver/OrbitAngleZIecJec.h - OndselSolver/OrbitAngleZIeqcJec.h - OndselSolver/OrbitAngleZIeqcJeqc.h - OndselSolver/Orientation.h - OndselSolver/ParallelAxesJoint.h - OndselSolver/Part.h - OndselSolver/PartFrame.h - OndselSolver/PerpendicularJoint.h - OndselSolver/PlanarJoint.h - OndselSolver/PointInLineJoint.h - OndselSolver/PointInPlaneJoint.h - OndselSolver/PosICDragLimitNewtonRaphson.h - OndselSolver/PosICDragNewtonRaphson.h - OndselSolver/PosICKineNewtonRaphson.h - OndselSolver/PosICNewtonRaphson.h - OndselSolver/PosKineNewtonRaphson.h - OndselSolver/PosNewtonRaphson.h - OndselSolver/PosVelAccData.h - OndselSolver/Power.h - OndselSolver/PrescribedMotion.h - OndselSolver/Product.h - OndselSolver/QuasiIntegrator.h - OndselSolver/RackPinConstraintIJ.h - OndselSolver/RackPinConstraintIqcJc.h - OndselSolver/RackPinConstraintIqcJqc.h - OndselSolver/RackPinJoint.h - OndselSolver/Reciprocal.h - OndselSolver/RedundantConstraint.h - OndselSolver/resource.h - OndselSolver/RevCylJoint.h - OndselSolver/RevoluteJoint.h - OndselSolver/RevRevJoint.h - OndselSolver/RotationLimitIJ.h - OndselSolver/RowTypeMatrix.h - OndselSolver/ScalarNewtonRaphson.h - OndselSolver/ScrewConstraintIJ.h - OndselSolver/ScrewConstraintIqcJc.h - OndselSolver/ScrewConstraintIqcJqc.h - OndselSolver/ScrewJoint.h - OndselSolver/SimulationStoppingError.h - OndselSolver/Sine.h - OndselSolver/SingularMatrixError.h - OndselSolver/Solver.h - OndselSolver/SparseColumn.h - OndselSolver/SparseMatrix.h - OndselSolver/SparseRow.h - OndselSolver/SparseVector.h - OndselSolver/SphericalJoint.h - OndselSolver/SphSphJoint.h - OndselSolver/StableBackwardDifference.h - OndselSolver/StateData.h - OndselSolver/Sum.h - OndselSolver/Symbolic.h - OndselSolver/SymbolicParser.h - OndselSolver/SyntaxError.h - OndselSolver/System.h - OndselSolver/SystemNewtonRaphson.h - OndselSolver/SystemSolver.h - OndselSolver/Time.h - OndselSolver/TooManyTriesError.h - OndselSolver/TooSmallStepSizeError.h - OndselSolver/Translation.h - OndselSolver/TranslationalJoint.h - OndselSolver/TranslationConstraintIJ.h - OndselSolver/TranslationConstraintIqcJc.h - OndselSolver/TranslationConstraintIqcJqc.h - OndselSolver/TranslationConstraintIqctJqc.h - OndselSolver/TranslationLimitIJ.h - OndselSolver/Units.h - OndselSolver/UniversalJoint.h - OndselSolver/UserFunction.h - OndselSolver/Variable.h - OndselSolver/VectorNewtonRaphson.h - OndselSolver/VelICKineSolver.h - OndselSolver/VelICSolver.h - OndselSolver/VelKineSolver.h - OndselSolver/VelSolver.h - OndselSolver/ZRotation.h - OndselSolver/ZTranslation.h -) - -target_sources(OndselSolver PRIVATE - "${ONDSELSOLVER_SRC}" - "${ONDSELSOLVER_HEADERS}") - -set_target_properties(OndselSolver - PROPERTIES VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER "${ONDSELSOLVER_HEADERS}" -) - -if(MSVC) - target_compile_definitions(OndselSolver PRIVATE _USE_MATH_DEFINES) -endif(MSVC) - -configure_file(OndselSolver.pc.in ${CMAKE_BINARY_DIR}/OndselSolver.pc @ONLY) -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) +add_compile_definitions(TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/testapp") +add_subdirectory(OndselSolver) +add_subdirectory(OndselSolverMain) +include(CTest) +enable_testing() +add_subdirectory(tests) +target_compile_definitions(test_run PUBLIC TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/testapp") +set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OndselSolverMain PROPERTY VS_STARTUP_PROJECT OndselSolverMain) \ No newline at end of file diff --git a/OndselSolver.sln b/OndselSolver.sln deleted file mode 100644 index 2d4c734..0000000 --- a/OndselSolver.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.33530.505 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OndselSolver", "OndselSolver\OndselSolver.vcxproj", "{80F56CBC-B685-4C36-B834-A2DCDF0A98B7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Debug|x64.ActiveCfg = Debug|x64 - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Debug|x64.Build.0 = Debug|x64 - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Debug|x86.ActiveCfg = Debug|Win32 - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Debug|x86.Build.0 = Debug|Win32 - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Release|x64.ActiveCfg = Release|x64 - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Release|x64.Build.0 = Release|x64 - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Release|x86.ActiveCfg = Release|Win32 - {80F56CBC-B685-4C36-B834-A2DCDF0A98B7}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {BD48A6EF-4E93-4C09-BCE1-84F0439DB2D9} - EndGlobalSection -EndGlobal diff --git a/OndselSolver/ASMTAllowRotation.cpp b/OndselSolver/ASMTAllowRotation.cpp index 643cf84..91556b5 100644 --- a/OndselSolver/ASMTAllowRotation.cpp +++ b/OndselSolver/ASMTAllowRotation.cpp @@ -55,7 +55,7 @@ std::shared_ptr MbD::ASMTAllowRotation::mbdClassNew() return AllowZRotation::With(); } -void MbD::ASMTAllowRotation::setMotionJoint(std::string motionJoint) +void MbD::ASMTAllowRotation::setMotionJoint(const std::string& motionJoint) { (void) motionJoint; } diff --git a/OndselSolver/ASMTAllowRotation.h b/OndselSolver/ASMTAllowRotation.h index 44885a8..b71a46b 100644 --- a/OndselSolver/ASMTAllowRotation.h +++ b/OndselSolver/ASMTAllowRotation.h @@ -20,7 +20,7 @@ namespace MbD { void readMotionJoint(std::vector& lines); void initMarkers() override; std::shared_ptr mbdClassNew() override; - void setMotionJoint(std::string motionJoint); + void setMotionJoint(const std::string& motionJoint); void storeOnLevel(std::ofstream& os, size_t level) override; void storeOnTimeSeries(std::ofstream& os) override; diff --git a/OndselSolver/ASMTAssembly.cpp b/OndselSolver/ASMTAssembly.cpp index 87eec10..053e182 100644 --- a/OndselSolver/ASMTAssembly.cpp +++ b/OndselSolver/ASMTAssembly.cpp @@ -61,6 +61,7 @@ #include "ASMTLimit.h" #include "ASMTRotationLimit.h" #include "ASMTTranslationLimit.h" +#include using namespace MbD; @@ -354,8 +355,11 @@ void MbD::ASMTAssembly::runSinglePendulum() assembly->runKINEMATIC(); } -std::shared_ptr MbD::ASMTAssembly::assemblyFromFile(const char* fileName) +std::shared_ptr MbD::ASMTAssembly::assemblyFromFile(const std::string& fileName) { + std::filesystem::path currentPath = std::filesystem::current_path(); + std::cout << "Current directory: " << currentPath << std::endl; + std::ifstream stream(fileName); if (stream.fail()) { throw std::invalid_argument("File not found."); @@ -376,7 +380,7 @@ std::shared_ptr MbD::ASMTAssembly::assemblyFromFile(const char* fi return assembly; } -void MbD::ASMTAssembly::runFile(const char* fileName) +void MbD::ASMTAssembly::runFile(const std::string& fileName) { std::ifstream stream(fileName); if (stream.fail()) { @@ -424,8 +428,8 @@ void MbD::ASMTAssembly::runDraggingLogTest3() void MbD::ASMTAssembly::runDraggingTest() { - // auto assembly = ASMTAssembly::assemblyFromFile("../testapp/pistonWithLimits.asmt"); - auto assembly = ASMTAssembly::assemblyFromFile("../testapp/dragCrankSlider.asmt"); + // auto assembly = ASMTAssembly::assemblyFromFile("../../testapp/pistonWithLimits.asmt"); + auto assembly = ASMTAssembly::assemblyFromFile("../../testapp/dragCrankSlider.asmt"); assembly->setDebug(true); auto limit1 = ASMTRotationLimit::With(); @@ -464,8 +468,8 @@ void MbD::ASMTAssembly::runDraggingTest() void MbD::ASMTAssembly::runDraggingTest2() { - // auto assembly = ASMTAssembly::assemblyFromFile("../testapp/pistonWithLimits.asmt"); - auto assembly = ASMTAssembly::assemblyFromFile("../testapp/dragCrankSlider.asmt"); + // auto assembly = ASMTAssembly::assemblyFromFile("../../testapp/pistonWithLimits.asmt"); + auto assembly = ASMTAssembly::assemblyFromFile("../../testapp/dragCrankSlider.asmt"); assembly->setDebug(true); auto limit1 = ASMTRotationLimit::With(); @@ -504,7 +508,7 @@ void MbD::ASMTAssembly::runDraggingTest2() void MbD::ASMTAssembly::runDraggingTest3() { - auto assembly = ASMTAssembly::assemblyFromFile("../testapp/rackPinion3.asmt"); + auto assembly = ASMTAssembly::assemblyFromFile("../../testapp/rackPinion3.asmt"); assembly->setDebug(true); auto dragPart = assembly->partNamed("/OndselAssembly/rackPinion#Box"); auto rotPart = assembly->partNamed("/OndselAssembly/rackPinion#Cylinder"); @@ -534,7 +538,7 @@ void MbD::ASMTAssembly::runDraggingTest3() rotMat = rotPart->rotationMatrix; } -void MbD::ASMTAssembly::readWriteFile(const char* fileName) +void MbD::ASMTAssembly::readWriteFile(const std::string& fileName) { std::ifstream stream(fileName); if (stream.fail()) { @@ -571,7 +575,7 @@ ASMTAssembly* MbD::ASMTAssembly::root() return this; } -void MbD::ASMTAssembly::setNotes(std::string str) +void MbD::ASMTAssembly::setNotes(const std::string& str) { notes = str; } @@ -1040,7 +1044,7 @@ void MbD::ASMTAssembly::readMotionSeries(std::vector& lines) motion->readMotionSeries(lines); } -void MbD::ASMTAssembly::runDraggingLog(const char* fileName) +void MbD::ASMTAssembly::runDraggingLog(const std::string& fileName) { std::ifstream stream(fileName); if (stream.fail()) { @@ -1270,7 +1274,7 @@ void MbD::ASMTAssembly::createMbD(std::shared_ptr mbdSys, std::shared_pt // animationParameters = nullptr; } -void MbD::ASMTAssembly::outputFile(std::string filename) +void MbD::ASMTAssembly::outputFile(const std::string& filename) { std::ofstream os(filename); os << std::setprecision(std::numeric_limits::max_digits10); @@ -1458,7 +1462,7 @@ MbD::ASMTAssembly::spatialContainerAt(std::shared_ptr self, return part; } -std::shared_ptr MbD::ASMTAssembly::partAt(std::string& longname) const +std::shared_ptr MbD::ASMTAssembly::partAt(const std::string& longname) const { for (auto& part : *parts) { if (part->fullName("") == longname) { @@ -1468,7 +1472,7 @@ std::shared_ptr MbD::ASMTAssembly::partAt(std::string& longname) const return nullptr; } -std::shared_ptr MbD::ASMTAssembly::markerAt(std::string& longname) const +std::shared_ptr MbD::ASMTAssembly::markerAt(const std::string& longname) const { for (auto& refPoint : *refPoints) { for (auto& marker : *refPoint->markers) { @@ -1489,7 +1493,7 @@ std::shared_ptr MbD::ASMTAssembly::markerAt(std::string& longname) c return nullptr; } -std::shared_ptr MbD::ASMTAssembly::jointAt(std::string& longname) const +std::shared_ptr MbD::ASMTAssembly::jointAt(const std::string& longname) const { auto it = std::find_if(joints->begin(), joints->end(), [&](const std::shared_ptr& jt) { @@ -1499,7 +1503,7 @@ std::shared_ptr MbD::ASMTAssembly::jointAt(std::string& longname) con return joint; } -std::shared_ptr MbD::ASMTAssembly::motionAt(std::string& longname) const +std::shared_ptr MbD::ASMTAssembly::motionAt(const std::string& longname) const { auto it = std::find_if(motions->begin(), motions->end(), [&](const std::shared_ptr& mt) { @@ -1509,7 +1513,7 @@ std::shared_ptr MbD::ASMTAssembly::motionAt(std::string& longname) c return motion; } -std::shared_ptr MbD::ASMTAssembly::forceTorqueAt(std::string& longname) const +std::shared_ptr MbD::ASMTAssembly::forceTorqueAt(const std::string& longname) const { auto it = std::find_if(forcesTorques->begin(), forcesTorques->end(), @@ -1621,7 +1625,7 @@ void MbD::ASMTAssembly::setSimulationParameters( parameters->owner = this; } -std::shared_ptr MbD::ASMTAssembly::partNamed(std::string partName) const +std::shared_ptr MbD::ASMTAssembly::partNamed(const std::string& partName) const { auto it = std::find_if(parts->begin(), parts->end(), [&](const std::shared_ptr& prt) { return prt->fullName("") == partName; @@ -1630,7 +1634,7 @@ std::shared_ptr MbD::ASMTAssembly::partNamed(std::string partName) con return part; } -std::shared_ptr MbD::ASMTAssembly::partPartialNamed(std::string partialName) const +std::shared_ptr MbD::ASMTAssembly::partPartialNamed(const std::string& partialName) const { auto it = std::find_if(parts->begin(), parts->end(), [&](const std::shared_ptr& prt) { auto fullName = prt->fullName(""); @@ -1740,7 +1744,7 @@ void MbD::ASMTAssembly::storeOnTimeSeries(std::ofstream& os) } } -void MbD::ASMTAssembly::setFilename(std::string str) +void MbD::ASMTAssembly::setFilename(const std::string& str) { std::stringstream ss; ss << "FileName = " << str << std::endl; diff --git a/OndselSolver/ASMTAssembly.h b/OndselSolver/ASMTAssembly.h index d50172a..4179565 100644 --- a/OndselSolver/ASMTAssembly.h +++ b/OndselSolver/ASMTAssembly.h @@ -38,8 +38,8 @@ namespace MbD { static void runSinglePendulumSuperSimplified2(); static void runSinglePendulumSimplified(); static void runSinglePendulum(); - static std::shared_ptr assemblyFromFile(const char* chars); - static void runFile(const char* chars); + static std::shared_ptr assemblyFromFile(const std::string& fileName); + static void runFile(const std::string& chars); static void runDraggingLogTest(); static void runDraggingLogTest2(); static void runDraggingLogTest3(); @@ -47,10 +47,10 @@ namespace MbD { static void runDraggingTest2(); static void runDraggingTest3(); - static void readWriteFile(const char* chars); + static void readWriteFile(const std::string& chars); void initialize() override; ASMTAssembly* root() override; - void setNotes(std::string str); + void setNotes(const std::string& str); void parseASMT(std::vector& lines) override; void readNotes(std::vector& lines); void readParts(std::vector& lines); @@ -75,7 +75,7 @@ namespace MbD { void readJointSeries(std::vector& lines); void readMotionSeriesMany(std::vector& lines); void readMotionSeries(std::vector& lines); - void runDraggingLog(const char* chars); + void runDraggingLog(const std::string& chars); void outputFor(AnalysisType type); void preMbDrun(std::shared_ptr mbdSys); @@ -89,7 +89,7 @@ namespace MbD { std::shared_ptr>>markerMap() const; void deleteMbD() override; void createMbD(std::shared_ptr mbdSys, std::shared_ptr mbdUnits) override; - void outputFile(std::string filename); + void outputFile(const std::string& filename); void storeOnLevel(std::ofstream& os, size_t level) override; /* This function performs a one shot solve of the assembly.*/ @@ -102,11 +102,11 @@ namespace MbD { void runKINEMATIC(); void initprincipalMassMarker(); std::shared_ptr spatialContainerAt(std::shared_ptr self, std::string& longname) const; - std::shared_ptr partAt(std::string& longname) const; - std::shared_ptr markerAt(std::string& longname) const; - std::shared_ptr jointAt(std::string& longname) const; - std::shared_ptr motionAt(std::string& longname) const; - std::shared_ptr forceTorqueAt(std::string& longname) const; + std::shared_ptr partAt(const std::string& longname) const; + std::shared_ptr markerAt(const std::string& longname) const; + std::shared_ptr jointAt(const std::string& longname) const; + std::shared_ptr motionAt(const std::string& longname) const; + std::shared_ptr forceTorqueAt(const std::string& longname) const; FColDsptr vOcmO() override; FColDsptr omeOpO() override; std::shared_ptr geoTime() const; @@ -119,8 +119,8 @@ namespace MbD { void addLimit(std::shared_ptr limit); void setConstantGravity(std::shared_ptr constantGravity); void setSimulationParameters(std::shared_ptr simulationParameters); - std::shared_ptr partNamed(std::string partName) const; - std::shared_ptr partPartialNamed(std::string partialName) const; + std::shared_ptr partNamed(const std::string& partName) const; + std::shared_ptr partPartialNamed(const std::string& partialName) const; void storeOnLevelNotes(std::ofstream& os, size_t level); void storeOnLevelParts(std::ofstream& os, size_t level); void storeOnLevelKinematicIJs(std::ofstream& os, size_t level); @@ -131,7 +131,7 @@ namespace MbD { void storeOnLevelLimits(std::ofstream& os, size_t level); void storeOnLevelGeneralConstraintSets(std::ofstream& os, size_t level); void storeOnTimeSeries(std::ofstream& os) override; - void setFilename(std::string filename); + void setFilename(const std::string& filename); void setDebug(bool todebug); std::string filename = ""; diff --git a/OndselSolver/ASMTItem.cpp b/OndselSolver/ASMTItem.cpp index de44e93..ffcb754 100644 --- a/OndselSolver/ASMTItem.cpp +++ b/OndselSolver/ASMTItem.cpp @@ -46,7 +46,7 @@ std::string MbD::ASMTItem::classname() return answer; } -void MbD::ASMTItem::setName(std::string str) +void MbD::ASMTItem::setName(const std::string& str) { name = str; } @@ -72,7 +72,7 @@ std::string MbD::ASMTItem::readStringOffTop(std::vector& args) return str; } -FRowDsptr MbD::ASMTItem::readRowOfDoubles(std::string& line) +FRowDsptr MbD::ASMTItem::readRowOfDoubles(const std::string& line) { std::istringstream iss(line); auto readRowOfDoubles = std::make_shared>(); @@ -89,7 +89,7 @@ FRowDsptr MbD::ASMTItem::readRowOfDoublesOffTop(std::vector& lines) return readRowOfDoubles(str); } -FColDsptr MbD::ASMTItem::readColumnOfDoubles(std::string& line) +FColDsptr MbD::ASMTItem::readColumnOfDoubles(const std::string& line) { std::istringstream iss(line); auto readColumnOfDoubles = std::make_shared>(); @@ -106,7 +106,7 @@ FColDsptr MbD::ASMTItem::readColumnOfDoublesOffTop(std::vector& lin return readColumnOfDoubles(str); } -double MbD::ASMTItem::readDouble(std::string& line) +double MbD::ASMTItem::readDouble(const std::string& line) { std::istringstream iss(line); double d; @@ -114,7 +114,7 @@ double MbD::ASMTItem::readDouble(std::string& line) return d; } -int MbD::ASMTItem::readInt(std::string& line) +int MbD::ASMTItem::readInt(const std::string& line) { std::istringstream iss(line); int i; @@ -122,7 +122,7 @@ int MbD::ASMTItem::readInt(std::string& line) return i; } -size_t MbD::ASMTItem::readSize_t(std::string& line) +size_t MbD::ASMTItem::readSize_t(const std::string& line) { std::istringstream iss(line); size_t i; @@ -130,7 +130,7 @@ size_t MbD::ASMTItem::readSize_t(std::string& line) return i; } -bool MbD::ASMTItem::readBool(std::string& line) +bool MbD::ASMTItem::readBool(const std::string& line) { if (line.find("true") != std::string::npos) { @@ -146,7 +146,7 @@ bool MbD::ASMTItem::readBool(std::string& line) } } -std::string MbD::ASMTItem::readString(std::string& line) +std::string MbD::ASMTItem::readString(const std::string& line) { std::string str = line; str.erase(str.begin(), std::find_if(str.begin(), str.end(), [](unsigned char ch) { return !std::isspace(ch); })); @@ -161,7 +161,7 @@ void MbD::ASMTItem::readName(std::vector& lines) lines.erase(lines.begin()); } -std::string MbD::ASMTItem::fullName(std::string partialName) +std::string MbD::ASMTItem::fullName(const std::string& partialName) { std::string longerName = "/" + name + partialName; if (owner == nullptr) { @@ -172,7 +172,7 @@ std::string MbD::ASMTItem::fullName(std::string partialName) } } -void MbD::ASMTItem::readDoublesInto(std::string& str, std::string label, FRowDsptr& row) +void MbD::ASMTItem::readDoublesInto(std::string str, std::string label, FRowDsptr& row) { auto pos = str.find(label); assert(pos != std::string::npos); @@ -289,12 +289,7 @@ void MbD::ASMTItem::storeOnTimeSeries(std::ofstream&) assert(false); } -void MbD::ASMTItem::logString(std::string& str) +void MbD::ASMTItem::logString(const std::string& str) { std::cout << str << std::endl; } - -void MbD::ASMTItem::logString(const char* chars) -{ - std::cout << chars << std::endl; -} diff --git a/OndselSolver/ASMTItem.h b/OndselSolver/ASMTItem.h index 6ec2b20..b6551e5 100644 --- a/OndselSolver/ASMTItem.h +++ b/OndselSolver/ASMTItem.h @@ -28,22 +28,22 @@ namespace MbD { virtual void initialize(); void noop(); virtual std::string classname(); - void setName(std::string str); + void setName(const std::string& str); virtual void parseASMT(std::vector& lines); std::string popOffTop(std::vector& lines); std::string readStringOffTop(std::vector& lines); - FRowDsptr readRowOfDoubles(std::string& line); + FRowDsptr readRowOfDoubles(const std::string& line); FRowDsptr readRowOfDoublesOffTop(std::vector& lines); - FColDsptr readColumnOfDoubles(std::string& line); + FColDsptr readColumnOfDoubles(const std::string& line); FColDsptr readColumnOfDoublesOffTop(std::vector& lines); - double readDouble(std::string& line); - int readInt(std::string& line); - size_t readSize_t(std::string& line); - bool readBool(std::string& line); - std::string readString(std::string& line); + double readDouble(const std::string& line); + int readInt(const std::string& line); + size_t readSize_t(const std::string& line); + bool readBool(const std::string& line); + std::string readString(const std::string& line); void readName(std::vector& lines); - virtual std::string fullName(std::string partialName); - void readDoublesInto(std::string& str, std::string label, FRowDsptr& row); + virtual std::string fullName(const std::string& partialName); + void readDoublesInto(std::string str, std::string label, FRowDsptr& row); virtual void deleteMbD(); virtual void createMbD(std::shared_ptr mbdSys, std::shared_ptr mbdUnits); virtual void updateFromMbD(); @@ -63,8 +63,7 @@ namespace MbD { virtual void storeOnLevelArray(std::ofstream& os, size_t level, std::vector array); virtual void storeOnLevelName(std::ofstream& os, size_t level); virtual void storeOnTimeSeries(std::ofstream& os); - void logString(std::string& str); - void logString(const char* chars); + void logString(const std::string& str); std::string name; ASMTItem* owner = nullptr; diff --git a/OndselSolver/ASMTItemIJ.cpp b/OndselSolver/ASMTItemIJ.cpp index 19ad421..89968d9 100644 --- a/OndselSolver/ASMTItemIJ.cpp +++ b/OndselSolver/ASMTItemIJ.cpp @@ -35,12 +35,12 @@ void MbD::ASMTItemIJ::initialize() tzs = std::make_shared>(); } -void MbD::ASMTItemIJ::setMarkerI(std::string mkrI) +void MbD::ASMTItemIJ::setMarkerI(const std::string& mkrI) { markerI = mkrI; } -void MbD::ASMTItemIJ::setMarkerJ(std::string mkrJ) +void MbD::ASMTItemIJ::setMarkerJ(const std::string& mkrJ) { markerJ = mkrJ; } diff --git a/OndselSolver/ASMTItemIJ.h b/OndselSolver/ASMTItemIJ.h index 065acef..5cdbcc4 100644 --- a/OndselSolver/ASMTItemIJ.h +++ b/OndselSolver/ASMTItemIJ.h @@ -17,8 +17,8 @@ namespace MbD { public: ASMTItemIJ(); void initialize() override; - void setMarkerI(std::string mkrI); - void setMarkerJ(std::string mkrJ); + void setMarkerI(const std::string& mkrI); + void setMarkerJ(const std::string& mkrJ); void readMarkerI(std::vector& lines); void readMarkerJ(std::vector& lines); void readFXonIs(std::vector& lines); diff --git a/OndselSolver/ASMTLimit.cpp b/OndselSolver/ASMTLimit.cpp index e8f6728..5952c92 100644 --- a/OndselSolver/ASMTLimit.cpp +++ b/OndselSolver/ASMTLimit.cpp @@ -95,22 +95,22 @@ void MbD::ASMTLimit::createMbD(std::shared_ptr mbdSys, std::shared_ptrtol = geotol->getValue(); } -void MbD::ASMTLimit::setmotionJoint(std::string _motionJoint) +void MbD::ASMTLimit::setmotionJoint(const std::string& _motionJoint) { motionJoint = _motionJoint; } -void MbD::ASMTLimit::settype(std::string _type) +void MbD::ASMTLimit::settype(const std::string& _type) { type = _type; } -void MbD::ASMTLimit::setlimit(std::string _limit) +void MbD::ASMTLimit::setlimit(const std::string& _limit) { limit = _limit; } -void MbD::ASMTLimit::settol(std::string _tol) +void MbD::ASMTLimit::settol(const std::string& _tol) { tol = _tol; } diff --git a/OndselSolver/ASMTLimit.h b/OndselSolver/ASMTLimit.h index 83bdcd4..d8f4df8 100644 --- a/OndselSolver/ASMTLimit.h +++ b/OndselSolver/ASMTLimit.h @@ -24,10 +24,10 @@ namespace MbD { void readTol(std::vector& lines); void parseASMT(std::vector& lines) override; void createMbD(std::shared_ptr mbdSys, std::shared_ptr mbdUnits) override; - void setmotionJoint(std::string _motionJoint); - void settype(std::string _type); - void setlimit(std::string _limit); - void settol(std::string _tol); + void setmotionJoint(const std::string& _motionJoint); + void settype(const std::string& _type); + void setlimit(const std::string& _limit); + void settol(const std::string& _tol); std::string motionJoint, type, limit, tol; diff --git a/OndselSolver/ASMTRefPoint.cpp b/OndselSolver/ASMTRefPoint.cpp index 3adc1c1..e86b853 100644 --- a/OndselSolver/ASMTRefPoint.cpp +++ b/OndselSolver/ASMTRefPoint.cpp @@ -19,7 +19,7 @@ void MbD::ASMTRefPoint::parseASMT(std::vector& lines) readMarkers(lines); } -std::string MbD::ASMTRefPoint::fullName(std::string partialName) +std::string MbD::ASMTRefPoint::fullName(const std::string& partialName) { return owner->fullName(partialName); } diff --git a/OndselSolver/ASMTRefPoint.h b/OndselSolver/ASMTRefPoint.h index 72eacaf..19e6c7c 100644 --- a/OndselSolver/ASMTRefPoint.h +++ b/OndselSolver/ASMTRefPoint.h @@ -18,7 +18,7 @@ namespace MbD { // public: void parseASMT(std::vector& lines) override; - std::string fullName(std::string partialName) override; + std::string fullName(const std::string& partialName) override; void createMbD(std::shared_ptr mbdSys, std::shared_ptr mbdUnits) override; void storeOnLevel(std::ofstream& os, size_t level) override; diff --git a/OndselSolver/ASMTRotationalMotion.cpp b/OndselSolver/ASMTRotationalMotion.cpp index 0b681e7..2d29a4b 100644 --- a/OndselSolver/ASMTRotationalMotion.cpp +++ b/OndselSolver/ASMTRotationalMotion.cpp @@ -89,12 +89,12 @@ std::shared_ptr MbD::ASMTRotationalMotion::mbdClassNew() return CREATE::With(); } -void MbD::ASMTRotationalMotion::setMotionJoint(std::string str) +void MbD::ASMTRotationalMotion::setMotionJoint(const std::string& str) { motionJoint = str; } -void MbD::ASMTRotationalMotion::setRotationZ(std::string rotZ) +void MbD::ASMTRotationalMotion::setRotationZ(const std::string& rotZ) { rotationZ = rotZ; } diff --git a/OndselSolver/ASMTRotationalMotion.h b/OndselSolver/ASMTRotationalMotion.h index f8019a9..08209af 100644 --- a/OndselSolver/ASMTRotationalMotion.h +++ b/OndselSolver/ASMTRotationalMotion.h @@ -23,8 +23,8 @@ namespace MbD { void initMarkers() override; void createMbD(std::shared_ptr mbdSys, std::shared_ptr mbdUnits) override; std::shared_ptr mbdClassNew() override; - void setMotionJoint(std::string motionJoint); - void setRotationZ(std::string rotZ); + void setMotionJoint(const std::string& motionJoint); + void setRotationZ(const std::string& rotZ); void storeOnLevel(std::ofstream& os, size_t level) override; void storeOnTimeSeries(std::ofstream& os) override; diff --git a/OndselSolver/ASMTTime.cpp b/OndselSolver/ASMTTime.cpp index aca06e7..ec01ebf 100644 --- a/OndselSolver/ASMTTime.cpp +++ b/OndselSolver/ASMTTime.cpp @@ -9,7 +9,7 @@ #include #include "ASMTTime.h" -#include "Time.h" +#include "SymTime.h" #include "Constant.h" #include "Product.h" diff --git a/OndselSolver/AbsConstraint.cpp b/OndselSolver/AbsConstraint.cpp index ca50d41..7eebc71 100644 --- a/OndselSolver/AbsConstraint.cpp +++ b/OndselSolver/AbsConstraint.cpp @@ -13,7 +13,7 @@ using namespace MbD; // //AbsConstraint::AbsConstraint() {} // -//AbsConstraint::AbsConstraint(const char* str) : Constraint(str) {} +//AbsConstraint::AbsConstraint(const std::string& str) : Constraint(str) {} AbsConstraint::AbsConstraint(size_t i) { diff --git a/OndselSolver/AbsConstraint.h b/OndselSolver/AbsConstraint.h index eed9beb..81a6549 100644 --- a/OndselSolver/AbsConstraint.h +++ b/OndselSolver/AbsConstraint.h @@ -15,7 +15,7 @@ namespace MbD { //axis iqXminusOnePlusAxis public: //AbsConstraint(); - //AbsConstraint(const char* str); + //AbsConstraint(const std::string& str); AbsConstraint(size_t axis); void calcPostDynCorrectorIteration() override; diff --git a/OndselSolver/AllowZRotation.cpp b/OndselSolver/AllowZRotation.cpp index 641fa43..a74d62c 100644 --- a/OndselSolver/AllowZRotation.cpp +++ b/OndselSolver/AllowZRotation.cpp @@ -22,7 +22,7 @@ MbD::AllowZRotation::AllowZRotation() //Do nothing. } -MbD::AllowZRotation::AllowZRotation(const char* str) : PrescribedMotion(str) +MbD::AllowZRotation::AllowZRotation(const std::string& str) : PrescribedMotion(str) { //Do nothing. } diff --git a/OndselSolver/AllowZRotation.h b/OndselSolver/AllowZRotation.h index b371234..8820ad1 100644 --- a/OndselSolver/AllowZRotation.h +++ b/OndselSolver/AllowZRotation.h @@ -16,7 +16,7 @@ namespace MbD { // public: AllowZRotation(); - AllowZRotation(const char* str); + AllowZRotation(const std::string& str); static std::shared_ptr With(); void initializeGlobally() override; void postPosIC() override; diff --git a/OndselSolver/AngleJoint.cpp b/OndselSolver/AngleJoint.cpp index 8387f57..c84161b 100644 --- a/OndselSolver/AngleJoint.cpp +++ b/OndselSolver/AngleJoint.cpp @@ -17,7 +17,7 @@ MbD::AngleJoint::AngleJoint() { } -MbD::AngleJoint::AngleJoint(const char* str) : Joint(str) +MbD::AngleJoint::AngleJoint(const std::string& str) : Joint(str) { } diff --git a/OndselSolver/AngleJoint.h b/OndselSolver/AngleJoint.h index 146713c..1828ea4 100644 --- a/OndselSolver/AngleJoint.h +++ b/OndselSolver/AngleJoint.h @@ -16,7 +16,7 @@ namespace MbD { //theIzJz public: AngleJoint(); - AngleJoint(const char* str); + AngleJoint(const std::string& str); void initializeGlobally() override; double theIzJz = 0.0; diff --git a/OndselSolver/AtPointJoint.cpp b/OndselSolver/AtPointJoint.cpp index 03205b8..5726695 100644 --- a/OndselSolver/AtPointJoint.cpp +++ b/OndselSolver/AtPointJoint.cpp @@ -16,7 +16,7 @@ MbD::AtPointJoint::AtPointJoint() { } -MbD::AtPointJoint::AtPointJoint(const char* str) : Joint(str) +MbD::AtPointJoint::AtPointJoint(const std::string& str) : Joint(str) { } diff --git a/OndselSolver/AtPointJoint.h b/OndselSolver/AtPointJoint.h index e27547e..8651ba2 100644 --- a/OndselSolver/AtPointJoint.h +++ b/OndselSolver/AtPointJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: AtPointJoint(); - AtPointJoint(const char* str); + AtPointJoint(const std::string& str); void createAtPointConstraints(); diff --git a/OndselSolver/BasicIntegrator.cpp b/OndselSolver/BasicIntegrator.cpp index a897732..5bbe0bc 100644 --- a/OndselSolver/BasicIntegrator.cpp +++ b/OndselSolver/BasicIntegrator.cpp @@ -88,7 +88,7 @@ void BasicIntegrator::initialize() opBDF->timeNodes = tpast; } -void BasicIntegrator::logString(std::string& str) +void BasicIntegrator::logString(const std::string& str) { system->logString(str); } diff --git a/OndselSolver/BasicIntegrator.h b/OndselSolver/BasicIntegrator.h index 88f2b3f..9a9aa2d 100644 --- a/OndselSolver/BasicIntegrator.h +++ b/OndselSolver/BasicIntegrator.h @@ -38,7 +38,7 @@ namespace MbD { void selectOrder() override; void subsequentSteps() override; void setSystem(Solver* sys) override; - void logString(std::string& str) override; + void logString(const std::string& str) override; virtual void setorder(size_t o); virtual void settnew(double t); diff --git a/OndselSolver/CADSystem.cpp b/OndselSolver/CADSystem.cpp index ce70dc8..22b3014 100644 --- a/OndselSolver/CADSystem.cpp +++ b/OndselSolver/CADSystem.cpp @@ -22,7 +22,7 @@ #include "Part.h" #include "MarkerFrame.h" #include "PartFrame.h" -#include "Time.h" +#include "SymTime.h" #include "StateData.h" #include "EulerParameters.h" @@ -40,7 +40,7 @@ void CADSystem::outputFor(AnalysisType) }); } -void CADSystem::logString(std::string& str) +void CADSystem::logString(const std::string& str) { std::cout << str << std::endl; } diff --git a/OndselSolver/CADSystem.h b/OndselSolver/CADSystem.h index 697467e..407c56d 100644 --- a/OndselSolver/CADSystem.h +++ b/OndselSolver/CADSystem.h @@ -25,7 +25,7 @@ namespace MbD { } void outputFor(AnalysisType type); - void logString(std::string& str); + void logString(const std::string& str); void logString(double value); void runOndselSinglePendulum(); void runOndselDoublePendulum(); diff --git a/OndselSolver/CMakeLists.txt b/OndselSolver/CMakeLists.txt new file mode 100644 index 0000000..8e78a85 --- /dev/null +++ b/OndselSolver/CMakeLists.txt @@ -0,0 +1,655 @@ +if ( ONDSELSOLVER_BUILD_SHARED ) + message( STATUS "[OndselSolver] Building shared library" ) + add_library(OndselSolver SHARED) +else() + message( STATUS "[OndselSolver] Building static library" ) + add_library(OndselSolver STATIC) +endif() + +set(ONDSELSOLVER_SRC + Abs.cpp + AbsConstraint.cpp + AccICKineNewtonRaphson.cpp + AccICNewtonRaphson.cpp + AccKineNewtonRaphson.cpp + AccNewtonRaphson.cpp + AllowZRotation.cpp + AllowZRotationConstraintIqctJqc.cpp + AngleJoint.cpp + AngleZConstraintIJ.cpp + AngleZConstraintIqcJc.cpp + AngleZConstraintIqcJqc.cpp + AngleZIecJec.cpp + AngleZIeqcJec.cpp + AngleZIeqcJeqc.cpp + AnyGeneralSpline.cpp + AnyPosICNewtonRaphson.cpp + ArcSine.cpp + ArcTan.cpp + ArcTan2.cpp + Arguments.cpp + Array.cpp + ASMTAllowRotation.cpp + ASMTAngleJoint.cpp + ASMTAnimationParameters.cpp + ASMTAssembly.cpp + ASMTConeConeContact.cpp + ASMTContact.cpp + ASMTCylConeContact.cpp + ASMTCylCylContact.cpp + ASMTCompoundJoint.cpp + ASMTConstantGravity.cpp + ASMTConstantVelocityJoint.cpp + ASMTConstraintSet.cpp + ASMTCylindricalJoint.cpp + ASMTCylSphJoint.cpp + ASMTExtrusion.cpp + ASMTFixedJoint.cpp + ASMTForceTorque.cpp + ASMTGearJoint.cpp + ASMTGeneralMotion.cpp + ASMTInPlaneJoint.cpp + ASMTItem.cpp + ASMTItemIJ.cpp + ASMTJoint.cpp + ASMTKinematicIJ.cpp + ASMTLimit.cpp + ASMTLineInPlaneJoint.cpp + ASMTMarker.cpp + ASMTMotion.cpp + ASMTNoRotationJoint.cpp + ASMTParallelAxesJoint.cpp + ASMTPart.cpp + ASMTPerpendicularJoint.cpp + ASMTPlanarJoint.cpp + ASMTPointInLineJoint.cpp + ASMTPointInPlaneJoint.cpp + ASMTPrincipalMassMarker.cpp + ASMTRackPinionJoint.cpp + ASMTRefCurve.cpp + ASMTRefItem.cpp + ASMTRefPoint.cpp + ASMTRefSurface.cpp + ASMTRevCylJoint.cpp + ASMTRevoluteJoint.cpp + ASMTRevRevJoint.cpp + ASMTRotationalMotion.cpp + ASMTRotationLimit.cpp + ASMTScrewJoint.cpp + ASMTSimulationParameters.cpp + ASMTSpatialContainer.cpp + ASMTSpatialItem.cpp + ASMTSphericalJoint.cpp + ASMTSphSphJoint.cpp + ASMTTime.cpp + ASMTTranslationalJoint.cpp + ASMTTranslationalMotion.cpp + ASMTTranslationLimit.cpp + ASMTUniversalJoint.cpp + AtPointConstraintIJ.cpp + AtPointConstraintIqcJc.cpp + AtPointConstraintIqcJqc.cpp + AtPointConstraintIqctJqc.cpp + AtPointJoint.cpp + BasicIntegrator.cpp + BasicQuasiIntegrator.cpp + BasicUserFunction.cpp + CADSystem.cpp + CartesianFrame.cpp + CompoundJoint.cpp + Constant.cpp + ConstantGravity.cpp + ConstantVelocityJoint.cpp + Constraint.cpp + ConstraintIJ.cpp + ConstraintSet.cpp + ConstVelConstraintIJ.cpp + ConstVelConstraintIqcJc.cpp + ConstVelConstraintIqcJqc.cpp + Cosine.cpp + CREATE.cpp + CylindricalJoint.cpp + CylSphJoint.cpp + DiagonalMatrix.cpp + DifferenceOperator.cpp + DifferentiatedGeneralSpline.cpp + DirectionCosineConstraintIJ.cpp + DirectionCosineConstraintIqcJc.cpp + DirectionCosineConstraintIqcJqc.cpp + DirectionCosineConstraintIqctJqc.cpp + DirectionCosineIecJec.cpp + DirectionCosineIeqcJec.cpp + DirectionCosineIeqcJeqc.cpp + DirectionCosineIeqctJeqc.cpp + DiscontinuityError.cpp + DispCompIecJecIe.cpp + DispCompIecJecKec.cpp + DispCompIecJecKeqc.cpp + DispCompIecJecO.cpp + DispCompIeqcJecIe.cpp + DispCompIeqcJecKeqc.cpp + DispCompIeqcJecO.cpp + DispCompIeqcJeqcIe.cpp + DispCompIeqcJeqcKeqc.cpp + DispCompIeqcJeqcKeqct.cpp + DispCompIeqcJeqcO.cpp + DispCompIeqctJeqcIe.cpp + DispCompIeqctJeqcKeqct.cpp + DispCompIeqctJeqcO.cpp + DistanceConstraintIJ.cpp + DistanceConstraintIqcJc.cpp + DistanceConstraintIqcJqc.cpp + DistanceConstraintIqctJqc.cpp + DistancexyConstraintIJ.cpp + DistancexyConstraintIqcJc.cpp + DistancexyConstraintIqcJqc.cpp + DistIecJec.cpp + DistIeqcJec.cpp + DistIeqcJeqc.cpp + DistIeqctJeqc.cpp + DistxyIecJec.cpp + DistxyIeqcJec.cpp + DistxyIeqcJeqc.cpp + DistxyIeqctJeqc.cpp + EigenDecomposition.cpp + EndFramec.cpp + EndFrameqc.cpp + EndFrameqct.cpp + EndFrameqct2.cpp + EulerAngles.cpp + EulerAnglesDDot.cpp + EulerAnglesDot.cpp + EulerAngleszxz.cpp + EulerAngleszxzDDot.cpp + EulerAngleszxzDot.cpp + EulerArray.cpp + EulerConstraint.cpp + EulerParameters.cpp + EulerParametersDDot.cpp + EulerParametersDot.cpp + Exponential.cpp + ExpressionX.cpp + ExternalSystem.cpp + FixedJoint.cpp + ForceTorqueData.cpp + ForceTorqueItem.cpp + FullColumn.cpp + FullMatrix.cpp + FullMotion.cpp + FullRow.cpp + FullVector.cpp + Function.cpp + FunctionFromData.cpp + FunctionWithManyArgs.cpp + FunctionX.cpp + FunctionXcParameter.cpp + FunctionXY.cpp + GearConstraintIJ.cpp + GearConstraintIqcJc.cpp + GearConstraintIqcJqc.cpp + GearJoint.cpp + GEFullMat.cpp + GEFullMatFullPv.cpp + GEFullMatParPv.cpp + GeneralSpline.cpp + GESpMat.cpp + GESpMatFullPv.cpp + GESpMatFullPvPosIC.cpp + GESpMatParPv.cpp + GESpMatParPvMarko.cpp + GESpMatParPvMarkoFast.cpp + GESpMatParPvPrecise.cpp + ICKineIntegrator.cpp + IndependentVariable.cpp + InLineJoint.cpp + InPlaneJoint.cpp + Integral.cpp + Integrator.cpp + IntegratorInterface.cpp + Item.cpp + ItemIJ.cpp + Joint.cpp + KineIntegrator.cpp + KinematicIeJe.cpp + LDUFullMat.cpp + LDUFullMatParPv.cpp + LDUSpMat.cpp + LDUSpMatParPv.cpp + LDUSpMatParPvMarko.cpp + LDUSpMatParPvPrecise.cpp + LimitIJ.cpp + LinearMultiStepMethod.cpp + LineInPlaneJoint.cpp + Ln.cpp + Log10.cpp + LogN.cpp + MarkerFrame.cpp + MatrixDecomposition.cpp + MatrixGaussElimination.cpp + MatrixLDU.cpp + MatrixSolver.cpp + MaximumIterationError.cpp + MbDMath.cpp + MomentOfInertiaSolver.cpp + Negative.cpp + NewtonRaphson.cpp + NewtonRaphsonError.cpp + NoRotationJoint.cpp + NotKinematicError.cpp + Numeric.cpp + OrbitAngleZIecJec.cpp + OrbitAngleZIeqcJec.cpp + OrbitAngleZIeqcJeqc.cpp + Orientation.cpp + ParallelAxesJoint.cpp + Part.cpp + PartFrame.cpp + PerpendicularJoint.cpp + PiecewiseFunction.cpp + PlanarJoint.cpp + PointInLineJoint.cpp + PointInPlaneJoint.cpp + Polynomial.cpp + PosICDragLimitNewtonRaphson.cpp + PosICDragNewtonRaphson.cpp + PosICKineNewtonRaphson.cpp + PosICNewtonRaphson.cpp + PosKineNewtonRaphson.cpp + PosNewtonRaphson.cpp + PosVelAccData.cpp + Power.cpp + PrescribedMotion.cpp + Product.cpp + QuasiIntegrator.cpp + RackPinConstraintIJ.cpp + RackPinConstraintIqcJc.cpp + RackPinConstraintIqcJqc.cpp + RackPinJoint.cpp + RampStepFunction.cpp + Reciprocal.cpp + RedundantConstraint.cpp + RevCylJoint.cpp + RevoluteJoint.cpp + RevRevJoint.cpp + RotationLimitIJ.cpp + RowTypeMatrix.cpp + ScalarNewtonRaphson.cpp + ScrewConstraintIJ.cpp + ScrewConstraintIqcJc.cpp + ScrewConstraintIqcJqc.cpp + ScrewJoint.cpp + SimulationStoppingError.cpp + Sine.cpp + SingularMatrixError.cpp + Solver.cpp + SparseColumn.cpp + SparseMatrix.cpp + SparseRow.cpp + SparseVector.cpp + SphericalJoint.cpp + SphSphJoint.cpp + StableBackwardDifference.cpp + StateData.cpp + Sum.cpp + Symbolic.cpp + SymbolicParser.cpp + SyntaxError.cpp + System.cpp + SystemNewtonRaphson.cpp + SystemSolver.cpp + Time.cpp + TooManyTriesError.cpp + TooSmallStepSizeError.cpp + Translation.cpp + TranslationalJoint.cpp + TranslationConstraintIJ.cpp + TranslationConstraintIqcJc.cpp + TranslationConstraintIqcJqc.cpp + TranslationConstraintIqctJqc.cpp + TranslationLimitIJ.cpp + Units.cpp + UniversalJoint.cpp + UserFunction.cpp + Variable.cpp + VectorNewtonRaphson.cpp + VelICKineSolver.cpp + VelICSolver.cpp + VelKineSolver.cpp + VelSolver.cpp + ZRotation.cpp + ZTranslation.cpp +) + +set(ONDSELSOLVER_HEADERS + Abs.h + AbsConstraint.h + AccICKineNewtonRaphson.h + AccICNewtonRaphson.h + AccKineNewtonRaphson.h + AccNewtonRaphson.h + AllowZRotation.h + AllowZRotationConstraintIqctJqc.h + AngleJoint.h + AngleZConstraintIJ.h + AngleZConstraintIqcJc.h + AngleZConstraintIqcJqc.h + AngleZIecJec.h + AngleZIeqcJec.h + AngleZIeqcJeqc.h + AnyGeneralSpline.h + AnyPosICNewtonRaphson.h + ArcSine.h + ArcTan.h + ArcTan2.h + Arguments.h + Array.h + ASMTAllowRotation.h + ASMTAngleJoint.h + ASMTAnimationParameters.h + ASMTAssembly.h + ASMTCompoundJoint.h + ASMTConstantGravity.h + ASMTConstantVelocityJoint.h + ASMTConstraintSet.h + ASMTCylindricalJoint.h + ASMTCylSphJoint.h + ASMTExtrusion.h + ASMTFixedJoint.h + ASMTForceTorque.h + ASMTGearJoint.h + ASMTGeneralMotion.h + ASMTInPlaneJoint.h + ASMTItem.h + ASMTItemIJ.h + ASMTJoint.h + ASMTKinematicIJ.h + ASMTLimit.h + ASMTLineInPlaneJoint.h + ASMTMarker.h + ASMTMotion.h + ASMTNoRotationJoint.h + ASMTParallelAxesJoint.h + ASMTPart.h + ASMTPerpendicularJoint.h + ASMTPlanarJoint.h + ASMTPointInLineJoint.h + ASMTPointInPlaneJoint.h + ASMTPrincipalMassMarker.h + ASMTRackPinionJoint.h + ASMTRefCurve.h + ASMTRefItem.h + ASMTRefPoint.h + ASMTRefSurface.h + ASMTRevCylJoint.h + ASMTRevoluteJoint.h + ASMTRevRevJoint.h + ASMTRotationalMotion.h + ASMTRotationLimit.h + ASMTScrewJoint.h + ASMTSimulationParameters.h + ASMTSpatialContainer.h + ASMTSpatialItem.h + ASMTSphericalJoint.h + ASMTSphSphJoint.h + ASMTTime.h + ASMTTranslationalJoint.h + ASMTTranslationalMotion.h + ASMTTranslationLimit.h + ASMTUniversalJoint.h + AtPointConstraintIJ.h + AtPointConstraintIqcJc.h + AtPointConstraintIqcJqc.h + AtPointConstraintIqctJqc.h + AtPointJoint.h + BasicIntegrator.h + BasicQuasiIntegrator.h + BasicUserFunction.h + CADSystem.h + CartesianFrame.h + CompoundJoint.h + ASMTConeConeContact.h + ASMTContact.h + ASMTCylConeContact.h + ASMTCylCylContact.h + Constant.h + ConstantGravity.h + ConstantVelocityJoint.h + Constraint.h + ConstraintIJ.h + ConstraintSet.h + ConstVelConstraintIJ.h + ConstVelConstraintIqcJc.h + ConstVelConstraintIqcJqc.h + Cosine.h + CREATE.h + CylindricalJoint.h + CylSphJoint.h + DiagonalMatrix.h + DifferenceOperator.h + DifferentiatedGeneralSpline.h + DirectionCosineConstraintIJ.h + DirectionCosineConstraintIqcJc.h + DirectionCosineConstraintIqcJqc.h + DirectionCosineConstraintIqctJqc.h + DirectionCosineIecJec.h + DirectionCosineIeqcJec.h + DirectionCosineIeqcJeqc.h + DirectionCosineIeqctJeqc.h + DiscontinuityError.h + DispCompIecJecIe.h + DispCompIecJecKec.h + DispCompIecJecKeqc.h + DispCompIecJecO.h + DispCompIeqcJecIe.h + DispCompIeqcJecKeqc.h + DispCompIeqcJecO.h + DispCompIeqcJeqcIe.h + DispCompIeqcJeqcKeqc.h + DispCompIeqcJeqcKeqct.h + DispCompIeqcJeqcO.h + DispCompIeqctJeqcIe.h + DispCompIeqctJeqcKeqct.h + DispCompIeqctJeqcO.h + DistanceConstraintIJ.h + DistanceConstraintIqcJc.h + DistanceConstraintIqcJqc.h + DistanceConstraintIqctJqc.h + DistancexyConstraintIJ.h + DistancexyConstraintIqcJc.h + DistancexyConstraintIqcJqc.h + DistIecJec.h + DistIeqcJec.h + DistIeqcJeqc.h + DistIeqctJeqc.h + DistxyIecJec.h + DistxyIeqcJec.h + DistxyIeqcJeqc.h + DistxyIeqctJeqc.h + EigenDecomposition.h + EndFramec.h + EndFrameqc.h + EndFrameqct.h + EndFrameqct2.h + enum.h + EulerAngles.h + EulerAnglesDDot.h + EulerAnglesDot.h + EulerAngleszxz.h + EulerAngleszxzDDot.h + EulerAngleszxzDot.h + EulerArray.h + EulerConstraint.h + EulerParameters.h + EulerParametersDDot.h + EulerParametersDot.h + Exponential.h + ExpressionX.h + ExternalSystem.h + FixedJoint.h + ForceTorqueData.h + ForceTorqueItem.h + FullColumn.h + FullMatrix.h + FullMotion.h + FullRow.h + FullRow.h + FullVector.h + Function.h + FunctionFromData.h + FunctionWithManyArgs.h + FunctionX.h + FunctionXcParameter.h + FunctionXY.h + GearConstraintIJ.h + GearConstraintIqcJc.h + GearConstraintIqcJqc.h + GearJoint.h + GEFullMat.h + GEFullMatFullPv.h + GEFullMatParPv.h + GeneralSpline.h + GESpMat.h + GESpMatFullPv.h + GESpMatFullPvPosIC.h + GESpMatParPv.h + GESpMatParPvMarko.h + GESpMatParPvMarkoFast.h + GESpMatParPvPrecise.h + ICKineIntegrator.h + IndependentVariable.h + InLineJoint.h + InPlaneJoint.h + Integrator.h + IntegratorInterface.h + Item.h + ItemIJ.h + Joint.h + KineIntegrator.h + KinematicIeJe.h + LDUFullMat.h + LDUFullMatParPv.h + LDUSpMat.h + LDUSpMatParPv.h + LDUSpMatParPvMarko.h + LDUSpMatParPvPrecise.h + LimitIJ.h + LinearMultiStepMethod.h + LineInPlaneJoint.h + Ln.h + Log10.h + LogN.h + MarkerFrame.h + MatrixDecomposition.h + MatrixGaussElimination.h + MatrixLDU.h + MatrixSolver.h + MaximumIterationError.h + MbDMath.h + MomentOfInertiaSolver.h + Negative.h + NewtonRaphson.h + NewtonRaphsonError.h + NoRotationJoint.h + NotKinematicError.h + Numeric.h + OrbitAngleZIecJec.h + OrbitAngleZIeqcJec.h + OrbitAngleZIeqcJeqc.h + Orientation.h + ParallelAxesJoint.h + Part.h + PartFrame.h + PerpendicularJoint.h + PlanarJoint.h + PointInLineJoint.h + PointInPlaneJoint.h + PosICDragLimitNewtonRaphson.h + PosICDragNewtonRaphson.h + PosICKineNewtonRaphson.h + PosICNewtonRaphson.h + PosKineNewtonRaphson.h + PosNewtonRaphson.h + PosVelAccData.h + Power.h + PrescribedMotion.h + Product.h + QuasiIntegrator.h + RackPinConstraintIJ.h + RackPinConstraintIqcJc.h + RackPinConstraintIqcJqc.h + RackPinJoint.h + Reciprocal.h + RedundantConstraint.h + resource.h + RevCylJoint.h + RevoluteJoint.h + RevRevJoint.h + RotationLimitIJ.h + RowTypeMatrix.h + ScalarNewtonRaphson.h + ScrewConstraintIJ.h + ScrewConstraintIqcJc.h + ScrewConstraintIqcJqc.h + ScrewJoint.h + SimulationStoppingError.h + Sine.h + SingularMatrixError.h + Solver.h + SparseColumn.h + SparseMatrix.h + SparseRow.h + SparseVector.h + SphericalJoint.h + SphSphJoint.h + StableBackwardDifference.h + StateData.h + Sum.h + Symbolic.h + SymbolicParser.h + SyntaxError.h + System.h + SystemNewtonRaphson.h + SystemSolver.h + SymTime.h + TooManyTriesError.h + TooSmallStepSizeError.h + Translation.h + TranslationalJoint.h + TranslationConstraintIJ.h + TranslationConstraintIqcJc.h + TranslationConstraintIqcJqc.h + TranslationConstraintIqctJqc.h + TranslationLimitIJ.h + Units.h + UniversalJoint.h + UserFunction.h + Variable.h + VectorNewtonRaphson.h + VelICKineSolver.h + VelICSolver.h + VelKineSolver.h + VelSolver.h + ZRotation.h + ZTranslation.h +) + +target_sources(OndselSolver PRIVATE + "${ONDSELSOLVER_SRC}" + "${ONDSELSOLVER_HEADERS}") + +set_target_properties(OndselSolver + PROPERTIES VERSION ${PROJECT_VERSION} + SOVERSION 1 + PUBLIC_HEADER "${ONDSELSOLVER_HEADERS}" +) + +if(MSVC) + target_compile_definitions(OndselSolver PRIVATE _USE_MATH_DEFINES) +endif(MSVC) + +configure_file(../OndselSolver.pc.in ${CMAKE_BINARY_DIR}/OndselSolver.pc @ONLY) +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) diff --git a/OndselSolver/CREATE.h b/OndselSolver/CREATE.h index 36b9ce3..22fe226 100644 --- a/OndselSolver/CREATE.h +++ b/OndselSolver/CREATE.h @@ -23,7 +23,7 @@ namespace MbD { template class CREATE { public: - static std::shared_ptr With(const char* name) { + static std::shared_ptr With(const std::string& name) { auto inst = std::make_shared(name); inst->initialize(); return inst; diff --git a/OndselSolver/CartesianFrame.cpp b/OndselSolver/CartesianFrame.cpp index 5762847..dda04e6 100644 --- a/OndselSolver/CartesianFrame.cpp +++ b/OndselSolver/CartesianFrame.cpp @@ -14,7 +14,7 @@ CartesianFrame::CartesianFrame() { } -CartesianFrame::CartesianFrame(const char* str) : Item(str) +CartesianFrame::CartesianFrame(const std::string& str) : Item(str) { } diff --git a/OndselSolver/CartesianFrame.h b/OndselSolver/CartesianFrame.h index d255d10..cedaa49 100644 --- a/OndselSolver/CartesianFrame.h +++ b/OndselSolver/CartesianFrame.h @@ -15,7 +15,7 @@ namespace MbD { { public: CartesianFrame(); - CartesianFrame(const char* str); + CartesianFrame(const std::string& str); void initialize() override; }; } diff --git a/OndselSolver/CompoundJoint.cpp b/OndselSolver/CompoundJoint.cpp index 4df7549..041a0ef 100644 --- a/OndselSolver/CompoundJoint.cpp +++ b/OndselSolver/CompoundJoint.cpp @@ -14,6 +14,6 @@ MbD::CompoundJoint::CompoundJoint() { } -MbD::CompoundJoint::CompoundJoint(const char* str) : Joint(str) +MbD::CompoundJoint::CompoundJoint(const std::string& str) : Joint(str) { } diff --git a/OndselSolver/CompoundJoint.h b/OndselSolver/CompoundJoint.h index 96e49bc..3dc988e 100644 --- a/OndselSolver/CompoundJoint.h +++ b/OndselSolver/CompoundJoint.h @@ -16,7 +16,7 @@ namespace MbD { //distanceIJ public: CompoundJoint(); - CompoundJoint(const char* str); + CompoundJoint(const std::string& str); double distanceIJ = 0.0; }; diff --git a/OndselSolver/ConstantVelocityJoint.cpp b/OndselSolver/ConstantVelocityJoint.cpp index 23363e8..3c2123e 100644 --- a/OndselSolver/ConstantVelocityJoint.cpp +++ b/OndselSolver/ConstantVelocityJoint.cpp @@ -18,7 +18,7 @@ MbD::ConstantVelocityJoint::ConstantVelocityJoint() { } -MbD::ConstantVelocityJoint::ConstantVelocityJoint(const char* str) : AtPointJoint(str) +MbD::ConstantVelocityJoint::ConstantVelocityJoint(const std::string& str) : AtPointJoint(str) { } // diff --git a/OndselSolver/ConstantVelocityJoint.h b/OndselSolver/ConstantVelocityJoint.h index fabe383..a2a1564 100644 --- a/OndselSolver/ConstantVelocityJoint.h +++ b/OndselSolver/ConstantVelocityJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: ConstantVelocityJoint(); - ConstantVelocityJoint(const char* str); + ConstantVelocityJoint(const std::string& str); //void initializeLocally() override; void initializeGlobally() override; void connectsItoJ(EndFrmsptr frmI, EndFrmsptr frmJ) override; diff --git a/OndselSolver/Constraint.cpp b/OndselSolver/Constraint.cpp index 9ce4d86..3b461be 100644 --- a/OndselSolver/Constraint.cpp +++ b/OndselSolver/Constraint.cpp @@ -20,7 +20,7 @@ Constraint::Constraint() : Item() aConstant = 0.0; } -Constraint::Constraint(const char* str) : Item(str) +Constraint::Constraint(const std::string& str) : Item(str) { } diff --git a/OndselSolver/Constraint.h b/OndselSolver/Constraint.h index 9365b0b..119b627 100644 --- a/OndselSolver/Constraint.h +++ b/OndselSolver/Constraint.h @@ -19,7 +19,7 @@ namespace MbD { //iG aG lam mu lamDeriv owner public: Constraint(); - Constraint(const char* str); + Constraint(const std::string& str); void initialize() override; virtual void addToJointForceI(FColDsptr col); diff --git a/OndselSolver/ConstraintSet.cpp b/OndselSolver/ConstraintSet.cpp index c9c6f10..5fad7dc 100644 --- a/OndselSolver/ConstraintSet.cpp +++ b/OndselSolver/ConstraintSet.cpp @@ -11,7 +11,7 @@ MbD::ConstraintSet::ConstraintSet() { } -MbD::ConstraintSet::ConstraintSet(const char* str) : ItemIJ(str) +MbD::ConstraintSet::ConstraintSet(const std::string& str) : ItemIJ(str) { } diff --git a/OndselSolver/ConstraintSet.h b/OndselSolver/ConstraintSet.h index 777ddf6..d75968d 100644 --- a/OndselSolver/ConstraintSet.h +++ b/OndselSolver/ConstraintSet.h @@ -18,7 +18,7 @@ namespace MbD { // public: ConstraintSet(); - ConstraintSet(const char* str); + ConstraintSet(const std::string& str); void constraintsDo(const std::function )>& f); void initialize() override; void initializeGlobally() override; diff --git a/OndselSolver/CylSphJoint.cpp b/OndselSolver/CylSphJoint.cpp index 389cc7d..d4a6b07 100644 --- a/OndselSolver/CylSphJoint.cpp +++ b/OndselSolver/CylSphJoint.cpp @@ -17,7 +17,7 @@ MbD::CylSphJoint::CylSphJoint() { } -MbD::CylSphJoint::CylSphJoint(const char* str) : CompoundJoint(str) +MbD::CylSphJoint::CylSphJoint(const std::string& str) : CompoundJoint(str) { } diff --git a/OndselSolver/CylSphJoint.h b/OndselSolver/CylSphJoint.h index 5c17675..4e9457e 100644 --- a/OndselSolver/CylSphJoint.h +++ b/OndselSolver/CylSphJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: CylSphJoint(); - CylSphJoint(const char* str); + CylSphJoint(const std::string& str); void initializeGlobally() override; diff --git a/OndselSolver/CylindricalJoint.cpp b/OndselSolver/CylindricalJoint.cpp index 8649524..b101bb8 100644 --- a/OndselSolver/CylindricalJoint.cpp +++ b/OndselSolver/CylindricalJoint.cpp @@ -18,7 +18,7 @@ CylindricalJoint::CylindricalJoint() { } -CylindricalJoint::CylindricalJoint(const char* str) : InLineJoint(str) +CylindricalJoint::CylindricalJoint(const std::string& str) : InLineJoint(str) { } diff --git a/OndselSolver/CylindricalJoint.h b/OndselSolver/CylindricalJoint.h index 6c234fb..4601599 100644 --- a/OndselSolver/CylindricalJoint.h +++ b/OndselSolver/CylindricalJoint.h @@ -16,7 +16,7 @@ namespace MbD { //frmI frmJ constraints friction public: CylindricalJoint(); - CylindricalJoint(const char* str); + CylindricalJoint(const std::string& str); void initializeGlobally() override; }; } diff --git a/OndselSolver/EndFramec.cpp b/OndselSolver/EndFramec.cpp index cde2b42..660fb9b 100644 --- a/OndselSolver/EndFramec.cpp +++ b/OndselSolver/EndFramec.cpp @@ -19,7 +19,7 @@ using namespace MbD; EndFramec::EndFramec() { } -EndFramec::EndFramec(const char* str) : CartesianFrame(str) { +EndFramec::EndFramec(const std::string& str) : CartesianFrame(str) { } FMatDsptr MbD::EndFramec::aAeO() diff --git a/OndselSolver/EndFramec.h b/OndselSolver/EndFramec.h index 740150a..f33a5dc 100644 --- a/OndselSolver/EndFramec.h +++ b/OndselSolver/EndFramec.h @@ -23,7 +23,7 @@ namespace MbD { //markerFrame rOeO aAOe public: EndFramec(); - EndFramec(const char* str); + EndFramec(const std::string& str); FMatDsptr aAeO(); System* root() override; diff --git a/OndselSolver/EndFrameqc.cpp b/OndselSolver/EndFrameqc.cpp index 27f79a8..a45f415 100644 --- a/OndselSolver/EndFrameqc.cpp +++ b/OndselSolver/EndFrameqc.cpp @@ -20,7 +20,7 @@ using namespace MbD; EndFrameqc::EndFrameqc() { } -EndFrameqc::EndFrameqc(const char* str) : EndFramec(str) { +EndFrameqc::EndFrameqc(const std::string& str) : EndFramec(str) { } void EndFrameqc::initialize() diff --git a/OndselSolver/EndFrameqc.h b/OndselSolver/EndFrameqc.h index 8447102..7efb62c 100644 --- a/OndselSolver/EndFrameqc.h +++ b/OndselSolver/EndFrameqc.h @@ -21,7 +21,7 @@ namespace MbD { //prOeOpE pprOeOpEpE pAOepE ppAOepEpE public: EndFrameqc(); - EndFrameqc(const char* str); + EndFrameqc(const std::string& str); void initialize() override; void initializeGlobally() override; void initEndFrameqct() override; diff --git a/OndselSolver/EndFrameqct.cpp b/OndselSolver/EndFrameqct.cpp index 23336aa..a898d2e 100644 --- a/OndselSolver/EndFrameqct.cpp +++ b/OndselSolver/EndFrameqct.cpp @@ -10,7 +10,7 @@ #include "MarkerFrame.h" #include "System.h" #include "Symbolic.h" -#include "Time.h" +#include "SymTime.h" #include "EulerParameters.h" #include "CREATE.h" #include "EulerAngleszxz.h" @@ -22,7 +22,7 @@ using namespace MbD; EndFrameqct::EndFrameqct() { } -EndFrameqct::EndFrameqct(const char* str) : EndFrameqc(str) { +EndFrameqct::EndFrameqct(const std::string& str) : EndFrameqc(str) { } void EndFrameqct::initialize() diff --git a/OndselSolver/EndFrameqct.h b/OndselSolver/EndFrameqct.h index 415069e..924a834 100644 --- a/OndselSolver/EndFrameqct.h +++ b/OndselSolver/EndFrameqct.h @@ -21,7 +21,7 @@ namespace MbD { //rmem prmempt pprmemptpt aAme pAmept ppAmeptpt prOeOpt pprOeOpEpt pprOeOptpt pAOept ppAOepEpt ppAOeptpt public: EndFrameqct(); - EndFrameqct(const char* str); + EndFrameqct(const std::string& str); void initialize() override; void initializeLocally() override; void initializeGlobally() override; diff --git a/OndselSolver/EndFrameqct2.cpp b/OndselSolver/EndFrameqct2.cpp index 3f9a86b..e9eb667 100644 --- a/OndselSolver/EndFrameqct2.cpp +++ b/OndselSolver/EndFrameqct2.cpp @@ -10,7 +10,7 @@ #include "MarkerFrame.h" #include "System.h" #include "Symbolic.h" -#include "Time.h" +#include "SymTime.h" #include "EulerParameters.h" #include "CREATE.h" #include "EulerAngleszxz.h" @@ -22,7 +22,7 @@ using namespace MbD; EndFrameqct2::EndFrameqct2() { } -EndFrameqct2::EndFrameqct2(const char* str) : EndFrameqct(str) { +EndFrameqct2::EndFrameqct2(const std::string& str) : EndFrameqct(str) { } void EndFrameqct2::initpPhiThePsiptBlks() diff --git a/OndselSolver/EndFrameqct2.h b/OndselSolver/EndFrameqct2.h index 53c9cd1..9cc2bd4 100644 --- a/OndselSolver/EndFrameqct2.h +++ b/OndselSolver/EndFrameqct2.h @@ -22,7 +22,7 @@ namespace MbD { // public: EndFrameqct2(); - EndFrameqct2(const char* str); + EndFrameqct2(const std::string& str); void initpPhiThePsiptBlks() override; void initppPhiThePsiptptBlks() override; void evalAme() override; diff --git a/OndselSolver/EulerConstraint.cpp b/OndselSolver/EulerConstraint.cpp index bce236b..7ef6b73 100644 --- a/OndselSolver/EulerConstraint.cpp +++ b/OndselSolver/EulerConstraint.cpp @@ -17,7 +17,7 @@ EulerConstraint::EulerConstraint() } -EulerConstraint::EulerConstraint(const char* str) : Constraint(str) +EulerConstraint::EulerConstraint(const std::string& str) : Constraint(str) { } diff --git a/OndselSolver/EulerConstraint.h b/OndselSolver/EulerConstraint.h index c71a021..2e6cdcc 100644 --- a/OndselSolver/EulerConstraint.h +++ b/OndselSolver/EulerConstraint.h @@ -20,7 +20,7 @@ namespace MbD { //pGpE iqE public: EulerConstraint(); - EulerConstraint(const char* str); + EulerConstraint(const std::string& str); void initialize() override; void calcPostDynCorrectorIteration() override; void useEquationNumbers() override; diff --git a/OndselSolver/ExternalSystem.cpp b/OndselSolver/ExternalSystem.cpp index 399b763..690d8f3 100644 --- a/OndselSolver/ExternalSystem.cpp +++ b/OndselSolver/ExternalSystem.cpp @@ -59,7 +59,7 @@ void MbD::ExternalSystem::outputFor(AnalysisType type) } } -void MbD::ExternalSystem::logString(std::string& str) +void MbD::ExternalSystem::logString(const std::string& str) { std::cout << str << std::endl; } diff --git a/OndselSolver/ExternalSystem.h b/OndselSolver/ExternalSystem.h index 65730ec..39d4cad 100644 --- a/OndselSolver/ExternalSystem.h +++ b/OndselSolver/ExternalSystem.h @@ -29,7 +29,7 @@ namespace MbD { void preMbDrunDragStep(std::shared_ptr mbdSys, std::shared_ptr>> dragParts); void updateFromMbD(); void outputFor(AnalysisType type); - void logString(std::string& str); + void logString(const std::string& str); void logString(double value); void runOndselPiston(); void runPiston(); diff --git a/OndselSolver/FixedJoint.cpp b/OndselSolver/FixedJoint.cpp index a193bc1..8a42bb0 100644 --- a/OndselSolver/FixedJoint.cpp +++ b/OndselSolver/FixedJoint.cpp @@ -16,7 +16,7 @@ MbD::FixedJoint::FixedJoint() { } -MbD::FixedJoint::FixedJoint(const char* str) : AtPointJoint(str) +MbD::FixedJoint::FixedJoint(const std::string& str) : AtPointJoint(str) { } diff --git a/OndselSolver/FixedJoint.h b/OndselSolver/FixedJoint.h index 5bd9159..17643b4 100644 --- a/OndselSolver/FixedJoint.h +++ b/OndselSolver/FixedJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: FixedJoint(); - FixedJoint(const char* str); + FixedJoint(const std::string& str); void initializeGlobally() override; diff --git a/OndselSolver/FullMotion.cpp b/OndselSolver/FullMotion.cpp index 71caf9d..a67ca70 100644 --- a/OndselSolver/FullMotion.cpp +++ b/OndselSolver/FullMotion.cpp @@ -16,7 +16,7 @@ MbD::FullMotion::FullMotion() { } -MbD::FullMotion::FullMotion(const char*) +MbD::FullMotion::FullMotion(const std::string&) { } diff --git a/OndselSolver/FullMotion.h b/OndselSolver/FullMotion.h index 1fe9cf3..50ca411 100644 --- a/OndselSolver/FullMotion.h +++ b/OndselSolver/FullMotion.h @@ -19,7 +19,7 @@ namespace MbD { //frIJI fangIJJ public: FullMotion(); - FullMotion(const char* str); + FullMotion(const std::string& str); void connectsItoJ(EndFrmsptr frmI, EndFrmsptr frmJ) override; void initializeGlobally() override; void initMotions() override; diff --git a/OndselSolver/FunctionX.cpp b/OndselSolver/FunctionX.cpp index 461653c..8126c69 100644 --- a/OndselSolver/FunctionX.cpp +++ b/OndselSolver/FunctionX.cpp @@ -26,10 +26,9 @@ void MbD::FunctionX::arguments(Symsptr args) xx = arguments->terms->front(); } -Symsptr MbD::FunctionX::copyWith(Symsptr) +Symsptr MbD::FunctionX::copyWith(Symsptr self) { - assert(false); - return Symsptr(); + return self; } Symsptr MbD::FunctionX::expandUntil(Symsptr sptr, std::shared_ptr> set) diff --git a/OndselSolver/GESpMatParPvPrecise.cpp b/OndselSolver/GESpMatParPvPrecise.cpp index bd10eb1..f2edc56 100644 --- a/OndselSolver/GESpMatParPvPrecise.cpp +++ b/OndselSolver/GESpMatParPvPrecise.cpp @@ -10,6 +10,7 @@ #include "GESpMatParPvPrecise.h" #include "SingularMatrixError.h" +#include "CREATE.h" using namespace MbD; @@ -104,3 +105,22 @@ void GESpMatParPvPrecise::preSolvewithsaveOriginal(SpMatDsptr spMat, FColDsptr f rowOrder->at(i) = i; } } + +void MbD::GESpMatParPvPrecise::runSpMat() +{ + auto spMat = std::make_shared>(3, 3); + spMat->atijput(0, 0, 1.0); + spMat->atijput(0, 1, 1.0); + spMat->atijput(1, 0, 1.0); + spMat->atijput(1, 1, 1.0); + spMat->atijput(1, 2, 1.0); + spMat->atijput(2, 1, 1.0); + spMat->atijput(2, 2, 1.0); + auto fullCol = std::make_shared>(3); + fullCol->atiput(0, 1.0); + fullCol->atiput(1, 2.0); + fullCol->atiput(2, 3.0); + auto matSolver = CREATE::With(); + auto answer = matSolver->solvewithsaveOriginal(spMat, fullCol, true); + auto aAx = spMat->timesFullColumn(answer); +} diff --git a/OndselSolver/GESpMatParPvPrecise.h b/OndselSolver/GESpMatParPvPrecise.h index 17db611..9c9172e 100644 --- a/OndselSolver/GESpMatParPvPrecise.h +++ b/OndselSolver/GESpMatParPvPrecise.h @@ -17,6 +17,7 @@ namespace MbD { public: void doPivoting(size_t p) override; void preSolvewithsaveOriginal(SpMatDsptr spMat, FColDsptr fullCol, bool saveOriginal) override; + static void runSpMat(); }; } diff --git a/OndselSolver/GearJoint.cpp b/OndselSolver/GearJoint.cpp index 687a3fb..1e3a855 100644 --- a/OndselSolver/GearJoint.cpp +++ b/OndselSolver/GearJoint.cpp @@ -17,7 +17,7 @@ MbD::GearJoint::GearJoint() { } -MbD::GearJoint::GearJoint(const char*) +MbD::GearJoint::GearJoint(const std::string&) { } // diff --git a/OndselSolver/GearJoint.h b/OndselSolver/GearJoint.h index cbf285e..ffedb6d 100644 --- a/OndselSolver/GearJoint.h +++ b/OndselSolver/GearJoint.h @@ -16,7 +16,7 @@ namespace MbD { //radiusI radiusJ aConstant public: GearJoint(); - GearJoint(const char* str); + GearJoint(const std::string& str); //void initializeLocally() override; void initializeGlobally() override; diff --git a/OndselSolver/ICKineIntegrator.cpp b/OndselSolver/ICKineIntegrator.cpp index 037b025..1fdfcd4 100644 --- a/OndselSolver/ICKineIntegrator.cpp +++ b/OndselSolver/ICKineIntegrator.cpp @@ -30,7 +30,7 @@ void ICKineIntegrator::selectOrder() void ICKineIntegrator::preRun() { - system->Solver::logString("MbD: Starting quasi kinematic analysis."); + system->logString("MbD: Starting quasi kinematic analysis."); QuasiIntegrator::preRun(); } diff --git a/OndselSolver/InLineJoint.cpp b/OndselSolver/InLineJoint.cpp index 31f9fab..c30396b 100644 --- a/OndselSolver/InLineJoint.cpp +++ b/OndselSolver/InLineJoint.cpp @@ -13,7 +13,7 @@ MbD::InLineJoint::InLineJoint() { } -MbD::InLineJoint::InLineJoint(const char*) +MbD::InLineJoint::InLineJoint(const std::string&) { } diff --git a/OndselSolver/InLineJoint.h b/OndselSolver/InLineJoint.h index 334b449..e8957d7 100644 --- a/OndselSolver/InLineJoint.h +++ b/OndselSolver/InLineJoint.h @@ -16,7 +16,7 @@ namespace MbD { //Abstract class. Create subclasses only. public: InLineJoint(); - InLineJoint(const char* str); + InLineJoint(const std::string& str); virtual void initializeGlobally() = 0; //To prevent instantiation of this class void createInLineConstraints(); diff --git a/OndselSolver/InPlaneJoint.cpp b/OndselSolver/InPlaneJoint.cpp index 0105a93..7c7feba 100644 --- a/OndselSolver/InPlaneJoint.cpp +++ b/OndselSolver/InPlaneJoint.cpp @@ -13,7 +13,7 @@ MbD::InPlaneJoint::InPlaneJoint() { } -MbD::InPlaneJoint::InPlaneJoint(const char*) +MbD::InPlaneJoint::InPlaneJoint(const std::string&) { } diff --git a/OndselSolver/InPlaneJoint.h b/OndselSolver/InPlaneJoint.h index a85ffa6..70a9e80 100644 --- a/OndselSolver/InPlaneJoint.h +++ b/OndselSolver/InPlaneJoint.h @@ -16,7 +16,7 @@ namespace MbD { //offset public: InPlaneJoint(); - InPlaneJoint(const char* str); + InPlaneJoint(const std::string& str); virtual void initializeGlobally() = 0; //To prevent instantiation of this class void createInPlaneConstraint(); diff --git a/OndselSolver/IntegratorInterface.cpp b/OndselSolver/IntegratorInterface.cpp index c7727e8..af6b3a0 100644 --- a/OndselSolver/IntegratorInterface.cpp +++ b/OndselSolver/IntegratorInterface.cpp @@ -30,7 +30,7 @@ void IntegratorInterface::setSystem(Solver* sys) system = static_cast(sys); } -void IntegratorInterface::logString(std::string& str) +void IntegratorInterface::logString(const std::string& str) { system->logString(str); } diff --git a/OndselSolver/IntegratorInterface.h b/OndselSolver/IntegratorInterface.h index a7f33c7..77a801f 100644 --- a/OndselSolver/IntegratorInterface.h +++ b/OndselSolver/IntegratorInterface.h @@ -24,7 +24,7 @@ namespace MbD { virtual void checkForDiscontinuity() = 0; void setSystem(Solver* sys) override; - void logString(std::string& str) override; + void logString(const std::string& str) override; void run() override; size_t orderMax(); virtual void incrementTime(double tnew); diff --git a/OndselSolver/Item.cpp b/OndselSolver/Item.cpp index 67713bc..4435d5d 100644 --- a/OndselSolver/Item.cpp +++ b/OndselSolver/Item.cpp @@ -24,7 +24,7 @@ Item::Item() { name = std::to_string(nanoseconds); } -Item::Item(const char* str) : name(str) +Item::Item(const std::string& str) : name(str) { } @@ -377,11 +377,6 @@ void Item::fillVelICJacob(SpMatDsptr) { } -void MbD::Item::getString(std::string) -{ - assert(false); -} - void Item::setqsudotlam(FColDsptr) { } @@ -549,23 +544,17 @@ void Item::useEquationNumbers() { } -void Item::logString(std::string& str) +void Item::logString(const std::string& str) { this->root()->logString(str); } -void Item::logString(const char* chars) -{ - std::string str = chars; - this->logString(str); -} - -void MbD::Item::logStringwithArgument(const char*, const char*) +void MbD::Item::logStringwithArgument(const std::string&, const std::string&) { assert(false); } -void MbD::Item::logStringwithArguments(const char*, std::shared_ptr>) +void MbD::Item::logStringwithArguments(const std::string&, std::shared_ptr>) { assert(false); } diff --git a/OndselSolver/Item.h b/OndselSolver/Item.h index 4ef7158..ff6e50e 100644 --- a/OndselSolver/Item.h +++ b/OndselSolver/Item.h @@ -27,7 +27,7 @@ namespace MbD { //name public: Item(); - Item(const char* str); + Item(const std::string& str); virtual ~Item() {} virtual System* root(); void noop(); @@ -73,7 +73,6 @@ namespace MbD { virtual void fillStaticJacob(FMatDsptr mat); virtual void fillVelICError(FColDsptr col); virtual void fillVelICJacob(SpMatDsptr mat); - virtual void getString(std::string str); virtual void initialize(); virtual void initializeGlobally(); virtual void initializeLocally(); @@ -81,10 +80,9 @@ namespace MbD { virtual bool isJointTorque(); virtual bool isKinedotIJ(); virtual bool isKineIJ(); - virtual void logString(std::string& str); - void logString(const char* chars); - virtual void logStringwithArgument(const char* chars, const char* chars1); - virtual void logStringwithArguments(const char* chars, std::shared_ptr> arrayOfChars); + virtual void logString(const std::string& str); + virtual void logStringwithArgument(const std::string& chars, const std::string& chars1); + virtual void logStringwithArguments(const std::string& chars, std::shared_ptr> arrayOfChars); virtual void normalImpulse(double imp); virtual void postAccIC(); virtual void postAccICIteration(); diff --git a/OndselSolver/ItemIJ.cpp b/OndselSolver/ItemIJ.cpp index ce5e8f2..5008085 100644 --- a/OndselSolver/ItemIJ.cpp +++ b/OndselSolver/ItemIJ.cpp @@ -6,7 +6,7 @@ MbD::ItemIJ::ItemIJ() { } -MbD::ItemIJ::ItemIJ(const char* str) : Item(str) +MbD::ItemIJ::ItemIJ(const std::string& str) : Item(str) { } diff --git a/OndselSolver/ItemIJ.h b/OndselSolver/ItemIJ.h index 9f3fd5d..64819af 100644 --- a/OndselSolver/ItemIJ.h +++ b/OndselSolver/ItemIJ.h @@ -19,7 +19,7 @@ namespace MbD { // public: ItemIJ(); - ItemIJ(const char* str); + ItemIJ(const std::string& str); ItemIJ(EndFrmsptr frmi, EndFrmsptr frmj); virtual void connectsItoJ(EndFrmsptr frmI, EndFrmsptr frmJ); diff --git a/OndselSolver/Joint.cpp b/OndselSolver/Joint.cpp index 786c195..80de74f 100644 --- a/OndselSolver/Joint.cpp +++ b/OndselSolver/Joint.cpp @@ -26,7 +26,7 @@ Joint::Joint() { } -Joint::Joint(const char* str) : ConstraintSet(str) { +Joint::Joint(const std::string& str) : ConstraintSet(str) { } diff --git a/OndselSolver/Joint.h b/OndselSolver/Joint.h index b0b425c..765430c 100644 --- a/OndselSolver/Joint.h +++ b/OndselSolver/Joint.h @@ -24,7 +24,7 @@ namespace MbD { //frmI frmJ constraints friction public: Joint(); - Joint(const char* str); + Joint(const std::string& str); virtual ~Joint() {} void initializeLocally() override; diff --git a/OndselSolver/KineIntegrator.cpp b/OndselSolver/KineIntegrator.cpp index 072cac1..709d8b1 100644 --- a/OndselSolver/KineIntegrator.cpp +++ b/OndselSolver/KineIntegrator.cpp @@ -16,7 +16,7 @@ using namespace MbD; void KineIntegrator::preRun() { - system->Solver::logString("MbD: Starting kinematic analysis."); + system->logString("MbD: Starting kinematic analysis."); QuasiIntegrator::preRun(); } diff --git a/OndselSolver/LineInPlaneJoint.cpp b/OndselSolver/LineInPlaneJoint.cpp index a6c71e6..5cf740e 100644 --- a/OndselSolver/LineInPlaneJoint.cpp +++ b/OndselSolver/LineInPlaneJoint.cpp @@ -16,7 +16,7 @@ MbD::LineInPlaneJoint::LineInPlaneJoint() { } -MbD::LineInPlaneJoint::LineInPlaneJoint(const char*) +MbD::LineInPlaneJoint::LineInPlaneJoint(const std::string&) { } diff --git a/OndselSolver/LineInPlaneJoint.h b/OndselSolver/LineInPlaneJoint.h index cb03d20..1c24358 100644 --- a/OndselSolver/LineInPlaneJoint.h +++ b/OndselSolver/LineInPlaneJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: LineInPlaneJoint(); - LineInPlaneJoint(const char* str); + LineInPlaneJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/MarkerFrame.cpp b/OndselSolver/MarkerFrame.cpp index ad39e72..c0a2d19 100644 --- a/OndselSolver/MarkerFrame.cpp +++ b/OndselSolver/MarkerFrame.cpp @@ -21,7 +21,7 @@ MarkerFrame::MarkerFrame() { } -MarkerFrame::MarkerFrame(const char* str) : CartesianFrame(str) { +MarkerFrame::MarkerFrame(const std::string& str) : CartesianFrame(str) { } System* MarkerFrame::root() diff --git a/OndselSolver/MarkerFrame.h b/OndselSolver/MarkerFrame.h index 9b253a6..779e445 100644 --- a/OndselSolver/MarkerFrame.h +++ b/OndselSolver/MarkerFrame.h @@ -28,7 +28,7 @@ namespace MbD { //partFrame rpmp aApm rOmO aAOm prOmOpE pAOmpE pprOmOpEpE ppAOmpEpE endFrames public: MarkerFrame(); - MarkerFrame(const char* str); + MarkerFrame(const std::string& str); System* root() override; void initialize() override; void setPartFrame(PartFrame* partFrm); diff --git a/OndselSolver/MatrixSolver.cpp b/OndselSolver/MatrixSolver.cpp index f21b560..0dec2a4 100644 --- a/OndselSolver/MatrixSolver.cpp +++ b/OndselSolver/MatrixSolver.cpp @@ -70,12 +70,12 @@ void MatrixSolver::findScalingsForRowRange(size_t begin, size_t end) } } -void MatrixSolver::throwSingularMatrixError(const char* chars) +void MatrixSolver::throwSingularMatrixError(const std::string& chars) { throw SingularMatrixError(chars); } -void MatrixSolver::throwSingularMatrixError(const char* chars, std::shared_ptr> redunEqnNos) +void MatrixSolver::throwSingularMatrixError(const std::string& chars, std::shared_ptr> redunEqnNos) { throw SingularMatrixError(chars, redunEqnNos); } diff --git a/OndselSolver/MatrixSolver.h b/OndselSolver/MatrixSolver.h index 75df028..39e4be4 100644 --- a/OndselSolver/MatrixSolver.h +++ b/OndselSolver/MatrixSolver.h @@ -40,8 +40,8 @@ namespace MbD { virtual void postSolve() = 0; virtual void findScalingsForRowRange(size_t begin, size_t end); virtual double getmatrixArowimaxMagnitude(size_t i) = 0; - void throwSingularMatrixError(const char* chars); - void throwSingularMatrixError(const char* chars, std::shared_ptr> redunEqnNos); + void throwSingularMatrixError(const std::string& chars); + void throwSingularMatrixError(const std::string& chars, std::shared_ptr> redunEqnNos); size_t m = 0, n = 0; FColDsptr answerX, rightHandSideB, rowScalings, pivotValues; diff --git a/OndselSolver/NoRotationJoint.cpp b/OndselSolver/NoRotationJoint.cpp index d55f8e4..d611b3e 100644 --- a/OndselSolver/NoRotationJoint.cpp +++ b/OndselSolver/NoRotationJoint.cpp @@ -17,7 +17,7 @@ MbD::NoRotationJoint::NoRotationJoint() { } -MbD::NoRotationJoint::NoRotationJoint(const char*) +MbD::NoRotationJoint::NoRotationJoint(const std::string&) { } diff --git a/OndselSolver/NoRotationJoint.h b/OndselSolver/NoRotationJoint.h index 8146e90..514d2d7 100644 --- a/OndselSolver/NoRotationJoint.h +++ b/OndselSolver/NoRotationJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: NoRotationJoint(); - NoRotationJoint(const char* str); + NoRotationJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/Orientation.cpp b/OndselSolver/Orientation.cpp index 0dfdea4..89dda45 100644 --- a/OndselSolver/Orientation.cpp +++ b/OndselSolver/Orientation.cpp @@ -16,7 +16,7 @@ MbD::Orientation::Orientation() { } -MbD::Orientation::Orientation(const char*) +MbD::Orientation::Orientation(const std::string&) { } diff --git a/OndselSolver/Orientation.h b/OndselSolver/Orientation.h index bc6566d..3e30b61 100644 --- a/OndselSolver/Orientation.h +++ b/OndselSolver/Orientation.h @@ -16,7 +16,7 @@ namespace MbD { // public: Orientation(); - Orientation(const char* str); + Orientation(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/ParallelAxesJoint.cpp b/OndselSolver/ParallelAxesJoint.cpp index 380c0f3..81d4964 100644 --- a/OndselSolver/ParallelAxesJoint.cpp +++ b/OndselSolver/ParallelAxesJoint.cpp @@ -16,7 +16,7 @@ MbD::ParallelAxesJoint::ParallelAxesJoint() { } -MbD::ParallelAxesJoint::ParallelAxesJoint(const char*) +MbD::ParallelAxesJoint::ParallelAxesJoint(const std::string&) { } diff --git a/OndselSolver/ParallelAxesJoint.h b/OndselSolver/ParallelAxesJoint.h index 4e927ee..dc61a8a 100644 --- a/OndselSolver/ParallelAxesJoint.h +++ b/OndselSolver/ParallelAxesJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: ParallelAxesJoint(); - ParallelAxesJoint(const char* str); + ParallelAxesJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/Part.cpp b/OndselSolver/Part.cpp index 2b19cf0..380dbdd 100644 --- a/OndselSolver/Part.cpp +++ b/OndselSolver/Part.cpp @@ -22,7 +22,7 @@ using namespace MbD; Part::Part() { } -Part::Part(const char* str) : Item(str) { +Part::Part(const std::string& str) : Item(str) { } System* MbD::Part::root() diff --git a/OndselSolver/Part.h b/OndselSolver/Part.h index 35f57c1..610ef7a 100644 --- a/OndselSolver/Part.h +++ b/OndselSolver/Part.h @@ -22,7 +22,7 @@ namespace MbD { //ToDo: ipX ipE m aJ partFrame pX pXdot pE pEdot mX mE mEdot pTpE ppTpEpE ppTpEpEdot public: Part(); - Part(const char* str); + Part(const std::string& str); System* root() override; void initialize() override; void initializeLocally() override; diff --git a/OndselSolver/PartFrame.cpp b/OndselSolver/PartFrame.cpp index 35e9185..a641604 100644 --- a/OndselSolver/PartFrame.cpp +++ b/OndselSolver/PartFrame.cpp @@ -24,7 +24,7 @@ using namespace MbD; PartFrame::PartFrame() { } -PartFrame::PartFrame(const char* str) : CartesianFrame(str) +PartFrame::PartFrame(const std::string& str) : CartesianFrame(str) { } System* PartFrame::root() @@ -127,7 +127,7 @@ void PartFrame::addMarkerFrame(std::shared_ptr markerFrame) markerFrames->push_back(markerFrame); } -EndFrmsptr PartFrame::endFrame(std::string name) +EndFrmsptr PartFrame::endFrame(const std::string& name) { auto match = std::find_if(markerFrames->begin(), markerFrames->end(), [&](auto& mkr) {return mkr->name == name; }); return (*match)->endFrames->at(0); diff --git a/OndselSolver/PartFrame.h b/OndselSolver/PartFrame.h index 61c19bd..12c41ab 100644 --- a/OndselSolver/PartFrame.h +++ b/OndselSolver/PartFrame.h @@ -30,7 +30,7 @@ namespace MbD { //ToDo: part iqX iqE qX qE qXdot qEdot qXddot qEddot aGeu aGabs markerFrames public: PartFrame(); - PartFrame(const char* str); + PartFrame(const std::string& str); System* root() override; void initialize() override; void initializeLocally() override; @@ -57,7 +57,7 @@ namespace MbD { void setPart(Part* x); Part* getPart(); void addMarkerFrame(std::shared_ptr x); - EndFrmsptr endFrame(std::string name); + EndFrmsptr endFrame(const std::string& name); void aGabsDo(const std::function )>& f); void markerFramesDo(const std::function )>& f); void removeRedundantConstraints(std::shared_ptr> redundantEqnNos) override; diff --git a/OndselSolver/PerpendicularJoint.cpp b/OndselSolver/PerpendicularJoint.cpp index a8c30ab..b3eb9f4 100644 --- a/OndselSolver/PerpendicularJoint.cpp +++ b/OndselSolver/PerpendicularJoint.cpp @@ -16,7 +16,7 @@ MbD::PerpendicularJoint::PerpendicularJoint() { } -MbD::PerpendicularJoint::PerpendicularJoint(const char*) +MbD::PerpendicularJoint::PerpendicularJoint(const std::string&) { } diff --git a/OndselSolver/PerpendicularJoint.h b/OndselSolver/PerpendicularJoint.h index 9783d02..b58bfe3 100644 --- a/OndselSolver/PerpendicularJoint.h +++ b/OndselSolver/PerpendicularJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: PerpendicularJoint(); - PerpendicularJoint(const char* str); + PerpendicularJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/PlanarJoint.cpp b/OndselSolver/PlanarJoint.cpp index a79fcfa..85d9de4 100644 --- a/OndselSolver/PlanarJoint.cpp +++ b/OndselSolver/PlanarJoint.cpp @@ -16,7 +16,7 @@ MbD::PlanarJoint::PlanarJoint() { } -MbD::PlanarJoint::PlanarJoint(const char*) +MbD::PlanarJoint::PlanarJoint(const std::string&) { } diff --git a/OndselSolver/PlanarJoint.h b/OndselSolver/PlanarJoint.h index 2a398ad..e2a7a5f 100644 --- a/OndselSolver/PlanarJoint.h +++ b/OndselSolver/PlanarJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: PlanarJoint(); - PlanarJoint(const char* str); + PlanarJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/PointInLineJoint.cpp b/OndselSolver/PointInLineJoint.cpp index 9ecafae..c8dedf8 100644 --- a/OndselSolver/PointInLineJoint.cpp +++ b/OndselSolver/PointInLineJoint.cpp @@ -16,7 +16,7 @@ MbD::PointInLineJoint::PointInLineJoint() { } -MbD::PointInLineJoint::PointInLineJoint(const char* str) : InLineJoint(str) +MbD::PointInLineJoint::PointInLineJoint(const std::string& str) : InLineJoint(str) { } diff --git a/OndselSolver/PointInLineJoint.h b/OndselSolver/PointInLineJoint.h index 76331b4..8de8f5b 100644 --- a/OndselSolver/PointInLineJoint.h +++ b/OndselSolver/PointInLineJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: PointInLineJoint(); - PointInLineJoint(const char* str); + PointInLineJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/PointInPlaneJoint.cpp b/OndselSolver/PointInPlaneJoint.cpp index 992db5a..81009d5 100644 --- a/OndselSolver/PointInPlaneJoint.cpp +++ b/OndselSolver/PointInPlaneJoint.cpp @@ -15,7 +15,7 @@ MbD::PointInPlaneJoint::PointInPlaneJoint() { } -MbD::PointInPlaneJoint::PointInPlaneJoint(const char*) +MbD::PointInPlaneJoint::PointInPlaneJoint(const std::string&) { } diff --git a/OndselSolver/PointInPlaneJoint.h b/OndselSolver/PointInPlaneJoint.h index 07925b2..0a06e02 100644 --- a/OndselSolver/PointInPlaneJoint.h +++ b/OndselSolver/PointInPlaneJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: PointInPlaneJoint(); - PointInPlaneJoint(const char* str); + PointInPlaneJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/PosICKineNewtonRaphson.cpp b/OndselSolver/PosICKineNewtonRaphson.cpp index c7c8569..33097bc 100644 --- a/OndselSolver/PosICKineNewtonRaphson.cpp +++ b/OndselSolver/PosICKineNewtonRaphson.cpp @@ -22,6 +22,6 @@ void PosICKineNewtonRaphson::initializeGlobally() void MbD::PosICKineNewtonRaphson::preRun() { - system->Solver::logString("MbD: Solving for quasi kinematic position."); + system->logString("MbD: Solving for quasi kinematic position."); PosNewtonRaphson::preRun(); } diff --git a/OndselSolver/PrescribedMotion.cpp b/OndselSolver/PrescribedMotion.cpp index 8c0c122..2bf43f1 100644 --- a/OndselSolver/PrescribedMotion.cpp +++ b/OndselSolver/PrescribedMotion.cpp @@ -21,7 +21,7 @@ PrescribedMotion::PrescribedMotion() { } -PrescribedMotion::PrescribedMotion(const char* str) : Joint(str) { +PrescribedMotion::PrescribedMotion(const std::string& str) : Joint(str) { } diff --git a/OndselSolver/PrescribedMotion.h b/OndselSolver/PrescribedMotion.h index bc0c828..a4f083f 100644 --- a/OndselSolver/PrescribedMotion.h +++ b/OndselSolver/PrescribedMotion.h @@ -21,7 +21,7 @@ namespace MbD { //xBlk yBlk zBlk phiBlk theBlk psiBlk public: PrescribedMotion(); - PrescribedMotion(const char* str); + PrescribedMotion(const std::string& str); void connectsItoJ(EndFrmsptr frmI, EndFrmsptr frmJ) override; void initialize() override; diff --git a/OndselSolver/QuasiIntegrator.cpp b/OndselSolver/QuasiIntegrator.cpp index cd63811..9b8d7c0 100644 --- a/OndselSolver/QuasiIntegrator.cpp +++ b/OndselSolver/QuasiIntegrator.cpp @@ -152,7 +152,7 @@ double QuasiIntegrator::suggestSmallerOrAcceptStepSize(double hnew) system->partsJointsMotionsLimitsForcesTorquesDo([&](std::shared_ptr item) { hnew2 = item->suggestSmallerOrAcceptDynStepSize(hnew2); }); if (hnew2 > hmax) { hnew2 = hmax; - this->Solver::logString("StM: Step size is at user specified maximum."); + this->logString("StM: Step size is at user specified maximum."); } if (hnew2 < hmin) { std::stringstream ss; @@ -170,7 +170,7 @@ void QuasiIntegrator::incrementTime(double tnew) IntegratorInterface::incrementTime(tnew); } -void QuasiIntegrator::throwDiscontinuityError(const char* chars, std::shared_ptr> discontinuityTypes) +void QuasiIntegrator::throwDiscontinuityError(const std::string& chars, std::shared_ptr> discontinuityTypes) { throw DiscontinuityError(chars, discontinuityTypes); } diff --git a/OndselSolver/QuasiIntegrator.h b/OndselSolver/QuasiIntegrator.h index 12a1830..17a51c4 100644 --- a/OndselSolver/QuasiIntegrator.h +++ b/OndselSolver/QuasiIntegrator.h @@ -28,7 +28,7 @@ namespace MbD { double suggestSmallerOrAcceptFirstStepSize(double hnew) override; double suggestSmallerOrAcceptStepSize(double hnew) override; void incrementTime(double tnew) override; - void throwDiscontinuityError(const char* chars, std::shared_ptr> discontinuityTypes); + void throwDiscontinuityError(const std::string& chars, std::shared_ptr> discontinuityTypes); void checkForOutputThrough(double t) override; void interpolateAt(double t) override; void postStep() override; diff --git a/OndselSolver/RackPinJoint.cpp b/OndselSolver/RackPinJoint.cpp index f196527..a596ce5 100644 --- a/OndselSolver/RackPinJoint.cpp +++ b/OndselSolver/RackPinJoint.cpp @@ -17,7 +17,7 @@ MbD::RackPinJoint::RackPinJoint() { } -MbD::RackPinJoint::RackPinJoint(const char* str) : Joint(str) +MbD::RackPinJoint::RackPinJoint(const std::string& str) : Joint(str) { } // diff --git a/OndselSolver/RackPinJoint.h b/OndselSolver/RackPinJoint.h index 21fdbe4..ac657ef 100644 --- a/OndselSolver/RackPinJoint.h +++ b/OndselSolver/RackPinJoint.h @@ -16,7 +16,7 @@ namespace MbD { //pitchRadius aConstant public: RackPinJoint(); - RackPinJoint(const char* str); + RackPinJoint(const std::string& str); //void initializeLocally() override; void initializeGlobally() override; void connectsItoJ(EndFrmsptr frmI, EndFrmsptr frmJ) override; diff --git a/OndselSolver/RevCylJoint.cpp b/OndselSolver/RevCylJoint.cpp index 2ed1f2b..01eb3e5 100644 --- a/OndselSolver/RevCylJoint.cpp +++ b/OndselSolver/RevCylJoint.cpp @@ -17,7 +17,7 @@ MbD::RevCylJoint::RevCylJoint() { } -MbD::RevCylJoint::RevCylJoint(const char* str) : CompoundJoint(str) +MbD::RevCylJoint::RevCylJoint(const std::string& str) : CompoundJoint(str) { } diff --git a/OndselSolver/RevCylJoint.h b/OndselSolver/RevCylJoint.h index 384e358..3963b91 100644 --- a/OndselSolver/RevCylJoint.h +++ b/OndselSolver/RevCylJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: RevCylJoint(); - RevCylJoint(const char* str); + RevCylJoint(const std::string& str); void initializeGlobally() override; diff --git a/OndselSolver/RevRevJoint.cpp b/OndselSolver/RevRevJoint.cpp index 362e0e8..53c5b68 100644 --- a/OndselSolver/RevRevJoint.cpp +++ b/OndselSolver/RevRevJoint.cpp @@ -17,7 +17,7 @@ MbD::RevRevJoint::RevRevJoint() { } -MbD::RevRevJoint::RevRevJoint(const char* str) : CompoundJoint(str) +MbD::RevRevJoint::RevRevJoint(const std::string& str) : CompoundJoint(str) { } diff --git a/OndselSolver/RevRevJoint.h b/OndselSolver/RevRevJoint.h index 6a024dc..b5bf71e 100644 --- a/OndselSolver/RevRevJoint.h +++ b/OndselSolver/RevRevJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: RevRevJoint(); - RevRevJoint(const char* str); + RevRevJoint(const std::string& str); void initializeGlobally() override; diff --git a/OndselSolver/RevoluteJoint.cpp b/OndselSolver/RevoluteJoint.cpp index 06a058b..190737e 100644 --- a/OndselSolver/RevoluteJoint.cpp +++ b/OndselSolver/RevoluteJoint.cpp @@ -18,7 +18,7 @@ RevoluteJoint::RevoluteJoint() { } -RevoluteJoint::RevoluteJoint(const char* str) : AtPointJoint(str) +RevoluteJoint::RevoluteJoint(const std::string& str) : AtPointJoint(str) { } diff --git a/OndselSolver/RevoluteJoint.h b/OndselSolver/RevoluteJoint.h index f3895f3..410a33e 100644 --- a/OndselSolver/RevoluteJoint.h +++ b/OndselSolver/RevoluteJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: RevoluteJoint(); - RevoluteJoint(const char* str); + RevoluteJoint(const std::string& str); void initializeGlobally() override; }; } diff --git a/OndselSolver/ScrewJoint.cpp b/OndselSolver/ScrewJoint.cpp index 5b22b5d..18f1136 100644 --- a/OndselSolver/ScrewJoint.cpp +++ b/OndselSolver/ScrewJoint.cpp @@ -17,7 +17,7 @@ MbD::ScrewJoint::ScrewJoint() { } -MbD::ScrewJoint::ScrewJoint(const char* str) : Joint(str) +MbD::ScrewJoint::ScrewJoint(const std::string& str) : Joint(str) { } // diff --git a/OndselSolver/ScrewJoint.h b/OndselSolver/ScrewJoint.h index 17ee8c1..960b4fd 100644 --- a/OndselSolver/ScrewJoint.h +++ b/OndselSolver/ScrewJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: ScrewJoint(); - ScrewJoint(const char* str); + ScrewJoint(const std::string& str); //void initializeLocally() override; void initializeGlobally() override; void connectsItoJ(EndFrmsptr frmI, EndFrmsptr frmJ) override; diff --git a/OndselSolver/Solver.cpp b/OndselSolver/Solver.cpp index e66aa7d..9c9e5de 100644 --- a/OndselSolver/Solver.cpp +++ b/OndselSolver/Solver.cpp @@ -59,17 +59,11 @@ void Solver::postRun() assert(false); } -void Solver::logString(std::string&) +void Solver::logString(const std::string&) { assert(false); } -void Solver::logString(const char* chars) -{ - std::string str = chars; - this->logString(str); -} - void MbD::Solver::handleSingularMatrix() { assert(false); diff --git a/OndselSolver/Solver.h b/OndselSolver/Solver.h index 4f679f7..126b46f 100644 --- a/OndselSolver/Solver.h +++ b/OndselSolver/Solver.h @@ -27,8 +27,7 @@ namespace MbD { virtual void finalize(); virtual void reportStats(); virtual void postRun(); - virtual void logString(std::string& str); - void logString(const char* chars); + virtual void logString(const std::string& str); virtual void setSystem(Solver* sys) = 0; virtual void handleSingularMatrix(); diff --git a/OndselSolver/SparseMatrix.h b/OndselSolver/SparseMatrix.h index d385104..d8ee513 100644 --- a/OndselSolver/SparseMatrix.h +++ b/OndselSolver/SparseMatrix.h @@ -18,9 +18,10 @@ namespace MbD { template class SparseMatrix; + using SpMatDsptr = std::shared_ptr>; template using SpMatsptr = std::shared_ptr>; - using SpMatDsptr = std::shared_ptr>; + class GESpMatParPvPrecise; template class SparseMatrix : public RowTypeMatrix> diff --git a/OndselSolver/SphSphJoint.cpp b/OndselSolver/SphSphJoint.cpp index e4d32f7..520a972 100644 --- a/OndselSolver/SphSphJoint.cpp +++ b/OndselSolver/SphSphJoint.cpp @@ -17,7 +17,7 @@ MbD::SphSphJoint::SphSphJoint() { } -MbD::SphSphJoint::SphSphJoint(const char* str) : CompoundJoint(str) +MbD::SphSphJoint::SphSphJoint(const std::string& str) : CompoundJoint(str) { } diff --git a/OndselSolver/SphSphJoint.h b/OndselSolver/SphSphJoint.h index 608fcd4..108e7fd 100644 --- a/OndselSolver/SphSphJoint.h +++ b/OndselSolver/SphSphJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: SphSphJoint(); - SphSphJoint(const char* str); + SphSphJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/SphericalJoint.cpp b/OndselSolver/SphericalJoint.cpp index e15bca9..c1d4544 100644 --- a/OndselSolver/SphericalJoint.cpp +++ b/OndselSolver/SphericalJoint.cpp @@ -16,7 +16,7 @@ MbD::SphericalJoint::SphericalJoint() { } -MbD::SphericalJoint::SphericalJoint(const char* str) : AtPointJoint(str) +MbD::SphericalJoint::SphericalJoint(const std::string& str) : AtPointJoint(str) { } diff --git a/OndselSolver/SphericalJoint.h b/OndselSolver/SphericalJoint.h index 44b597c..6209599 100644 --- a/OndselSolver/SphericalJoint.h +++ b/OndselSolver/SphericalJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: SphericalJoint(); - SphericalJoint(const char* str); + SphericalJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/Sum.cpp b/OndselSolver/Sum.cpp index 85520a2..d6b320e 100644 --- a/OndselSolver/Sum.cpp +++ b/OndselSolver/Sum.cpp @@ -16,7 +16,7 @@ using namespace MbD; -Symsptr MbD::Sum::parseExpression(std::string& expression) +Symsptr MbD::Sum::parseExpression(const std::string& expression) { std::istringstream iss(expression); auto sum = std::make_shared(); diff --git a/OndselSolver/Sum.h b/OndselSolver/Sum.h index 49b168e..893741c 100644 --- a/OndselSolver/Sum.h +++ b/OndselSolver/Sum.h @@ -14,7 +14,7 @@ namespace MbD { class Sum : public FunctionWithManyArgs { public: - static Symsptr parseExpression(std::string& expression); + static Symsptr parseExpression(const std::string& expression); void parse(std::istringstream& iss); void parseTerm(std::istringstream& iss); void parsePlusTerm(std::istringstream& iss); diff --git a/OndselSolver/Time.h b/OndselSolver/SymTime.h similarity index 100% rename from OndselSolver/Time.h rename to OndselSolver/SymTime.h diff --git a/OndselSolver/SymbolicParser.cpp b/OndselSolver/SymbolicParser.cpp index 0aacf4a..63fb2b5 100644 --- a/OndselSolver/SymbolicParser.cpp +++ b/OndselSolver/SymbolicParser.cpp @@ -57,7 +57,7 @@ void MbD::SymbolicParser::parseUserFunction(Symsptr userFunc) stack->push(Symbolic::times(func, std::make_shared(usrFunc->myUnit))); } -void MbD::SymbolicParser::parseString(std::string expr) +void MbD::SymbolicParser::parseString(const std::string& expr) { buffer->clear(); while (!stack->empty()) { @@ -179,7 +179,7 @@ bool MbD::SymbolicParser::divideByFunction() return false; } -bool MbD::SymbolicParser::peekForTypeNoPush(std::string c) +bool MbD::SymbolicParser::peekForTypeNoPush(const std::string& c) { //"Test to see if tokenType matches aType. If so, advance to the next token, leaving the stack unchanged" @@ -440,7 +440,7 @@ bool MbD::SymbolicParser::raisedTo() return false; } -bool MbD::SymbolicParser::expected(std::string) +bool MbD::SymbolicParser::expected(const std::string&) { return false; } @@ -472,7 +472,7 @@ bool MbD::SymbolicParser::signedNumber() return false; } -bool MbD::SymbolicParser::peekForTypevalue(std::string type, std::string symbol) +bool MbD::SymbolicParser::peekForTypevalue(const std::string& type, std::string symbol) { if ((tokenType == type) && (token == symbol)) { scanToken(); @@ -481,12 +481,12 @@ bool MbD::SymbolicParser::peekForTypevalue(std::string type, std::string symbol) return false; } -void MbD::SymbolicParser::notify(std::string msg) const +void MbD::SymbolicParser::notify(const std::string& msg) const { notifyat(msg, mark); } -void MbD::SymbolicParser::notifyat(std::string, int) const +void MbD::SymbolicParser::notifyat(const std::string&, int) const { //"Temporarily reset source in order to get full contents" auto p = source->tellg(); diff --git a/OndselSolver/SymbolicParser.h b/OndselSolver/SymbolicParser.h index a38c29b..ef6a0d1 100644 --- a/OndselSolver/SymbolicParser.h +++ b/OndselSolver/SymbolicParser.h @@ -24,7 +24,7 @@ namespace MbD { SymbolicParser(); void initialize(); void parseUserFunction(Symsptr userFunc); - void parseString(std::string expr); + void parseString(const std::string& expr); bool commaExpression(); bool plusTerm(); bool minusTerm(); @@ -33,7 +33,7 @@ namespace MbD { bool plainFunction(); bool timesFunction(); bool divideByFunction(); - bool peekForTypeNoPush(std::string c); + bool peekForTypeNoPush(const std::string& c); std::string scanToken(); void xLetter(); void xDigit(); @@ -46,11 +46,11 @@ namespace MbD { bool intrinsic(); bool variable(); bool raisedTo(); - bool expected(std::string msg); + bool expected(const std::string& msg); bool signedNumber(); - bool peekForTypevalue(std::string type, std::string symbol); - void notify(std::string msg) const; - void notifyat(std::string msg, int mrk) const; + bool peekForTypevalue(const std::string& type, std::string symbol); + void notify(const std::string& msg) const; + void notifyat(const std::string& msg, int mrk) const; void combineStackTo(size_t pos) const; bool isNextLineTag(char c) const; diff --git a/OndselSolver/System.cpp b/OndselSolver/System.cpp index b88dc63..315fd60 100644 --- a/OndselSolver/System.cpp +++ b/OndselSolver/System.cpp @@ -13,7 +13,7 @@ #include "Joint.h" #include "ForceTorqueItem.h" #include "SystemSolver.h" -#include "Time.h" +#include "SymTime.h" #include "CREATE.h" #include "ExternalSystem.h" #include "PrescribedMotion.h" @@ -30,7 +30,7 @@ System::System() { systemSolver = std::make_shared(this); } -System::System(const char* str) : Item(str) { +System::System(const std::string& str) : Item(str) { } System* MbD::System::root() @@ -171,7 +171,7 @@ void MbD::System::partsJointsMotionsLimitsForcesTorquesDo(const std::functionbegin(), forcesTorques->end(), f); } -void System::logString(std::string& str) +void System::logString(const std::string& str) { externalSystem->logString(str); } diff --git a/OndselSolver/System.h b/OndselSolver/System.h index 19aa1a2..a68f651 100644 --- a/OndselSolver/System.h +++ b/OndselSolver/System.h @@ -38,7 +38,7 @@ namespace MbD { //ToDo: Needed members admSystem namedItems mbdTime parts jointsMotions forcesTorques sensors variables hasChanged mbdSystemSolver public: System(); - System(const char* str); + System(const std::string& str); System* root() override; void initialize() override; void initializeLocally() override; @@ -53,7 +53,7 @@ namespace MbD { void partsJointsMotionsForcesTorquesDo(const std::function )>& f); void partsJointsMotionsLimitsForcesTorquesDo(const std::function )>& f); void partsJointsMotionsLimitsDo(const std::function )>& f); - void logString(std::string& str) override; + void logString(const std::string& str) override; double mbdTimeValue(); void mbdTimeValue(double t); std::shared_ptr>> essentialConstraints(); diff --git a/OndselSolver/SystemNewtonRaphson.cpp b/OndselSolver/SystemNewtonRaphson.cpp index 3ad1fc5..364c247 100644 --- a/OndselSolver/SystemNewtonRaphson.cpp +++ b/OndselSolver/SystemNewtonRaphson.cpp @@ -86,7 +86,7 @@ void SystemNewtonRaphson::handleSingularMatrix() void MbD::SystemNewtonRaphson::outputSpreadsheet() { - std::ofstream os("../testapp/spreadsheetcpp.csv"); + std::ofstream os("../../testapp/spreadsheetcpp.csv"); os << std::setprecision(std::numeric_limits::max_digits10); for (size_t i = 0; i < pypx->nrow(); i++) { diff --git a/OndselSolver/SystemSolver.cpp b/OndselSolver/SystemSolver.cpp index a64897e..c5b0e01 100644 --- a/OndselSolver/SystemSolver.cpp +++ b/OndselSolver/SystemSolver.cpp @@ -255,7 +255,7 @@ void SystemSolver::partsJointsMotionsDo(const std::functionpartsJointsMotionsDo(f); } -void SystemSolver::logString(std::string& str) +void SystemSolver::logString(const std::string& str) { system->logString(str); } diff --git a/OndselSolver/SystemSolver.h b/OndselSolver/SystemSolver.h index e409290..74988d3 100644 --- a/OndselSolver/SystemSolver.h +++ b/OndselSolver/SystemSolver.h @@ -60,7 +60,7 @@ namespace MbD { void runPosICKine(); void runVelICKine(); void runAccICKine(); - void logString(std::string& str) override; + void logString(const std::string& str) override; std::shared_ptr>> parts(); std::shared_ptr>> limits(); //std::shared_ptr> contactEndFrames(); diff --git a/OndselSolver/Time.cpp b/OndselSolver/Time.cpp index fac3ea5..6dae9b0 100644 --- a/OndselSolver/Time.cpp +++ b/OndselSolver/Time.cpp @@ -6,7 +6,7 @@ * See LICENSE file for details about copyright. * ***************************************************************************/ -#include "Time.h" +#include "SymTime.h" using namespace MbD; diff --git a/OndselSolver/Translation.cpp b/OndselSolver/Translation.cpp index ff58ceb..d4f01f1 100644 --- a/OndselSolver/Translation.cpp +++ b/OndselSolver/Translation.cpp @@ -16,7 +16,7 @@ MbD::Translation::Translation() { } -MbD::Translation::Translation(const char*) +MbD::Translation::Translation(const std::string&) { } diff --git a/OndselSolver/Translation.h b/OndselSolver/Translation.h index 6ea87f6..c7bd9ad 100644 --- a/OndselSolver/Translation.h +++ b/OndselSolver/Translation.h @@ -16,7 +16,7 @@ namespace MbD { // public: Translation(); - Translation(const char* str); + Translation(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/TranslationalJoint.cpp b/OndselSolver/TranslationalJoint.cpp index ee9832c..ddfa3e8 100644 --- a/OndselSolver/TranslationalJoint.cpp +++ b/OndselSolver/TranslationalJoint.cpp @@ -18,7 +18,7 @@ MbD::TranslationalJoint::TranslationalJoint() { } -MbD::TranslationalJoint::TranslationalJoint(const char* str) : InLineJoint(str) +MbD::TranslationalJoint::TranslationalJoint(const std::string& str) : InLineJoint(str) { } diff --git a/OndselSolver/TranslationalJoint.h b/OndselSolver/TranslationalJoint.h index e772bec..bdccab7 100644 --- a/OndselSolver/TranslationalJoint.h +++ b/OndselSolver/TranslationalJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: TranslationalJoint(); - TranslationalJoint(const char* str); + TranslationalJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/UniversalJoint.cpp b/OndselSolver/UniversalJoint.cpp index d10324c..775b868 100644 --- a/OndselSolver/UniversalJoint.cpp +++ b/OndselSolver/UniversalJoint.cpp @@ -16,7 +16,7 @@ MbD::UniversalJoint::UniversalJoint() { } -MbD::UniversalJoint::UniversalJoint(const char* str) : AtPointJoint(str) +MbD::UniversalJoint::UniversalJoint(const std::string& str) : AtPointJoint(str) { } diff --git a/OndselSolver/UniversalJoint.h b/OndselSolver/UniversalJoint.h index 62d2a66..4f756af 100644 --- a/OndselSolver/UniversalJoint.h +++ b/OndselSolver/UniversalJoint.h @@ -16,7 +16,7 @@ namespace MbD { // public: UniversalJoint(); - UniversalJoint(const char* str); + UniversalJoint(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolver/Variable.cpp b/OndselSolver/Variable.cpp index b3f8afc..d0e6d5c 100644 --- a/OndselSolver/Variable.cpp +++ b/OndselSolver/Variable.cpp @@ -15,7 +15,7 @@ Variable::Variable() value = 0.0; } -Variable::Variable(const char* str) : name(str) +Variable::Variable(const std::string& str) : name(str) { value = 0.0; } @@ -28,7 +28,7 @@ void Variable::initialize() { } -void Variable::setName(std::string str) +void Variable::setName(const std::string& str) { name = str; } diff --git a/OndselSolver/Variable.h b/OndselSolver/Variable.h index a5b8851..f2c519f 100644 --- a/OndselSolver/Variable.h +++ b/OndselSolver/Variable.h @@ -17,10 +17,10 @@ namespace MbD { //name value public: Variable(); - Variable(const char* str); + Variable(const std::string& str); Variable(double val); void initialize() override; - void setName(std::string str); + void setName(const std::string& str); const std::string& getName() const; double getValue() override; std::ostream& printOn(std::ostream& s) const override; diff --git a/OndselSolver/VelKineSolver.cpp b/OndselSolver/VelKineSolver.cpp index 9ff021e..922bb75 100644 --- a/OndselSolver/VelKineSolver.cpp +++ b/OndselSolver/VelKineSolver.cpp @@ -49,7 +49,7 @@ void VelKineSolver::assignEquationNumbers() void VelKineSolver::run() { - system->Solver::logString("MbD: Solving for kinematic velocity."); + system->logString("MbD: Solving for kinematic velocity."); system->partsJointsMotionsLimitsDo([](std::shared_ptr item) { item->preVelIC(); }); this->assignEquationNumbers(); system->partsJointsMotionsLimitsDo([](std::shared_ptr item) { item->useEquationNumbers(); }); diff --git a/OndselSolver/ZRotation.cpp b/OndselSolver/ZRotation.cpp index a45652d..3d4cdd7 100644 --- a/OndselSolver/ZRotation.cpp +++ b/OndselSolver/ZRotation.cpp @@ -20,7 +20,7 @@ ZRotation::ZRotation() { } -ZRotation::ZRotation(const char* str) : PrescribedMotion(str) { +ZRotation::ZRotation(const std::string& str) : PrescribedMotion(str) { } diff --git a/OndselSolver/ZRotation.h b/OndselSolver/ZRotation.h index 64f23c2..6a746f6 100644 --- a/OndselSolver/ZRotation.h +++ b/OndselSolver/ZRotation.h @@ -16,7 +16,7 @@ namespace MbD { // public: ZRotation(); - ZRotation(const char* str); + ZRotation(const std::string& str); void initializeGlobally() override; }; } diff --git a/OndselSolver/ZTranslation.cpp b/OndselSolver/ZTranslation.cpp index 7686a17..f3efae1 100644 --- a/OndselSolver/ZTranslation.cpp +++ b/OndselSolver/ZTranslation.cpp @@ -16,7 +16,7 @@ MbD::ZTranslation::ZTranslation() { } -MbD::ZTranslation::ZTranslation(const char*) +MbD::ZTranslation::ZTranslation(const std::string&) { } diff --git a/OndselSolver/ZTranslation.h b/OndselSolver/ZTranslation.h index 8f2a211..cd83af3 100644 --- a/OndselSolver/ZTranslation.h +++ b/OndselSolver/ZTranslation.h @@ -16,7 +16,7 @@ namespace MbD { // public: ZTranslation(); - ZTranslation(const char* str); + ZTranslation(const std::string& str); void initializeGlobally() override; }; diff --git a/OndselSolverMain/CMakeLists.txt b/OndselSolverMain/CMakeLists.txt new file mode 100644 index 0000000..b8b619a --- /dev/null +++ b/OndselSolverMain/CMakeLists.txt @@ -0,0 +1,9 @@ +set(ONDSELSOLVER_MAIN_SRC + OndselSolver.cpp +) +set(ONDSELSOLVER_MAIN_HEADERS + OndselSolver.h +) + +add_executable(OndselSolverMain ${ONDSELSOLVER_MAIN_SRC} ${ONDSELSOLVER_MAIN_HEADERS}) +target_link_libraries(OndselSolverMain OndselSolver) diff --git a/testapp/OndselSolver.cpp b/OndselSolverMain/OndselSolver.cpp similarity index 58% rename from testapp/OndselSolver.cpp rename to OndselSolverMain/OndselSolver.cpp index f7cf5d9..d4b82d9 100644 --- a/testapp/OndselSolver.cpp +++ b/OndselSolverMain/OndselSolver.cpp @@ -20,7 +20,6 @@ #include "../OndselSolver/MomentOfInertiaSolver.h" using namespace MbD; -void runSpMat(); void sharedptrTest(); int main() @@ -30,44 +29,43 @@ int main() //auto assembly = ASMTAssembly::assemblyFromFile("C:/Users/askoh/OneDrive/askoh/visualstudio/Ondsel/OndselFreeCAD/build/src/Main/runPreDrag.asmt"); //assembly->runDraggingLog("C:/Users/askoh/OneDrive/askoh/visualstudio/Ondsel/OndselFreeCAD/build/src/Main/dragging.log"); //return 0; - auto assembly = ASMTAssembly::assemblyFromFile("../testapp/runPreDragBackhoe3.asmt"); - assembly->runDraggingLog("../testapp/draggingBackhoe3.log"); - return 0; + auto assembly = ASMTAssembly::assemblyFromFile(std::string(TEST_DATA_PATH) + "/runPreDragBackhoe3.asmt"); + assembly->runDraggingLog(std::string(TEST_DATA_PATH) + "/draggingBackhoe3.log"); + //return 0; ASMTAssembly::runDraggingLogTest3(); ASMTAssembly::runDraggingLogTest2(); ASMTAssembly::runDraggingLogTest(); - ASMTAssembly::runFile("../testapp/pistonAllowZRotation.asmt"); - ASMTAssembly::runFile("../testapp/Schmidt_Coupling_Ass_1-1.asmt"); - ASMTAssembly::runFile("../testapp/RevRevJt.asmt"); - ASMTAssembly::runFile("../testapp/RevCylJt.asmt"); - ASMTAssembly::runFile("../testapp/CylSphJt.asmt"); - ASMTAssembly::runFile("../testapp/SphSphJt.asmt"); - ASMTAssembly::readWriteFile("../testapp/Gears.asmt"); - ASMTAssembly::readWriteFile("../testapp/anglejoint.asmt"); - ASMTAssembly::readWriteFile("../testapp/constvel.asmt"); - ASMTAssembly::readWriteFile("../testapp/rackscrew.asmt"); - ASMTAssembly::readWriteFile("../testapp/planarbug.asmt"); - ASMTAssembly::runFile("../testapp/cirpendu2.asmt"); //Under constrained. Testing ICKine. - ASMTAssembly::runFile("../testapp/quasikine.asmt"); //Under constrained. Testing ICKine. - ASMTAssembly::readWriteFile("../testapp/piston.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/pistonAllowZRotation.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/Schmidt_Coupling_Ass_1-1.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/RevRevJt.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/RevCylJt.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/CylSphJt.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/SphSphJt.asmt"); + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/Gears.asmt"); + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/anglejoint.asmt"); + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/constvel.asmt"); + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/rackscrew.asmt"); + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/planarbug.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/cirpendu2.asmt"); //Under constrained. Testing ICKine. + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/quasikine.asmt"); //Under constrained. Testing ICKine. + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/piston.asmt"); ////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("../testapp/circular.asmt"); //Needs checking - //ASMTAssembly::runFile("../testapp/engine1.asmt"); //Needs checking - ASMTAssembly::runFile("../testapp/fourbar.asmt"); - //ASMTAssembly::runFile("../testapp/fourbot.asmt"); //Very large but works - ASMTAssembly::runFile("../testapp/wobpump.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/piston.asmt"); + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/00backhoe.asmt"); + //ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/circular.asmt"); //Needs checking + //ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/engine1.asmt"); //Needs checking + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/fourbar.asmt"); + //ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/fourbot.asmt"); //Very large but works + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/wobpump.asmt"); auto cadSystem = std::make_shared(); cadSystem->runOndselSinglePendulum(); cadSystem->runOndselDoublePendulum(); //cadSystem->runOndselPiston(); //For debugging cadSystem->runPiston(); - runSpMat(); MomentOfInertiaSolver::example1(); sharedptrTest(); } @@ -88,20 +86,3 @@ void sharedptrTest() { assert(assm->constantGravity == assm2->constantGravity); //constantGravity is same object pointed to assert(&(assm->constantGravity) != &(assm2->constantGravity)); //Different shared_ptrs of same reference counter } -void runSpMat() { - auto spMat = std::make_shared>(3, 3); - spMat->atijput(0, 0, 1.0); - spMat->atijput(0, 1, 1.0); - spMat->atijput(1, 0, 1.0); - spMat->atijput(1, 1, 1.0); - spMat->atijput(1, 2, 1.0); - spMat->atijput(2, 1, 1.0); - spMat->atijput(2, 2, 1.0); - auto fullCol = std::make_shared>(3); - fullCol->atiput(0, 1.0); - fullCol->atiput(1, 2.0); - fullCol->atiput(2, 3.0); - auto matSolver = CREATE::With(); - auto answer = matSolver->solvewithsaveOriginal(spMat, fullCol, true); - auto aAx = spMat->timesFullColumn(answer); -} diff --git a/testapp/OndselSolver.h b/OndselSolverMain/OndselSolver.h similarity index 100% rename from testapp/OndselSolver.h rename to OndselSolverMain/OndselSolver.h diff --git a/testapp/draggingBackhoe.log b/testapp/draggingBackhoe1.log similarity index 100% rename from testapp/draggingBackhoe.log rename to testapp/draggingBackhoe1.log diff --git a/testapp/runPreDragBackhoe.asmt b/testapp/runPreDragBackhoe1.asmt similarity index 100% rename from testapp/runPreDragBackhoe.asmt rename to testapp/runPreDragBackhoe1.asmt diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..7ca7034 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,67 @@ +include(FetchContent) +FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip +) +# For Windows: Prevent overriding the parent project's compiler/linker settings +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) + +if(MSVC) + add_compile_options(/wd4251) + + option( + gtest_force_shared_crt + "Use shared (DLL) run-time lib even when Google Test is built as static lib." + ON) + option(gtest_disable_pthreads "Disable uses of pthreads in gtest." ON) + + set(Google_Tests_LIBS + oldnames.lib + debug msvcrtd.lib + debug msvcprtd.lib + optimized msvcrt.lib + optimized msvcprt.lib + ) + + # Universal C runtime introduced in VS 2015 (cl version 19) + if(NOT(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19")) + list(APPEND Google_Tests_LIBS + debug vcruntimed.lib + debug ucrtd.lib + debug concrtd.lib + optimized vcruntime.lib + optimized ucrt.lib + optimized concrt.lib + ) + endif() +endif() + +if(WIN32) + add_definitions(-D_USE_MATH_DEFINES) +endif(WIN32) + + +# Add test executables here +add_executable(test_run) +target_include_directories( + test_run PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../OndselSolver +) +target_sources(test_run + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp +) +target_link_libraries(test_run + gtest_main + gmock_main + ${Google_Tests_LIBS} + OndselSolver +) + +include(GoogleTest) +# discovers tests by asking the compiled test executable to enumerate its tests +set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE PRE_TEST) + +gtest_discover_tests(test_run) diff --git a/tests/packages.config b/tests/packages.config new file mode 100644 index 0000000..be1fa03 --- /dev/null +++ b/tests/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tests/pch.cpp b/tests/pch.cpp new file mode 100644 index 0000000..250fb27 --- /dev/null +++ b/tests/pch.cpp @@ -0,0 +1,5 @@ +// +// pch.cpp +// + +#include "pch.h" diff --git a/tests/pch.h b/tests/pch.h new file mode 100644 index 0000000..60c8bc5 --- /dev/null +++ b/tests/pch.h @@ -0,0 +1,7 @@ +// +// pch.h +// + +#pragma once + +#include diff --git a/tests/test.cpp b/tests/test.cpp new file mode 100644 index 0000000..642dd90 --- /dev/null +++ b/tests/test.cpp @@ -0,0 +1,172 @@ +#include "pch.h" +#include +#include +#include +#include + +using namespace MbD; + +TEST(OndselSolver, TestName) { + EXPECT_EQ(1, 1); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runOndselSinglePendulum) { + //testing::internal::CaptureStdout(); + auto cadSystem = std::make_shared(); + cadSystem->runOndselSinglePendulum(); + //std::string output = testing::internal::GetCapturedStdout(); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runPreDragBackhoe1) { + auto assembly = ASMTAssembly::assemblyFromFile(std::string(TEST_DATA_PATH) + "/runPreDragBackhoe1.asmt"); + assembly->runDraggingLog(std::string(TEST_DATA_PATH) + "/draggingBackhoe1.log"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runPreDragBackhoe2) { + auto assembly = ASMTAssembly::assemblyFromFile(std::string(TEST_DATA_PATH) + "/runPreDragBackhoe2.asmt"); + assembly->runDraggingLog(std::string(TEST_DATA_PATH) + "/draggingBackhoe2.log"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runPreDragBackhoe3) { + auto assembly = ASMTAssembly::assemblyFromFile(std::string(TEST_DATA_PATH) + "/runPreDragBackhoe3.asmt"); + assembly->runDraggingLog(std::string(TEST_DATA_PATH) + "/draggingBackhoe3.log"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, pistonAllowZRotation) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/pistonAllowZRotation.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, RevRevJt) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/RevRevJt.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, RevCylJt) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/RevCylJt.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, CylSphJt) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/CylSphJt.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, SphSphJt) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/SphSphJt.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, Gears) { + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/Gears.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, anglejoint) { + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/anglejoint.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, constvel) { + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/constvel.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, rackscrew) { + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/rackscrew.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, planarbug) { + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/planarbug.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, cirpendu2) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/cirpendu2.asmt"); //Under constrained. Testing ICKine. + EXPECT_TRUE(true); +} +TEST(OndselSolver, quasikine) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/quasikine.asmt"); //Under constrained. Testing ICKine. + EXPECT_TRUE(true); +} +TEST(OndselSolver, piston) { + ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/piston.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runSinglePendulumSuperSimplified) { + ASMTAssembly::runSinglePendulumSuperSimplified(); //Mass is missing + EXPECT_TRUE(true); +} +TEST(OndselSolver, runSinglePendulumSuperSimplified2) { + ASMTAssembly::runSinglePendulumSuperSimplified2(); //DOF has infinite acceleration due to zero mass and inertias + EXPECT_TRUE(true); +} +TEST(OndselSolver, runSinglePendulumSimplified) { + ASMTAssembly::runSinglePendulumSimplified(); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runSinglePendulum) { + ASMTAssembly::runSinglePendulum(); + EXPECT_TRUE(true); +} +TEST(OndselSolver, piston2) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/piston.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, 00backhoe) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/00backhoe.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, circular) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/circular.asmt"); //Needs checking + EXPECT_TRUE(true); +} +TEST(OndselSolver, engine1) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/engine1.asmt"); //Needs checking + EXPECT_TRUE(true); +} +TEST(OndselSolver, fourbar) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/fourbar.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, fourbot) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/fourbot.asmt"); //Very large but works + EXPECT_TRUE(true); +} +TEST(OndselSolver, wobpump) { + ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/wobpump.asmt"); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runOndselDoublePendulum) { + auto cadSystem = std::make_shared(); + cadSystem->runOndselDoublePendulum(); + EXPECT_TRUE(true); +} +TEST(OndselSolver, runOndselPiston) { + auto cadSystem = std::make_shared(); + cadSystem->runOndselPiston(); //For debugging + EXPECT_TRUE(true); +} +TEST(OndselSolver, runPiston) { + auto cadSystem = std::make_shared(); + cadSystem->runPiston(); + EXPECT_TRUE(true); +} +TEST(OndselSolver, GESpMatParPvPrecise) { + GESpMatParPvPrecise::runSpMat(); + EXPECT_TRUE(true); +} +TEST(OndselSolver, MomentOfInertiaSolver) { + MomentOfInertiaSolver::example1(); + EXPECT_TRUE(true); +} +TEST(OndselSolver, sharedptrTest) { + auto assm = ASMTAssembly::With(); + + std::shared_ptr assm1 = assm; //New shared_ptr to old object. Reference count incremented. + assert(assm == assm1); + assert(assm.get() == assm1.get()); + assert(&assm != &assm1); + assert(assm->constantGravity == assm1->constantGravity); + assert(&(assm->constantGravity) == &(assm1->constantGravity)); + + auto assm2 = std::make_shared(*assm); //New shared_ptr to new object. Member variables copy old member variables + assert(assm != assm2); + assert(assm.get() != assm2.get()); + assert(&assm != &assm2); + assert(assm->constantGravity == assm2->constantGravity); //constantGravity is same object pointed to + assert(&(assm->constantGravity) != &(assm2->constantGravity)); //Different shared_ptrs of same reference counter + EXPECT_TRUE(true); +} + diff --git a/tests/tests.vcxproj b/tests/tests.vcxproj new file mode 100644 index 0000000..8558151 --- /dev/null +++ b/tests/tests.vcxproj @@ -0,0 +1,132 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {f525e02a-e399-4c92-9094-1b2ea5ab46b4} + Win32Proj + 10.0.22621.0 + Application + v143 + Unicode + + + + + + + + + + + Use + pch.h + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Level3 + + + true + Console + + + + + Use + pch.h + Disabled + X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Level3 + C:\Users\askoh\OneDrive\askoh\visualstudio\Ondsel\OndselSolver2;%(AdditionalIncludeDirectories) + + + true + Console + + + + + Use + pch.h + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + ProgramDatabase + + + true + Console + true + true + + + + + Use + pch.h + X64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + ProgramDatabase + + + true + Console + true + true + + + + + + + + + Create + Create + Create + Create + + + + + + + + {8182b0ff-ac7c-3d8b-b91a-e508e8ad9a36} + + + {7645848d-0834-3e83-91f8-1a11238aa66d} + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/tests/tests.vcxproj.user b/tests/tests.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/tests/tests.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file