Commit Graph

57 Commits

Author SHA1 Message Date
Bård Skaflestad
da683da206 Add a simple saturation dump using vector_write() from OPMPressure. 2011-10-06 15:12:43 +02:00
Bård Skaflestad
c56215bdcd Use control parameters that don't lead to singular matrices. 2011-10-06 15:07:00 +02:00
Bård Skaflestad
b0e35ca07a Honour ImplicitTransport requirement introduced in cset af1c979d2947.
We need to define a coefficient matrix clearing operator.
2011-10-06 15:02:15 +02:00
Bård Skaflestad
b867283f05 Fill semantic hole in initIteration(). Store the current sat-change.
This is needed to implement the accumulation term of the residual.
2011-10-06 14:57:46 +02:00
Bård Skaflestad
255a0cf6ee Clear coefficient matrix and residual between assemblies.
Request that the user specify a suitable operator for clearing the
coefficient matrix, and call it just prior to assemble().
2011-10-06 14:54:02 +02:00
Bård Skaflestad
711e59df4c Insert glue for zeroing the coefficient matrix between Jacobian assemblies.
Specifically, request availability of a read/write access to the
Jacobian matrix, and a means to zeroing the elements of an arbitrary
matrix type (unimplemented 'MatrixZero' template class).
2011-10-06 14:51:51 +02:00
Bård Skaflestad
ff8518e55e Restore build assertion that is once more valid following cset dd4a755bc683.
Also, implement a function for zeroing a CSRMatrix, and create a
read/write reference to the underlying matrix.  Needed for clearing
the coefficient matrix between each Jacobian assembly.
2011-10-06 14:48:51 +02:00
Bård Skaflestad
7f766149b3 Order parameters correctly.
If the cell were a type other than a primitive 'int', this would have
been caught by the compiler...
2011-10-06 10:27:35 +02:00
Bård Skaflestad
a5220bcd29 Build entire system structure once, at createSystem() time.
This leads to two grid passes if the problem is linear, but saves
rebuilding the same structure at every Newton iteration.
2011-10-06 00:34:04 +02:00
Bård Skaflestad
230bc99cee Remove another incorrect assertion relating to system size. 2011-10-06 00:31:40 +02:00
Bård Skaflestad
4df2677024 Remove an incorrect assertion.
The statement is only correct during the very first grid pass whilst
constructing the matrix.  Source terms are added later, in arbitrary
order, and we cannot know (in assembleBlock) what (block) rows are
affected by such contributions.
2011-10-06 00:05:04 +02:00
Bård Skaflestad
72f81cf574 Hook 'examples' up to build. 2011-10-05 20:09:29 +02:00
Bård Skaflestad
5202631f34 Move to reference-storing rather than private inheritance model.
Fix various build problems while here.

Finally, add default Newton-control parameters to the NRControl structure.
2011-10-05 20:09:15 +02:00
Bård Skaflestad
72953ac126 Add an example program demonstrating the use of the ImplicitTransport solver.
Building contingent upon availability of both OPMPressure *and* UMFPACK.
2011-10-05 20:06:03 +02:00
Bård Skaflestad
b1f35c50b1 Add a POD representation of transport problem source terms. 2011-10-05 20:04:21 +02:00
Bård Skaflestad
8fa1eecce6 Import Jostein R. Natvig's implementation of a Cartesian grid. 2011-10-05 20:03:43 +02:00
Bård Skaflestad
f1c44286cc Import glue code for calling into UMFPACK using an OPMPressure CSRMatrix. 2011-10-05 20:03:07 +02:00
Bård Skaflestad
903c959252 Add an overload suited to pointer arguments (primitive types). 2011-10-05 19:54:12 +02:00
Bård Skaflestad
f72be4bf80 Import std::abs() overloads. 2011-10-05 19:53:13 +02:00
Bård Skaflestad
77894bdf88 Expose zero() method in VectorZero functor. 2011-10-05 19:52:11 +02:00
Bård Skaflestad
8256d4a248 Move tests to a separate directory, 'tests'.
Add a test to demonstrate features of the 'JacobianSystem'.
2011-10-05 10:23:49 +02:00
Bård Skaflestad
1e9a26c759 Catch up to changing interface of JacobianSystem class.
While here, allow user to override policies for negating a vector and
zeroing the vector.  Moreover, the JacobianSystem no longer assumes
responsibility for solving the Jacobian system of linear equations, so
accept a linear solver parameter in solve().
2011-10-04 21:31:35 +02:00
Bård Skaflestad
b0c91979a3 Catch up to changing interface of JacobianSystem class. 2011-10-04 21:29:15 +02:00
Bård Skaflestad
321f84b4f6 Separate handling of NR vectors out to new class NewtonVectorCollection.
The class is parametrised on policies for setting the size of
individual vectors, adding two vectors, and assembling local
contributions into the residual vector.

