hybsys.h
Go to the documentation of this file.
1 /*
2  Copyright 2010 SINTEF ICT, Applied Mathematics.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef OPM_HYBSYS_HEADER_INCLUDED
21 #define OPM_HYBSYS_HEADER_INCLUDED
22 
102 #ifdef __cplusplus
103 extern "C" {
104 #endif
105 
112 struct hybsys {
113  double *L;
114  double *q;
115  double *F1;
116  double *F2;
117  double *r;
118  double *S;
119  double *one;
120 };
121 
122 
129 struct hybsys_well {
130  double *F1;
131  double *F2;
132  double *r;
134  double *w2r;
135  double *r2w;
136  double *w2w;
138  double *data;
139 };
140 
141 
153 struct hybsys *
154 hybsys_allocate_symm(int max_nconn, int nc, int nconn_tot);
155 
156 
168 struct hybsys *
169 hybsys_allocate_unsymm(int max_nconn, int nc, int nconn_tot);
170 
171 
185 struct hybsys_well *
186 hybsys_well_allocate_symm(int max_nconn, int nc, int *cwpos);
187 
188 
202 struct hybsys_well *
203 hybsys_well_allocate_unsymm(int max_nconn, int nc, int *cwpos);
204 
205 
217 void
218 hybsys_free(struct hybsys *sys);
219 
231 void
232 hybsys_well_free(struct hybsys_well *wsys);
233 
234 
247 void
248 hybsys_init(int max_nconn, struct hybsys *sys);
249 
278 void
279 hybsys_schur_comp_symm(int nc, const int *pconn,
280  const double *Binv, struct hybsys *sys);
281 
282 
316 void
317 hybsys_schur_comp_unsymm(int nc, const int *pconn,
318  const double *Binv, const double *BIV,
319  const double *P, struct hybsys *sys);
320 
321 
356 void
357 hybsys_schur_comp_gen(int nc, const int *pconn,
358  const double *Binv, const double *C2,
359  const double *P, struct hybsys *sys);
360 
394 void
395 hybsys_well_schur_comp_symm(int nc, const int *cwpos,
396  double *WI,
397  struct hybsys *sys,
398  struct hybsys_well *wsys);
399 
433 void
434 hybsys_cellcontrib_symm(int c, int nconn, int p1, int p2,
435  const double *gpress, const double *src,
436  const double *Binv, struct hybsys *sys);
437 
438 
471 void
472 hybsys_cellcontrib_unsymm(int c, int nconn, int p1, int p2,
473  const double *gpress, const double *src,
474  const double *Binv, struct hybsys *sys);
475 
476 
502 void
503 hybsys_well_cellcontrib_symm(int c, int ngconn, int p1,
504  const int *cwpos,
505  const double *WI, const double *wdp,
506  struct hybsys *sys, struct hybsys_well *wsys);
507 
508 
548 void
549 hybsys_compute_press_flux(int nc, const int *pconn, const int *conn,
550  const double *gpress,
551  const double *Binv, const struct hybsys *sys,
552  const double *pi, double *press, double *flux,
553  double *work);
554 
555 
601 void
602 hybsys_compute_press_flux_well(int nc, const int *pgconn, int nf,
603  int nw, const int *pwconn, const int *wconn,
604  const double *Binv,
605  const double *WI,
606  const double *wdp,
607  const struct hybsys *sys,
608  const struct hybsys_well *wsys,
609  const double *pi,
610  double *cpress, double *cflux,
611  double *wpress, double *wflux,
612  double *work);
613 
614 
615 #ifdef __cplusplus
616 }
617 #endif
618 
619 #endif /* OPM_HYBSYS_HEADER_INCLUDED */
struct hybsys * hybsys_allocate_symm(int max_nconn, int nc, int nconn_tot)
struct hybsys_well * hybsys_well_allocate_symm(int max_nconn, int nc, int *cwpos)
void hybsys_cellcontrib_symm(int c, int nconn, int p1, int p2, const double *gpress, const double *src, const double *Binv, struct hybsys *sys)
double * S
Definition: hybsys.h:118
double * F1
Definition: hybsys.h:130
void hybsys_init(int max_nconn, struct hybsys *sys)
double * data
Definition: hybsys.h:138
double * w2r
Definition: hybsys.h:134
double * L
Definition: hybsys.h:113
void hybsys_well_schur_comp_symm(int nc, const int *cwpos, double *WI, struct hybsys *sys, struct hybsys_well *wsys)
void hybsys_well_free(struct hybsys_well *wsys)
double * F1
Definition: hybsys.h:115
void hybsys_compute_press_flux_well(int nc, const int *pgconn, int nf, int nw, const int *pwconn, const int *wconn, const double *Binv, const double *WI, const double *wdp, const struct hybsys *sys, const struct hybsys_well *wsys, const double *pi, double *cpress, double *cflux, double *wpress, double *wflux, double *work)
double * F2
Definition: hybsys.h:116
void hybsys_well_cellcontrib_symm(int c, int ngconn, int p1, const int *cwpos, const double *WI, const double *wdp, struct hybsys *sys, struct hybsys_well *wsys)
double * F2
Definition: hybsys.h:131
double * r
Definition: hybsys.h:132
Definition: hybsys.h:112
void hybsys_free(struct hybsys *sys)
void hybsys_schur_comp_unsymm(int nc, const int *pconn, const double *Binv, const double *BIV, const double *P, struct hybsys *sys)
double * w2w
Definition: hybsys.h:136
void hybsys_cellcontrib_unsymm(int c, int nconn, int p1, int p2, const double *gpress, const double *src, const double *Binv, struct hybsys *sys)
Definition: hybsys.h:129
void hybsys_schur_comp_symm(int nc, const int *pconn, const double *Binv, struct hybsys *sys)
double * r
Definition: hybsys.h:117
void hybsys_compute_press_flux(int nc, const int *pconn, const int *conn, const double *gpress, const double *Binv, const struct hybsys *sys, const double *pi, double *press, double *flux, double *work)
const double flux
Definition: Units.hpp:150
double * one
Definition: hybsys.h:119
double * r2w
Definition: hybsys.h:135
struct hybsys_well * hybsys_well_allocate_unsymm(int max_nconn, int nc, int *cwpos)
struct hybsys * hybsys_allocate_unsymm(int max_nconn, int nc, int nconn_tot)
double * q
Definition: hybsys.h:114
void hybsys_schur_comp_gen(int nc, const int *pconn, const double *Binv, const double *C2, const double *P, struct hybsys *sys)