Commit Graph

196 Commits

Author SHA1 Message Date
Bård Skaflestad
0eb32742d4 Include <cassert> to bring in declaration of assert() 2013-02-20 12:59:40 +01:00
Bård Skaflestad
a39e5a1366 Use an integer type for "maxit_" counter.
The "maxit_" counter is an upper limit on the number of non-linear
iterations in a single cell.  Declaring this as a "double" is counter
intuitive unless one expects the number to be *really* high.

Present since
  - Commit 93d4bd8 (TransportModelTwophase.hpp)
  - Commit e0d38cf (TransportModelTwophaseCompressible.hpp)
2013-02-19 11:27:54 +01:00
Bård Skaflestad
edeb9d7551 Replace an assignment with intended equality test
This corrects a latent error that has been present since the inception
of this module.
2013-02-01 16:30:45 +01:00
Bård Skaflestad
089988aa16 Eliminate redundant explicit type conversion.
The pointers in question are already type 'int *'.  There is no need to
explicitly convert them to that type too.
2013-02-01 16:25:46 +01:00
Bård Skaflestad
cf922e73ce Eliminate release-mode build warning.
The 'cbottom' variable is only used within an assert().  Don't define
the variable in release (i.e., "NDEBUG") mode.
2013-02-01 16:15:35 +01:00
Bård Skaflestad
8f6be16ac3 Use portable method of zeroing vector of ints.
The memset() technique is only applicable to platforms for which
numerical zero is represented by all bits zero.
2013-02-01 16:06:39 +01:00
Atgeirr Flø Rasmussen
b719bc8b1e Added evalFunc() method.
This public method is not virtual, and implemented in the base class using calls to
the virtual methods. Not yet used by the DG solver.
2013-01-23 09:51:30 +01:00
Atgeirr Flø Rasmussen
5bdaeeafa0 Refactored applyMinUpwindLimiter(). 2013-01-23 09:50:25 +01:00
Atgeirr Flø Rasmussen
940f1299a9 Add methods totalFlux() and minCornerVal().
Also started refactoring applyMinUpwindLimiter() using the
added methods.
2013-01-21 14:55:27 +01:00
Atgeirr Flø Rasmussen
dc50e61a01 Use functionAverage() instead of direct coefficient access.
This fixes the issue with limiters on multilinear basis.
2013-01-21 11:09:43 +01:00
Atgeirr Flø Rasmussen
de66f358b0 Added functionAverage() method to DGBasis classes. 2013-01-21 11:09:07 +01:00
Atgeirr Flø Rasmussen
1113e65eec Refactored limiter functions.
The two limiter functions were very similar, and were unified in a single
method, with a bool argument to choose method variety.
2013-01-21 10:46:06 +01:00
Atgeirr Flø Rasmussen
c3f9e64c9c Complete separation of basis func classes.
Also:
 - Add use_tensorial_basis parameter allowing run-time choice of basis.
 - Remove degree argument from solveTof() method, degree is instead obtained
   from parameters in constructors. Modified compute_tof* programs to match.
2013-01-16 15:13:45 +01:00
Atgeirr Flø Rasmussen
fb060da933 Implement (empty) virtual destructor, make methods public. 2013-01-16 15:11:46 +01:00
Atgeirr Flø Rasmussen
564db5df87 Increased quadrature order in a term.
This is for the benefit of bi/tri-linear basis functions, as stated
in the comments.
2013-01-16 13:45:15 +01:00
Atgeirr Flø Rasmussen
33cc611ced Moved DG basis to separate classes in its own file.
Also introduced interface (base) class and changed the api, not used yet by the tof solver.
2013-01-16 13:38:02 +01:00
Atgeirr Flø Rasmussen
52c164040a Add methods addConstant() and multiplyGradient() to multilinear basis.
Not tested yet, though.
2013-01-15 20:44:28 +01:00
Atgeirr Flø Rasmussen
d822b92e1c Implement limiters with addConstant() and multiplyGradient().
This is instead of directly manipulating the coefficients, requiring
assumptions on the basis used.
2013-01-15 13:52:44 +01:00
Atgeirr Flø Rasmussen
ae2016e063 Added addConstant() and multiplyGradient() methods.
So far only to class DGBasisBoundedTotalDegree.
2013-01-15 13:44:18 +01:00
Atgeirr Flø Rasmussen
b5a2556df7 Added class DGBasisMultilin.
Multilinear DG1 basis functions added. Will not work with current limiter.
2013-01-15 13:42:05 +01:00
Atgeirr Flø Rasmussen
4000eeaef6 Reduce source sum failure from error to warning.
Should extend to sum over sources and boundaries before reinstating.
2013-01-15 13:39:35 +01:00
Atgeirr Flø Rasmussen
a2f2fcdfbb Renamed class DGBasis -> DGBasisBoundedTotalDegree. 2013-01-15 13:37:39 +01:00
Atgeirr Flø Rasmussen
6e716db0f9 Do not require unnecessary high quadrature precision. 2013-01-15 13:33:55 +01:00
Atgeirr Flø Rasmussen
d670f37131 Added (disabled) extra output for debugging purposes.
Enable by defining EXTRA_VERBOSE.
2013-01-15 13:17:43 +01:00
Atgeirr Flø Rasmussen
b25f81cf58 Do not assume that the first basis function is the constant 1.
Properly integrate b_i * porosity over the cell for all basis functions b_i.
2013-01-15 13:10:09 +01:00
Atgeirr Flø Rasmussen
33e9952074 Added MinUpwindAverage limiter method, made it default. 2013-01-08 16:00:17 +01:00
Atgeirr Flø Rasmussen
9df613913e Documented new available limiting options in constructor doc. 2013-01-08 13:34:50 +01:00
Atgeirr Flø Rasmussen
67fc1074de Change constructor to take ParameterGroup argument.
Also make tof to limit against >= 0.0, for case when upstream cell values go
below zero.

