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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3014 - (hide annotations)
Wed Apr 28 04:05:21 2010 UTC (9 years, 7 months ago) by gross
File MIME type: text/plain
File size: 3248 byte(s)
a more stable handling of divergence in the CN or BE
1 gross 2987
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 gross 3014 #define DT_FACTOR_MAX 100000.
19 gross 2987
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 useBackwardEuler;
28    
29     bool_t valid_matrices;
30 gross 3014 double dt_max; /* safe time step size */
31     double dt_failed;
32    
33     /****************** REVISE ****************************/
34 gross 2987 double dt_factor;
35 gross 3014
36 gross 2987 double constraint_factor;
37     double* constraint_weights;
38     /*****************************************************/
39    
40     Paso_SystemMatrix * transport_matrix;
41     Paso_SystemMatrix * mass_matrix;
42    
43     Paso_Coupler* u_coupler;
44     Paso_SystemMatrix * iteration_matrix;
45     double* main_diagonal_low_order_transport_matrix;
46     double* lumped_mass_matrix;
47 gross 3005 double* reactive_matrix;
48     double* main_diagonal_mass_matrix;
49 gross 2987
50     Paso_MPIInfo *mpi_info;
51     dim_t reference_counter;
52    
53     } Paso_TransportProblem;
54    
55    
56    
57     PASO_DLL_API
58     Paso_TransportProblem* Paso_TransportProblem_getReference(Paso_TransportProblem* in);
59    
60     PASO_DLL_API
61     Paso_TransportProblem* Paso_TransportProblem_alloc(bool_t useBackwardEuler, Paso_SystemMatrixPattern *pattern, int block_size);
62    
63     PASO_DLL_API
64     dim_t Paso_TransportProblem_getBlockSize(const Paso_TransportProblem* in);
65    
66     PASO_DLL_API
67     double Paso_TransportProblem_getSafeTimeStepSize(Paso_TransportProblem* in);
68    
69     PASO_DLL_API
70     Paso_SystemMatrix* Paso_TransportProblem_borrowTransportMatrix(Paso_TransportProblem* in);
71    
72     PASO_DLL_API
73     Paso_SystemMatrix* Paso_TransportProblem_borrowMassMatrix(Paso_TransportProblem* in);
74    
75     PASO_DLL_API
76     void Paso_TransportProblem_solve(Paso_TransportProblem* fctp, double* u, double dt, double* u0, double* q, Paso_Options* options);
77    
78     PASO_DLL_API
79     double* Paso_TransportProblem_borrowLumpedMassMatrix(Paso_TransportProblem* in);
80    
81     PASO_DLL_API
82     dim_t Paso_TransportProblem_getTotalNumRows(Paso_TransportProblem* in);
83    
84     PASO_DLL_API
85     void Paso_TransportProblem_free(Paso_TransportProblem* in);
86    
87     PASO_DLL_API
88     void Paso_TransportProblem_reset(Paso_TransportProblem* in);
89    
90     PASO_DLL_API
91     Paso_Connector* Paso_TransportProblem_borrowConnector(const Paso_TransportProblem* in);
92    
93     PASO_DLL_API
94     index_t Paso_TransportProblem_getTypeId(const index_t solver,const index_t preconditioner, const index_t package,const bool_t symmetry, Paso_MPIInfo *mpi_info);
95    
96     PASO_DLL_API
97     void Paso_TransportProblem_insertConstraint(Paso_TransportProblem* fctp, const double* r, double* source);
98    
99    
100     PASO_DLL_API
101     void Paso_TransportProblem_setUpConstraint(Paso_TransportProblem* fctp, const double* q, const double factor);
102    
103 gross 3005 #define Paso_TransportProblem_borrowMainDiagonalPointer(_fct_) Paso_SparseMatrix_borrowMainDiagonalPointer((_fct_)->mass_matrix->mainBlock)
104     #define Paso_Transport_getTheta(_fct_) ( ( (_fct_)->useBackwardEuler ) ? 1. : 0.5 )
105 gross 2987
106     #endif /* #ifndef INC_PASOTRANSPORT */

  ViewVC Help
Powered by ViewVC 1.1.26