Skip to content

Commit

Permalink
- fix target runtimeCPPmsvcinstall, use static cminpack.lib for msvc too
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
adrpo committed Feb 12, 2015
1 parent 83d65d4 commit 4816fff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -166,7 +166,7 @@ ENDIF(WIN32)
# Find CMinpack
# Note: Visual Studio libs are located in install/msvc, libs for gcc are directly in install
IF(MSVC)
SET(CMinpack_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install/msvc")
SET(CMinpack_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install_msvc")
ELSE(MSVC)
SET(CMinpack_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install")
ENDIF(MSVC)
Expand Down
22 changes: 11 additions & 11 deletions SimulationRuntime/cpp/Include/Solver/Hybrj/Hybrj.h
Expand Up @@ -4,7 +4,7 @@
#include "FactoryExport.h"
#include "HybrjSettings.h"

#if defined(__MINGW32__) /* we have static libcminpack.a on MinGW */
#if defined(__MINGW32__) || defined(_MSC_VER) /* we have static libcminpack.a on MinGW and MSVC */
#define CMINPACK_NO_DLL
#endif

Expand All @@ -31,17 +31,17 @@ class Hybrj : public IAlgLoopSolver
/// Returns the status of iteration
virtual ITERATIONSTATUS getIterationStatus();
virtual void stepCompleted(double time);


private:
/// Encapsulation of determination of residuals to given unknowns
void calcFunction(const double* y, double* residual);
void saveVars(double time);
void extrapolateVars();
/// Encapsulation of determination of Jacobian
void calcJacobian(double* jac);
void calcJacobian(double* jac);
static void fcn(const int *n, const double *x, double *fvec, double *fjac, const int *ldfjac, int *iflag,void* userdata);

// Member variables
//---------------------------------------------------------------
INonLinSolverSettings
Expand All @@ -50,15 +50,15 @@ class Hybrj : public IAlgLoopSolver
IAlgLoop
*_algLoop; ///< Algebraic loop to be solved

ITERATIONSTATUS
ITERATIONSTATUS
_iterationStatus; ///< Output - Denotes the status of iteration

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

bool
_firstCall; ///< Temp - Denotes the first call to the solver, initialize() is called

long int* _iHelp;
double
*_x, ///< Temp - Unknowns variables
Expand All @@ -78,9 +78,9 @@ class Hybrj : public IAlgLoopSolver
_t2; //old time
bool _usescale;
/*Hybrj MinPack variables */

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.
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.
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.
double* _qtf; /// QTF is an output array of length N which contains the vector (Q transpose)*FVEC.
double* _wa1; // work arrays of length N.
double* _wa2; // work arrays of length N.
Expand All @@ -94,10 +94,10 @@ class Hybrj : public IAlgLoopSolver
int _maxfev; //MAXFEV is a positive integer input variable. Termination occurs when the number of calls to FCN with IFLAG = 1 has reached MAXFEV.
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.
double _fnorm; //final l2 norm of the residuals
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.
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.
int _nfev; //NFEV is an integer output variable set to the number of calls to FCN with IFLAG = 1.
int _njev; //NJEV is an integer output variable set to the number of calls to FCN with IFLAG = 2.
const double _initial_factor;

};

0 comments on commit 4816fff

Please sign in to comment.