Program listing for file numerics/src/FrictionContact/FrictionContactProblem.h#

 1#ifndef FRICTIONCONTACTPROBLEM_H
 2#define FRICTIONCONTACTPROBLEM_H
 3
 4
 5#include "NumericsFwd.h"
 6#include "NumericsMatrix.h"
 7#include "SiconosConfig.h"
 8
 9#include <stdio.h>
10
11
12struct FrictionContactProblem {
13
14  int dimension;
15
16  int numberOfContacts;
17
18  RawNumericsMatrix *M;
19
20  double *q;
21
22  double *mu;
23};
24
25struct SplittedFrictionContactProblem {
26  FrictionContactProblem *fc3d;
27  NumericsMatrix *M_nn;
28  NumericsMatrix *M_tn;
29  NumericsMatrix *M_nt;
30  NumericsMatrix *M_tt;
31  double *q_n;
32  double *q_t;
33};
34
35#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
36extern "C" {
37#endif
38
39
40FrictionContactProblem *frictionContactProblem_new(void);
41
42
43FrictionContactProblem *frictionContactProblem_new_with_data(int dim, int nc,
44                                                             NumericsMatrix *M,
45                                                             double *q,
46                                                             double *mu);
47
48
49void frictionContactProblem_free(FrictionContactProblem *problem);
50
51
52void frictionContact_display(FrictionContactProblem *problem);
53
54
55int frictionContact_printInFile(FrictionContactProblem *problem, FILE *file);
56
57
58int frictionContact_printInFilename(FrictionContactProblem *problem,
59                                    char *filename);
60
61
62FrictionContactProblem *frictionContact_newFromFile(FILE *file);
63
64
65FrictionContactProblem *frictionContact_new_from_filename(const char *filename);
66
67void createSplittedFrictionContactProblem(
68    FrictionContactProblem *problem,
69    SplittedFrictionContactProblem *splitted_problem);
70
71void frictionContactProblem_compute_statistics(FrictionContactProblem *problem,
72                                               double *reaction,
73                                               double *velocity, double tol,
74                                               int do_print);
75
76
77FrictionContactProblem *frictionContact_copy(FrictionContactProblem *problem);
78
79
80void frictionContact_rescaling(FrictionContactProblem *problem, double alpha,
81                               double gamma);
82
83#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
84}
85#endif
86
87#endif