Skip to content

Commit 4816fff

Browse files
committed
- fix target runtimeCPPmsvcinstall, use static cminpack.lib for msvc too
- add FMI +target=MSVC test for C runtime - update testsuite/openmodelica/cruntime/msvc/Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum.mos git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24548 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 83d65d4 commit 4816fff

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

SimulationRuntime/cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ ENDIF(WIN32)
166166
# Find CMinpack
167167
# Note: Visual Studio libs are located in install/msvc, libs for gcc are directly in install
168168
IF(MSVC)
169-
SET(CMinpack_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install/msvc")
169+
SET(CMinpack_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install_msvc")
170170
ELSE(MSVC)
171171
SET(CMinpack_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install")
172172
ENDIF(MSVC)

SimulationRuntime/cpp/Include/Solver/Hybrj/Hybrj.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "FactoryExport.h"
55
#include "HybrjSettings.h"
66

7-
#if defined(__MINGW32__) /* we have static libcminpack.a on MinGW */
7+
#if defined(__MINGW32__) || defined(_MSC_VER) /* we have static libcminpack.a on MinGW and MSVC */
88
#define CMINPACK_NO_DLL
99
#endif
1010

@@ -31,17 +31,17 @@ class Hybrj : public IAlgLoopSolver
3131
/// Returns the status of iteration
3232
virtual ITERATIONSTATUS getIterationStatus();
3333
virtual void stepCompleted(double time);
34-
34+
3535

3636
private:
3737
/// Encapsulation of determination of residuals to given unknowns
3838
void calcFunction(const double* y, double* residual);
3939
void saveVars(double time);
4040
void extrapolateVars();
4141
/// Encapsulation of determination of Jacobian
42-
void calcJacobian(double* jac);
42+
void calcJacobian(double* jac);
4343
static void fcn(const int *n, const double *x, double *fvec, double *fjac, const int *ldfjac, int *iflag,void* userdata);
44-
44+
4545
// Member variables
4646
//---------------------------------------------------------------
4747
INonLinSolverSettings
@@ -50,15 +50,15 @@ class Hybrj : public IAlgLoopSolver
5050
IAlgLoop
5151
*_algLoop; ///< Algebraic loop to be solved
5252

53-
ITERATIONSTATUS
53+
ITERATIONSTATUS
5454
_iterationStatus; ///< Output - Denotes the status of iteration
5555

56-
int
56+
int
5757
_dimSys; ///< Temp - Number of unknowns (=dimension of system of equations)
5858

5959
bool
6060
_firstCall; ///< Temp - Denotes the first call to the solver, initialize() is called
61-
61+
6262
long int* _iHelp;
6363
double
6464
*_x, ///< Temp - Unknowns variables
@@ -78,9 +78,9 @@ class Hybrj : public IAlgLoopSolver
7878
_t2; //old time
7979
bool _usescale;
8080
/*Hybrj MinPack variables */
81-
81+
8282
double* _diag; ///DIAG is an array of length N. If MODE = 1 (see below), DIAG is internally set. If MODE = 2, DIAG must contain positive entries that serve as multiplicative scale factors for the variables.
83-
double* _r; ///R is an output array of length LR which contains the upper triangular matrix produced by the QR factorization of the final approximate Jacobian, stored rowwise.
83+
double* _r; ///R is an output array of length LR which contains the upper triangular matrix produced by the QR factorization of the final approximate Jacobian, stored rowwise.
8484
double* _qtf; /// QTF is an output array of length N which contains the vector (Q transpose)*FVEC.
8585
double* _wa1; // work arrays of length N.
8686
double* _wa2; // work arrays of length N.
@@ -94,10 +94,10 @@ class Hybrj : public IAlgLoopSolver
9494
int _maxfev; //MAXFEV is a positive integer input variable. Termination occurs when the number of calls to FCN with IFLAG = 1 has reached MAXFEV.
9595
double _factor; //FACTOR is a positive input variable used in determining the initial step bound. This bound is set to the product of FACTOR and the Euclidean norm of DIAG*X if nonzero, or else to FACTOR itself. In most cases FACTOR should lie in the interval (.1,100.). 100. is a generally recommended value.
9696
double _fnorm; //final l2 norm of the residuals
97-
int _nprint; //PRINT is an integer input variable that enables controlled printing of iterates if it is positive. In this case, FCN is called with IFLAG = 0 at the beginning of the first iteration and every NPRINT iterations thereafter and immediately priorto return, with X and FVEC available for printing. FVEC and FJAC should not be altered. If NPRINT is not positive, no special calls of FCN with IFLAG = 0 are made.
97+
int _nprint; //PRINT is an integer input variable that enables controlled printing of iterates if it is positive. In this case, FCN is called with IFLAG = 0 at the beginning of the first iteration and every NPRINT iterations thereafter and immediately priorto return, with X and FVEC available for printing. FVEC and FJAC should not be altered. If NPRINT is not positive, no special calls of FCN with IFLAG = 0 are made.
9898
int _nfev; //NFEV is an integer output variable set to the number of calls to FCN with IFLAG = 1.
9999
int _njev; //NJEV is an integer output variable set to the number of calls to FCN with IFLAG = 2.
100100
const double _initial_factor;
101-
101+
102102
};
103103

0 commit comments

Comments
 (0)