1 /* Siconos is a program dedicated to modeling, simulation and control
2  * of non smooth dynamical systems.
3  *
4  * Copyright 2021 INRIA.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17 */
18 #ifndef GLOBALFRICTIONCONTACT3DBALANCING_H
19 #define GLOBALFRICTIONCONTACT3DBALANCING_H
20 
21 struct GlobalFrictionContactProblem_balancing_data
22 {
23   BalancingMatrices * B_for_M;
24   BalancingMatrices * B_for_H;
25   GlobalFrictionContactProblem * original_problem;
26   double alpha;
27   double beta;
28   double gamma;
29 };
30 
31 
32 #if defined(__cplusplus) && !defined(BUILD_AS_CPP)
33 extern "C"
34 {
35 #endif
36   void gfc3d_rescaling(
37     GlobalFrictionContactProblem* problem,
38     double alpha,  double beta, double gamma);
39 
40   void gfc3d_balancing_M(
41     GlobalFrictionContactProblem* problem,
42     BalancingMatrices * B_for_M);
43 
44   void gfc3d_balancing_MHHT(
45     GlobalFrictionContactProblem* problem,
46     BalancingMatrices * B_for_M,
47     BalancingMatrices * B_for_H);
48 
49   GlobalFrictionContactProblem*  gfc3d_balancing_problem(
50     GlobalFrictionContactProblem* problem,
51     SolverOptions* options);
52 
53   void gfc3d_balancing_go_to_balanced_variables(
54     GlobalFrictionContactProblem* balanced_problem,
55     SolverOptions* options,
56     double *r, double *u, double* v);
57 
58   void gfc3d_balancing_back_to_original_variables(
59     GlobalFrictionContactProblem* balanced_problem,
60     SolverOptions* options,
61     double *r, double *u, double *v);
62 
63   GlobalFrictionContactProblem*  gfc3d_balancing_free(
64     GlobalFrictionContactProblem* balanced_problem,
65     SolverOptions* options);
66 
67   GlobalFrictionContactProblem_balancing_data  * gfc3d_balancing_data_free(
68     GlobalFrictionContactProblem_balancing_data * data);
69 
70   GlobalFrictionContactProblem_balancing_data  * gfc3d_balancing_data_new(void);
71 
72 #if defined(__cplusplus) && !defined(BUILD_AS_CPP)
73 }
74 #endif
75 
76 #endif
77