Disabled some debug output.
2013-01-08 13:14:26 +01:00
Atgeirr Flø Rasmussen
d6596a87af Improvements to DG1 flux limiter.
Skeleton in place for increased flexibility in methods and usage.
(So far behaviour choices are hardcoded, though.)
Added relative flux thresholding to existing limiter to avoid flux noise
strongly affecting solution. For example no-flow boundaries could be treated
as inflow boundaries and make the minimum upwind face limiter meaningless.
2013-01-08 11:04:43 +01:00
Atgeirr Flø Rasmussen
86eb45bd88 Add methods sequence() and components(). 2013-01-08 11:04:07 +01:00
Atgeirr Flø Rasmussen
cf9fdbbd76 Simplify and correct implementation of limiter.
Now we check all corners' tof values for the cell under consideration,
not just the inflow face corners'.
2013-01-07 15:48:47 +01:00
Atgeirr Flø Rasmussen
7e49c1a475 Bugfix, again: it was correct to take the maximum, reinstating.
There is a different problem that needs fixing, however:
Flux inaccuracies (for example on boundaries) may tag some
face as inflow face for a cell, even if it should have been
no-flow. This may let the cell avoid limiting, even though it
should have been limited according to the proper inflow faces.
2013-01-07 15:10:43 +01:00
Atgeirr Flø Rasmussen
59441f188a Bugfix: take minimum of allowed slopes, not maximum. 2013-01-04 19:59:05 +01:00
Atgeirr Flø Rasmussen
564b13d0c1 Added solveTofTracer() method. 2013-01-03 14:07:51 +01:00
Atgeirr Flø Rasmussen
0f861e64ed Limiter now works reasonably well.
Case with no inflow faces should be checked.
2012-12-20 18:03:08 +01:00
Atgeirr Flø Rasmussen
668aba9942 Added limiter for DG1, parameter 'use_limiter'.
The limiter is experimental and unfinished, untested work in progress.
Limiter is therefore inactive by default.

Also fixed a minor bug: use_cvi_ was not initialized.
2012-12-18 14:15:31 +01:00
Atgeirr Flø Rasmussen
d8de94a5da Bugfix: use sufficient quadrature order. 2012-12-18 14:12:56 +01:00
Atgeirr Flø Rasmussen
91f9b3c2de Modify precision for quadrature depending on use of CVI method. 2012-12-06 10:18:57 +01:00
Atgeirr Flø Rasmussen
ec716fe1d8 No longer ignores boundary fluxes.
This means that the class does expect source terms that are just that, and not
'transport source' terms that include boundary inflows (like the transport
solvers expect). This is also consistent with the behaviour of the DG version.
2012-12-05 10:39:00 +01:00
Atgeirr Flø Rasmussen
8132cb21b9 Adapt to moved [Cell|Face]Quadrature classes.
Also fix a minor issue with potentially buggy error output after LAPACK failure.
2012-12-04 16:11:05 +01:00
Atgeirr Flø Rasmussen
2b0e570842 Make explicit intention to do nothing on empty input. 2012-11-15 08:54:45 +01:00
Atgeirr Flø Rasmussen
e17d5e6499 Remove unneeded assert().
Function is safe to call with empty vectors.
2012-11-14 15:30:25 +01:00
Atgeirr Flø Rasmussen
51bbc85a26 Bugfix tof computations with multidimensional upwinding.
Cell tof depends on downwind face tof in a more complicated way
with multidim upwinding, this was not done correctly.
2012-11-05 14:26:00 +01:00
Atgeirr Flø Rasmussen
3325d4ef39 Implemented multidimensional upwinding.
The 'SMU' variant is chosen for its smoothness.
2012-10-30 13:10:50 +01:00
Atgeirr Flø Rasmussen
020f452a28 Added parameters for controlling use of multidim upwinding.
For now, you will simply get SPU even with use_multidim_upwind=true.
2012-10-29 17:23:17 +01:00
Atgeirr Flø Rasmussen
f9efd72ecc Fix output in case of LAPACK error.
Make copy of matrix before calling dgesv, since it will overwrite it.
2012-10-17 12:40:43 +02:00
Atgeirr Flø Rasmussen
7cf412340b Use new velocity interpolation interface.
The class TransportModelTracerTofDiscGal now uses
VelocityInterpolationInterface, and acts as a factory
internally, choosing an interpolation method depending on
the parameter 'use_cvi'.
2012-10-16 11:11:33 +02:00
Atgeirr Flø Rasmussen
ae04319fa3 Whitespace cleanup. 2012-10-09 12:21:17 +02:00
Atgeirr Flø Rasmussen
f761e73eae Improve docs and give more info on error. 2012-10-09 09:54:54 +02:00
Atgeirr Flø Rasmussen
d1be859828 Add timing of topological sort. 2012-10-09 09:54:26 +02:00