Introduce two intermediate variables, c1, and c2, to hold cell numbers
during the building of the cell<->cell neighbourhood. This reduces
the statement complexity--both for the human reader and the compiler...
Automake 1.11 introduced the concept of "silent build rules" wherein the
build commands are reported as
CC cfsh.lo
rather than something along the lines of
bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../../../opmpressure/src -I.. -DMATLAB_MEX_FILE=1 -I/work/opt/matlab/R2009b/extern/include/ -O3 -DNDEBUG -std=c99 -Wall -Wextra -pedantic -march=native -mtune=native -MT cfsh.lo -MD -MP -MF .deps/cfsh.Tpo -c -o cfsh.lo ../../../../../opmpressure/src/cfsh.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../../../../opmpressure/src -I.. -DMATLAB_MEX_FILE=1 -I/work/opt/matlab/R2009b/extern/include/ -O3 -DNDEBUG -std=c99 -Wall -Wextra -pedantic -march=native -mtune=native -MT cfsh.lo -MD -MP -MF .deps/cfsh.Tpo -c ../../../../../opmpressure/src/cfsh.c -fPIC -DPIC -o .libs/cfsh.o
The former is much easier to read and, consequently, more conducive to
visually noticing diagnostics from the toolset (compiler, linker &c).
On the other hand, only fairly recent editions of Automake have the
"silent rule" capability, so enable silent rules only if available. In
particular, Automake 1.10.x (the default Automake version in MacOS X
10.6) does not support the capability. Neither does the default
Automake in CentOS 5.6.
Further details on silent build rules can be found at
http://sources.redhat.com/automake/automake.html#Optionshttp://www.flameeyes.eu/autotools-mythbuster/automake/silent.html
Thanks to Arne Morten Kvarving in Dune Flyspray issue #922
(http://www.dune-project.org/flyspray/index.php?do=details&task_id=922)
for the tip on how to preserve "configure.ac" backwards compatibility
with Automake < 1.11 .
1. Changed calculation of face pressures to avoid using mobilities.
2. Added 'scratch_f' array to cfs_tpfa_impl struct (for use by above routine).
3. Changed interface of cfs_tpfa_fpress() to pass the data struct.
Specifically, GCC in strict ISO C90 mode warns of:
cfs_tpfa.c: In function ‘cfs_tpfa_impes_maxtime_cell’:
cfs_tpfa.c:1086: warning: ISO C90 forbids mixed declarations and code
0. Writes total fluid volumes to octave and vtk output files.
(following considerations ONLY apply to IMPES mode: do_impes=true)
1. Now we do timestep safety evaluations for IMPES, a la Coats.
This is done after the pressure computation.
2. If current timestep is unsafe, we set the new timestep to the safe one,
divided by 1.5.
3. If minimum_stepsize is set, we will not further reduce the timestep once
it is below the minimum (yes, this is not quite a "minimum").
All in all, timestepping and reporting should be reconsidered to make a
user-friendly yet controllable impes code. The current impes mode does
not interact well with timestep_file for instance.
Specifically, allocate storage for 'masstrans' and 'gravtrans' terms
per well completion (perforation), as well as compressible
transmissibilities (scalar per completion). Calculate compressible
quantities by treating each completion as an interface.
Introduce a new structure, 'completion_data', to collect static and
dynamic discretisation data pertaining to each completion (e.g.,
productivity indices, gravity potentials and density ratio
operators). Pass this structure, rather than individual fields, into
affected CFS_TPFA entry points.
Compile tested only.
Specifically, rename the obtuse structure 'disc_data' to the more targeted
'densrat_util' and hoist the compressible terms 'ctrans' and 'P' into
the 'cfs_tpfa_impl' structure. Moreover, rename the remaining fields
into something that makes sense in (almost) isolation. Update
compute_densrat_update() and cfs_tpfa_construct() accordingly.
This is in preparation of adding compressible well terms.
Specifically, only assemble gravity contributions on internal faces or
external Dirichlet faces. Moreover, pay attention to direction of
gravity flux (in/out of cell) during assembly.