fsh_common_impl.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_FSH_COMMON_IMPL_HEADER_INCLUDED
21 #define OPM_FSH_COMMON_IMPL_HEADER_INCLUDED
22 
23 /* Internal header. Don't install. */
24 
25 struct fsh_impl {
26  int nc, nf, nw; /* Number of cells, faces, wells */
27 
28  /* Topology */
29  int *gdof_pos; /* Pointers, grid DOFs (== cell_facepos) */
30  int *gdof; /* Grid DOFs (== cell_faces) */
31 
32  int *cwell_pos; /* Start pointers, well DOFs (c->w) */
33  int *cwells; /* Well DOFs (c->w) */
34 
35  /* Discretisation data */
36  double *WI; /* Permuted well production indices */
37  double *wdp; /* Permuted well gravity pressures */
38 
39  double *cflux; /* Cell (half-contact) fluxes */
40 
41  struct hybsys *sys; /* Hybrid cell contribs */
42  struct hybsys_well *wsys; /* Hybrid cell contribs from wells */
43 
44  double *work; /* Scratch array, floating point */
45  int *iwork; /* Scratch array, integers */
46 
47  int *bdry_condition; /* Map face->boundary condition ID */
48 
49  /* Linear storage goes here... */
50  int *idata; /* Actual storage array, integers */
51  double *ddata; /* Actual storage array, floating point */
52 };
53 
54 
55 struct fsh_impl *
56 fsh_impl_allocate_basic(size_t idata_sz, size_t ddata_sz);
57 
58 void
59 fsh_count_grid_dof(struct UnstructuredGrid *G, int *max_ngdof, size_t *sum_ngdof2);
60 
61 void
63  struct fsh_impl *pimpl);
64 
65 int
66 fsh_impose_bc(int ndof,
67  int *dof,
68  struct FlowBoundaryConditions *bc,
69  struct fsh_impl *pimpl);
70 
71 void
73  size_t nf,
74  size_t nnu,
75  size_t nhf,
76  size_t max_ncf,
77  well_t *W,
78  struct fsh_impl *pimpl);
79 
80 void
81 fsh_define_cell_wells(size_t nc, well_t *W, struct fsh_impl *pimpl);
82 
83 void
85 
86 void
87 fsh_compute_table_sz(struct UnstructuredGrid *G, well_t *W, int max_ngconn,
88  size_t *nnu, size_t *idata_sz, size_t *ddata_sz);
89 
90 #endif /* OPM_FSH_COMMON_IMPL_HEADER_INCLUDED */
int fsh_impose_bc(int ndof, int *dof, struct FlowBoundaryConditions *bc, struct fsh_impl *pimpl)
Definition: grid.h:98
struct fsh_impl * fsh_impl_allocate_basic(size_t idata_sz, size_t ddata_sz)
Definition: flow_bc.h:39
void fsh_compute_table_sz(struct UnstructuredGrid *G, well_t *W, int max_ngconn, size_t *nnu, size_t *idata_sz, size_t *ddata_sz)
void fsh_map_bdry_condition(struct FlowBoundaryConditions *fbc, struct fsh_impl *pimpl)
int nc
Definition: fsh_common_impl.h:26
struct hybsys_well * wsys
Definition: fsh_common_impl.h:42
int * cwells
Definition: fsh_common_impl.h:33
void fsh_count_grid_dof(struct UnstructuredGrid *G, int *max_ngdof, size_t *sum_ngdof2)
int * gdof
Definition: fsh_common_impl.h:30
double * ddata
Definition: fsh_common_impl.h:51
int nw
Definition: fsh_common_impl.h:26
double * wdp
Definition: fsh_common_impl.h:37
void fsh_define_cell_wells(size_t nc, well_t *W, struct fsh_impl *pimpl)
int * bdry_condition
Definition: fsh_common_impl.h:47
double * cflux
Definition: fsh_common_impl.h:39
int * idata
Definition: fsh_common_impl.h:50
Definition: hybsys.h:112
double * WI
Definition: fsh_common_impl.h:36
int * gdof_pos
Definition: fsh_common_impl.h:29
Definition: fsh_common_impl.h:25
Definition: hybsys.h:129
struct hybsys * sys
Definition: fsh_common_impl.h:41
Definition: fsh.h:72
int nf
Definition: fsh_common_impl.h:26
double * work
Definition: fsh_common_impl.h:44
int * cwell_pos
Definition: fsh_common_impl.h:32
int * iwork
Definition: fsh_common_impl.h:45
Definition: legacy_well.h:52
void fsh_define_impl_arrays(size_t nc, size_t nf, size_t nnu, size_t nhf, size_t max_ncf, well_t *W, struct fsh_impl *pimpl)
void fsh_define_linsys_arrays(struct fsh_data *h)