/[escript]/trunk/paso/src/Transport.h
ViewVC logotype

Contents of /trunk/paso/src/Transport.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3793 - (show annotations)
Wed Feb 1 07:39:43 2012 UTC (7 years, 6 months ago) by gross
File MIME type: text/plain
File size: 3720 byte(s)
new implementation of FCT solver with some modifications to the python interface
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
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 #ifndef INC_PASOTRANSPORT
16 #define INC_PASOTRANSPORT
17
18 #define DT_FACTOR_MAX 100000.
19
20 #include "SystemMatrix.h"
21 #include "Options.h"
22 #include "performance.h"
23 #include "Paso.h"
24
25 typedef struct Paso_TransportProblem {
26
27 bool_t valid_matrices;
28 double dt_max_R; /* safe time step size for reactive part */
29 double dt_max_T; /* safe time step size for transport part */
30
31
32 /****************** REVISE ****************************/
33 double dt_factor;
34 double constraint_factor;
35 double* constraint_weights;
36 /*****************************************************/
37
38 Paso_SystemMatrix * transport_matrix;
39 Paso_SystemMatrix * mass_matrix;
40
41 Paso_SystemMatrix * iteration_matrix;
42 double* main_diagonal_low_order_transport_matrix;
43 double* lumped_mass_matrix;
44 double* reactive_matrix;
45 double* main_diagonal_mass_matrix;
46
47 Esys_MPIInfo *mpi_info;
48 dim_t reference_counter;
49
50 } Paso_TransportProblem;
51
52
53
54 PASO_DLL_API
55 Paso_TransportProblem* Paso_TransportProblem_getReference(Paso_TransportProblem* in);
56
57 PASO_DLL_API
58 Paso_TransportProblem* Paso_TransportProblem_alloc(Paso_SystemMatrixPattern *pattern, int block_size);
59
60 PASO_DLL_API
61 dim_t Paso_TransportProblem_getBlockSize(const Paso_TransportProblem* in);
62
63 PASO_DLL_API
64 double Paso_TransportProblem_getSafeTimeStepSize(Paso_TransportProblem* in);
65
66 PASO_DLL_API
67 Paso_SystemMatrix* Paso_TransportProblem_borrowTransportMatrix(Paso_TransportProblem* in);
68
69 PASO_DLL_API
70 Paso_SystemMatrix* Paso_TransportProblem_borrowMassMatrix(Paso_TransportProblem* in);
71
72 PASO_DLL_API
73 void Paso_TransportProblem_solve(Paso_TransportProblem* fctp, double* u, double dt, double* u0, double* q, Paso_Options* options);
74
75 PASO_DLL_API
76 double* Paso_TransportProblem_borrowLumpedMassMatrix(Paso_TransportProblem* in);
77
78 PASO_DLL_API
79 dim_t Paso_TransportProblem_getTotalNumRows(Paso_TransportProblem* in);
80
81 PASO_DLL_API
82 void Paso_TransportProblem_free(Paso_TransportProblem* in);
83
84 PASO_DLL_API
85 void Paso_TransportProblem_reset(Paso_TransportProblem* in);
86
87 PASO_DLL_API
88 Paso_Connector* Paso_TransportProblem_borrowConnector(const Paso_TransportProblem* in);
89
90 PASO_DLL_API
91 index_t Paso_TransportProblem_getTypeId(const index_t solver,const index_t preconditioner, const index_t package,const bool_t symmetry, Esys_MPIInfo *mpi_info);
92
93 PASO_DLL_API
94 void Paso_TransportProblem_insertConstraint(Paso_TransportProblem* fctp, const double* r, double* source);
95
96
97 PASO_DLL_API
98 void Paso_TransportProblem_setUpConstraint(Paso_TransportProblem* fctp, const double* q, const double factor);
99
100 #define Paso_TransportProblem_borrowMainDiagonalPointer(_fct_) Paso_SparseMatrix_borrowMainDiagonalPointer((_fct_)->mass_matrix->mainBlock)
101 #define Paso_TransportProblem_getBlockSize(__in__) (__in__)->transport_matrix->row_block_size
102 #define Paso_TransportProblem_borrowConnector(__in__) (__in__)->transport_matrix->pattern->col_connector
103 #define Paso_TransportProblem_borrowTransportMatrix(__in__) (__in__)->transport_matrix
104 #define Paso_TransportProblem_borrowMassMatrix(__in__) (__in__)->mass_matrix
105 #define Paso_TransportProblem_borrowLumpedMassMatrix(__in__) (__in__)->lumped_mass_matrix
106 #define Paso_TransportProblem_getTotalNumRows(__in__) Paso_SystemMatrix_getTotalNumRows((__in__)->transport_matrix)
107
108
109
110
111 #endif /* #ifndef INC_PASOTRANSPORT */

  ViewVC Help
Powered by ViewVC 1.1.26