/[escript]/branches/symbolic_from_3470/paso/src/Transport.h
ViewVC logotype

Contents of /branches/symbolic_from_3470/paso/src/Transport.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3868 - (show annotations)
Thu Mar 15 06:07:08 2012 UTC (7 years, 1 month ago) by caltinay
File MIME type: text/plain
File size: 3763 byte(s)
Update to latest trunk

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 double* constraint_mask;
31
32 Paso_SystemMatrix * transport_matrix;
33 Paso_SystemMatrix * mass_matrix;
34
35 Paso_SystemMatrix * iteration_matrix;
36 double* main_diagonal_low_order_transport_matrix;
37 double* lumped_mass_matrix; /* 'relevant' lumped mass matrix is assumed to be positive.
38 values with corresponding constraint_mask>0 value are set to -1
39 to indicate the value infinity */
40 double* reactive_matrix;
41 double* main_diagonal_mass_matrix;
42
43 Esys_MPIInfo *mpi_info;
44 dim_t reference_counter;
45
46 } Paso_TransportProblem;
47
48
49
50 PASO_DLL_API
51 Paso_TransportProblem* Paso_TransportProblem_getReference(Paso_TransportProblem* in);
52
53 PASO_DLL_API
54 Paso_TransportProblem* Paso_TransportProblem_alloc(Paso_SystemMatrixPattern *pattern, int block_size);
55
56 PASO_DLL_API
57 dim_t Paso_TransportProblem_getBlockSize(const Paso_TransportProblem* in);
58
59 PASO_DLL_API
60 double Paso_TransportProblem_getSafeTimeStepSize(Paso_TransportProblem* in);
61
62 PASO_DLL_API
63 Paso_SystemMatrix* Paso_TransportProblem_borrowTransportMatrix(Paso_TransportProblem* in);
64
65 PASO_DLL_API
66 Paso_SystemMatrix* Paso_TransportProblem_borrowMassMatrix(Paso_TransportProblem* in);
67
68 PASO_DLL_API
69 void Paso_TransportProblem_solve(Paso_TransportProblem* fctp, double* u, double dt, double* u0, double* q, Paso_Options* options);
70
71 PASO_DLL_API
72 double* Paso_TransportProblem_borrowLumpedMassMatrix(Paso_TransportProblem* in);
73
74 PASO_DLL_API
75 dim_t Paso_TransportProblem_getTotalNumRows(Paso_TransportProblem* in);
76
77 PASO_DLL_API
78 void Paso_TransportProblem_free(Paso_TransportProblem* in);
79
80 PASO_DLL_API
81 void Paso_TransportProblem_reset(Paso_TransportProblem* in);
82
83 PASO_DLL_API
84 Paso_Connector* Paso_TransportProblem_borrowConnector(const Paso_TransportProblem* in);
85
86 PASO_DLL_API
87 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);
88
89 PASO_DLL_API
90 void Paso_TransportProblem_insertConstraint(Paso_TransportProblem* fctp, const double* r, double* source);
91
92
93 PASO_DLL_API
94 void Paso_TransportProblem_setUpConstraint(Paso_TransportProblem* fctp, const double* q);
95
96 #define Paso_TransportProblem_borrowMainDiagonalPointer(_fct_) Paso_SparseMatrix_borrowMainDiagonalPointer((_fct_)->mass_matrix->mainBlock)
97 #define Paso_TransportProblem_getBlockSize(__in__) (__in__)->transport_matrix->row_block_size
98 #define Paso_TransportProblem_borrowConnector(__in__) (__in__)->transport_matrix->pattern->col_connector
99 #define Paso_TransportProblem_borrowTransportMatrix(__in__) (__in__)->transport_matrix
100 #define Paso_TransportProblem_borrowMassMatrix(__in__) (__in__)->mass_matrix
101 #define Paso_TransportProblem_borrowLumpedMassMatrix(__in__) (__in__)->lumped_mass_matrix
102 #define Paso_TransportProblem_getTotalNumRows(__in__) Paso_SystemMatrix_getTotalNumRows((__in__)->transport_matrix)
103
104
105
106
107 #endif /* #ifndef INC_PASOTRANSPORT */

  ViewVC Help
Powered by ViewVC 1.1.26