[numerics] add output in global formulation in h5 file
#include "NonSmoothDrivers.h"
#include "frictionContact_test_function.h"
#include "fc3d_Solvers.h"
+#include "fc3d_solvers_wr.h"
#include "gfc3d_Solvers.h"
#include "Friction_cst.h"
#if defined(WITH_FCLIB)
#endif
#include "numerics_verbose.h"
#include "SiconosCompat.h"
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h> /* for open flags */
+#include <limits.h> /* for PATH_MAX */
+#include <time.h>
+
void frictionContact_test_gams_opts(SN_GAMSparams* GP, int solverId)
{
@@ -42,7 +49,7 @@ void frictionContact_test_gams_opts(SN_GAMSparams* GP, int solverId)
if (solverId == SICONOS_FRICTION_3D_GAMS_PATHVI ||
solverId == SICONOS_FRICTION_3D_GAMS_LCP_PATHVI ||
solverId == SICONOS_GLOBAL_FRICTION_3D_GAMS_PATHVI
- )
+fc3d_reformulation_global_problem(FrictionContactProblem* problem) )
{
add_GAMS_opt_str(GP, "avi_start", "ray_first", GAMS_OPT_SOLVER);
add_GAMS_opt_str(GP, "ratio_tester", "expand", GAMS_OPT_SOLVER);
@@ -89,6 +96,49 @@ int frictionContact_test_function(FILE * f, SolverOptions * options)
FILE * foutput = fopen("checkinput.dat", "w");
info = frictionContact_printInFile(problem, foutput);
+ int global_hdf5_output ;
+
+ global_hdf5_output = 0;
+
+ if(global_hdf5_output)
+ {
+/* get the current calendar time */
+ int stime;
+ long ltime;
+ ltime = time(NULL);
+ stime = (unsigned) ltime/2;
+ srand(stime);
+ char filename[100];
+ sprintf(filename,"gfc3d_%d.hdf5",rand());
+
+
+ /* static char template[] = "gfc3d_XXXXXX.hdf5"; */
+ /* char fname[PATH_MAX]; */
+ /* int fd; */
+ /* strcpy(fname, template); /\* Copy template *\/ */
+ /* fd = mkstemp(fname); /\* Create and open temp file *\/ */
+ /* printf("Filename is %s\n", fname); */
+
+ /* printf("%s ", fname); */
+
+
+ GlobalFrictionContactProblem * gfc3d = fc3d_reformulation_global_problem(problem);
+
+ char * title = "--";
+ char * description = "--";
+ char * mathInfo = "--";
+
+ globalFrictionContact_fclib_write(gfc3d,
+ title,
+ description,
+ mathInfo,
+ filename);
+
+ }
+
+
+
+
solver_options_print(options);
int NC = problem->numberOfContacts;
int dim = problem->dimension;
