1 |
gross |
1363 |
/* $Id:$ */ |
2 |
|
|
|
3 |
|
|
/******************************************************* |
4 |
|
|
* |
5 |
|
|
* Copyright 2007 by University of Queensland |
6 |
|
|
* |
7 |
|
|
* http://esscc.uq.edu.au |
8 |
|
|
* Primary Business: Queensland, Australia |
9 |
|
|
* Licensed under the Open Software License version 3.0 |
10 |
|
|
* http://www.opensource.org/licenses/osl-3.0.php |
11 |
|
|
* |
12 |
|
|
*******************************************************/ |
13 |
|
|
|
14 |
|
|
/**************************************************************/ |
15 |
|
|
|
16 |
|
|
/* Paso: Flux correction transport solver |
17 |
|
|
* |
18 |
|
|
* solves Mu_t=Du+Ku+q |
19 |
|
|
* |
20 |
|
|
* where is D is diffusive (not checked) |
21 |
|
|
* - D is symmetric |
22 |
|
|
* - row sums are equal to zero. |
23 |
|
|
* and K is the advective part. |
24 |
|
|
* |
25 |
|
|
* u(0) >= 0 |
26 |
|
|
* |
27 |
|
|
* intially fctp->transport_matrix defines the diffusive part |
28 |
|
|
* but the matrix is updated by the adevctive part + artificial diffusion |
29 |
|
|
* |
30 |
|
|
*/ |
31 |
|
|
/**************************************************************/ |
32 |
|
|
|
33 |
|
|
/* Author: l.gross@uq.edu.au */ |
34 |
|
|
|
35 |
|
|
/**************************************************************/ |
36 |
|
|
|
37 |
|
|
#include "Paso.h" |
38 |
|
|
#include "Solver.h" |
39 |
|
|
#include "SolverFCT.h" |
40 |
|
|
#include "escript/blocktimer.h" |
41 |
|
|
|
42 |
|
|
/***********************************************************************************/ |
43 |
|
|
|
44 |
|
|
|
45 |
gross |
1364 |
void Paso_SolverFCT_solve(Paso_FCTransportProblem* fctp, double* u, double dt, double* source, Paso_Options* options) { |
46 |
gross |
1363 |
|
47 |
|
|
if (dt<=0.) { |
48 |
|
|
Paso_setError(TYPE_ERROR,"Paso_SolverFCT_solve: dt must be positive."); |
49 |
|
|
} |
50 |
|
|
if (! fctp->valid_matrices) { |
51 |
|
|
|
52 |
|
|
/* extract the row sum of the advective part */ |
53 |
|
|
Paso_SystemMatrix_rowSum(fctp->flux_matrix,fctp->row_sum_flux_matrix); |
54 |
|
|
|
55 |
|
|
/* add the advective part + artificial diffusion to the diffusive part */ |
56 |
|
|
Paso_FCTransportProblem_addAdvectivePart(fctp,1.); |
57 |
|
|
|
58 |
|
|
if (Paso_noError()) fctp->valid_matrices=TRUE; |
59 |
|
|
} |
60 |
|
|
|
61 |
|
|
} |