Provide default implementations of these policies, suitable for
base-vectors that implement (some of) the std::vector<T> interface.
2011-10-04 21:27:57 +02:00
Bård Skaflestad
5207b20058 Add a few simple norm implementation based on accumulation. 2011-10-04 21:23:56 +02:00
Bård Skaflestad
4477af094d Fix build. 2011-10-04 21:22:54 +02:00
Bård Skaflestad
0d43b21f9a Work around different 'const' rules in C. 2011-10-04 21:21:30 +02:00
Bård Skaflestad
5f475fe5cf Properly close namespaces... 2011-10-04 19:54:32 +02:00
Bård Skaflestad
9ce211f058 Don't reference unneeded interfaces. 2011-10-04 10:10:44 +02:00
Bård Skaflestad
2b301b448c Add a block assembler and solver for OPMPressure's CSRMatrix.
Solver based on UMFPACK.
2011-10-03 18:17:58 +02:00
Bård Skaflestad
60bdba1433 Add detection and optional support for UMFPACK and OPMPressure. 2011-10-03 18:16:57 +02:00
Bård Skaflestad
54b59bcb98 Catch up to renaming row_structure_ -> connections_ . 2011-10-03 17:15:00 +02:00
Bård Skaflestad
d9aa8888ea Relinquish row/nnz control to linsys assembler.
Pass the scalar number of rows and non-zeros into .setSize() along
with the number of degrees of freedom per cell.  This allows the
assembler to impose block structure in an optimal way for each
particular type of linear system.
2011-10-03 12:47:33 +02:00
Bård Skaflestad
d5010efdba Solvers need to be fully formed objects. Store references.
For instance, an iterative linear solver is likely to need some kind
of stopping criterion and the implicit solver should not be tasked
with defining the criterion.
2011-10-03 11:21:41 +02:00
Bård Skaflestad
8769665658 DefaultNewtonVector: Allow outside access to the wrapped base vector.
Should be used sparingly, but is needed, e.g., to solve systems of
linear equations.
2011-10-02 19:11:05 +02:00
Bård Skaflestad
d307fdddb2 Implement solution of linear systems.
Defer actual mechanism to user-defined 'LinSolve' operation.
2011-10-02 17:03:38 +02:00
Bård Skaflestad
b5da41a8f5 Provide indexing support and 'const'ify the norm(). 2011-10-01 11:12:11 +02:00
Bård Skaflestad
150d8b49b5 Add a trivial set of containment classes defining a Jacobian system. 2011-09-30 22:54:47 +02:00
Bård Skaflestad
166ec7bdab Add a simple test fluid conforming to SinglePoint* interface.
Accompanied by demonstration programme.  Not integrated into build
system.
2011-09-30 16:39:14 +02:00
Bård Skaflestad
d586edeecc Implement Newton-Raphson hooks. 2011-09-30 11:37:14 +02:00
Bård Skaflestad
ec5555be36 Conform to file head conventions. 2011-09-30 11:35:38 +02:00
Bård Skaflestad
a197c43cd7 Conform to convention regarding file head. 2011-09-30 10:14:01 +02:00
Bård Skaflestad
a4e5374c91 Add a trivial top-level implicit solver (NR iteration). 2011-09-29 20:47:06 +02:00
Bård Skaflestad
33f1fe344e Switch to design based on deriving from 'Model'. 2011-09-29 20:46:40 +02:00
Bård Skaflestad
a30a9c0941 Derive from 'Model' in stead of partially reading from it. 2011-09-29 20:46:14 +02:00
Bård Skaflestad
43c6e00109 Add trivial, partial implementation of an implicit solver. 2011-09-28 21:03:17 +02:00
Bård Skaflestad
3094159bd6 Expand 'ignore' list with a few more auto-generated files. 2011-09-28 14:28:40 +02:00
Bård Skaflestad
f8f6bba0cd Enable silent build rules if available in Automake.
Automake 1.11 introduced the concept of "silent build rules" wherein the
build commands are reported as

  CC     spu_explicit.lo

rather than something along the lines of

  /bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../../../opmtransport/src -I..     -O3 -DNDEBUG -Wall -Wextra -std=c99 -pedantic -march=native -mtune=native -MT spu_explicit.lo -MD -MP -MF .deps/spu_explicit.Tpo -c -o spu_explicit.lo ../../../../../opmtransport/src/spu_explicit.c
  libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../../opmtransport/src -I.. -O3 -DNDEBUG -Wall -Wextra -std=c99 -pedantic -march=native -mtune=native -MT spu_explicit.lo -MD -MP -MF .deps/spu_explicit.Tpo -c ../../../../../opmtransport/src/spu_explicit.c  -fPIC -DPIC -o .libs/spu_explicit.o
  libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../../opmtransport/src -I.. -O3 -DNDEBUG -Wall -Wextra -std=c99 -pedantic -march=native -mtune=native -MT spu_explicit.lo -MD -MP -MF .deps/spu_explicit.Tpo -c ../../../../../opmtransport/src/spu_explicit.c -o spu_explicit.o >/dev/null 2>&1

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#Options
  http://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 .
2011-05-27 15:05:02 +02:00
Bård Skaflestad
0dc0be4cad Use more traditional spelling of static function declaration. 2010-12-05 13:52:03 +01:00
Jostein R. Natvig
9e3bf5ebe2 Implement simple Newton iteration. 2010-11-19 13:32:36 +01:00