2010-10-12 02:25:46 -05:00
|
|
|
/*
|
|
|
|
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-10-13 11:35:15 -05:00
|
|
|
#ifndef OPM_FLOW_BC_HEADER_INCLUDED
|
|
|
|
#define OPM_FLOW_BC_HEADER_INCLUDED
|
2010-09-13 10:46:06 -05:00
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2010-09-24 04:07:50 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-03-06 13:07:35 -06:00
|
|
|
enum FlowBCType { BC_NOFLOW ,
|
|
|
|
BC_PRESSURE ,
|
|
|
|
BC_FLUX_TOTVOL };
|
|
|
|
|
|
|
|
/* Boundary condition structure.
|
|
|
|
*
|
|
|
|
* Condition i (in [0 .. nbc-1]) affects (outer) interface face[i], is
|
|
|
|
* of type type[i], and specifies a target value of value[i].
|
|
|
|
*
|
|
|
|
* The field 'cpty' is for internal use by the implementation. */
|
|
|
|
struct FlowBoundaryConditions {
|
|
|
|
size_t nbc; /* Current number of bdry. conditions */
|
|
|
|
size_t cpty; /* Internal management. Do not touch */
|
2010-09-13 10:46:06 -05:00
|
|
|
|
2012-03-06 13:07:35 -06:00
|
|
|
enum FlowBCType *type; /* Condition type */
|
|
|
|
double *value; /* Condition value (target) */
|
|
|
|
int *face; /* Outer faces affected by ind. target */
|
|
|
|
};
|
2010-09-13 10:46:06 -05:00
|
|
|
|
|
|
|
|
2012-03-06 13:07:35 -06:00
|
|
|
/* Allocate a 'FlowBoundaryConditions' structure, initially capable of
|
|
|
|
* managing 'nbc' individual boundary conditions. */
|
|
|
|
struct FlowBoundaryConditions *
|
|
|
|
flow_conditions_construct(size_t nbc);
|
2010-09-13 10:46:06 -05:00
|
|
|
|
2012-03-06 13:07:35 -06:00
|
|
|
|
|
|
|
/* Release memory resources managed by 'fbc', including the containing
|
|
|
|
* 'struct' pointer, 'fbc'. */
|
2010-09-13 10:46:06 -05:00
|
|
|
void
|
2012-03-06 13:07:35 -06:00
|
|
|
flow_conditions_destroy(struct FlowBoundaryConditions *fbc);
|
|
|
|
|
2010-09-13 10:46:06 -05:00
|
|
|
|
2012-03-06 13:07:35 -06:00
|
|
|
/* Append a new boundary condition to existing set.
|
|
|
|
*
|
|
|
|
* Return one (1) if successful, and zero (0) otherwise. */
|
|
|
|
int
|
|
|
|
flow_conditions_append(enum FlowBCType type ,
|
|
|
|
int face ,
|
|
|
|
double value,
|
|
|
|
struct FlowBoundaryConditions *fbc );
|
|
|
|
|
|
|
|
|
|
|
|
/* Clear existing set of boundary conditions */
|
|
|
|
void
|
|
|
|
flow_conditions_clear(struct FlowBoundaryConditions *fbc);
|
2010-09-24 04:07:50 -05:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-10-13 11:35:15 -05:00
|
|
|
#endif /* OPM_FLOW_BC_HEADER_INCLUDED */
|