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

Revision 4829 - (show annotations)
Thu Apr 3 04:02:53 2014 UTC (5 years, 5 months ago) by caltinay
File MIME type: text/plain
File size: 3935 byte(s)
```checkpointing some SparseMatrix cleanup.

```
 1 2 /***************************************************************************** 3 * 4 * Copyright (c) 2003-2014 by University of Queensland 5 * http://www.uq.edu.au 6 * 7 * Primary Business: Queensland, Australia 8 * Licensed under the Open Software License version 3.0 9 * http://www.opensource.org/licenses/osl-3.0.php 10 * 11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC) 12 * Development 2012-2013 by School of Earth Sciences 13 * Development from 2014 by Centre for Geoscience Computing (GeoComp) 14 * 15 *****************************************************************************/ 16 17 18 #ifndef INC_PASOTRANSPORT 19 #define INC_PASOTRANSPORT 20 21 #define DT_FACTOR_MAX 100000. 22 23 #include "SystemMatrix.h" 24 #include "Options.h" 25 #include "performance.h" 26 #include "Paso.h" 27 28 typedef struct Paso_TransportProblem { 29 30 bool valid_matrices; 31 double dt_max_R; /* safe time step size for reactive part */ 32 double dt_max_T; /* safe time step size for transport part */ 33 double* constraint_mask; 34 35 Paso_SystemMatrix * transport_matrix; 36 Paso_SystemMatrix * mass_matrix; 37 38 Paso_SystemMatrix * iteration_matrix; 39 double* main_diagonal_low_order_transport_matrix; 40 double* lumped_mass_matrix; /* 'relevant' lumped mass matrix is assumed to be positive. 41 values with corresponding constraint_mask>0 value are set to -1 42 to indicate the value infinity */ 43 double* reactive_matrix; 44 double* main_diagonal_mass_matrix; 45 46 Esys_MPIInfo *mpi_info; 47 dim_t reference_counter; 48 49 } Paso_TransportProblem; 50 51 52 53 PASO_DLL_API 54 Paso_TransportProblem* Paso_TransportProblem_getReference(Paso_TransportProblem* in); 55 56 PASO_DLL_API 57 Paso_TransportProblem* Paso_TransportProblem_alloc(paso::SystemMatrixPattern_ptr pattern, int block_size); 58 59 PASO_DLL_API 60 dim_t Paso_TransportProblem_getBlockSize(const Paso_TransportProblem* in); 61 62 PASO_DLL_API 63 double Paso_TransportProblem_getSafeTimeStepSize(Paso_TransportProblem* in); 64 65 PASO_DLL_API 66 Paso_SystemMatrix* Paso_TransportProblem_borrowTransportMatrix(Paso_TransportProblem* in); 67 68 PASO_DLL_API 69 Paso_SystemMatrix* Paso_TransportProblem_borrowMassMatrix(Paso_TransportProblem* in); 70 71 PASO_DLL_API 72 void Paso_TransportProblem_solve(Paso_TransportProblem* fctp, double* u, double dt, double* u0, double* q, Paso_Options* options); 73 74 PASO_DLL_API 75 double* Paso_TransportProblem_borrowLumpedMassMatrix(Paso_TransportProblem* in); 76 77 PASO_DLL_API 78 dim_t Paso_TransportProblem_getTotalNumRows(Paso_TransportProblem* in); 79 80 PASO_DLL_API 81 void Paso_TransportProblem_free(Paso_TransportProblem* in); 82 83 PASO_DLL_API 84 void Paso_TransportProblem_reset(Paso_TransportProblem* in); 85 86 PASO_DLL_API 87 paso::Connector* Paso_TransportProblem_borrowConnector(const Paso_TransportProblem* in); 88 89 PASO_DLL_API 90 index_t Paso_TransportProblem_getTypeId(const index_t solver,const index_t preconditioner, const index_t package,const bool symmetry, Esys_MPIInfo *mpi_info); 91 92 PASO_DLL_API 93 void Paso_TransportProblem_insertConstraint(Paso_TransportProblem* fctp, const double* r, double* source); 94 95 96 PASO_DLL_API 97 void Paso_TransportProblem_setUpConstraint(Paso_TransportProblem* fctp, const double* q); 98 99 #define Paso_TransportProblem_borrowMainDiagonalPointer(_fct_) (_fct_)->mass_matrix->mainBlock->borrowMainDiagonalPointer() 100 #define Paso_TransportProblem_getBlockSize(__in__) (__in__)->transport_matrix->row_block_size 101 #define Paso_TransportProblem_borrowConnector(__in__) (__in__)->transport_matrix->pattern->col_connector 102 #define Paso_TransportProblem_borrowTransportMatrix(__in__) (__in__)->transport_matrix 103 #define Paso_TransportProblem_borrowMassMatrix(__in__) (__in__)->mass_matrix 104 #define Paso_TransportProblem_borrowLumpedMassMatrix(__in__) (__in__)->lumped_mass_matrix 105 #define Paso_TransportProblem_getTotalNumRows(__in__) Paso_SystemMatrix_getTotalNumRows((__in__)->transport_matrix) 106 107 108 109 110 #endif /* #ifndef INC_PASOTRANSPORT */