ESYS13
Revision_
|
00001 00002 /******************************************************* 00003 * 00004 * Copyright (c) 2003-2012 by University of Queensland 00005 * Earth Systems Science Computational Center (ESSCC) 00006 * http://www.uq.edu.au/esscc 00007 * 00008 * Primary Business: Queensland, Australia 00009 * Licensed under the Open Software License version 3.0 00010 * http://www.opensource.org/licenses/osl-3.0.php 00011 * 00012 *******************************************************/ 00013 00014 00015 #ifndef INC_PASOTRANSPORT 00016 #define INC_PASOTRANSPORT 00017 00018 #define DT_FACTOR_MAX 100000. 00019 00020 #include "SystemMatrix.h" 00021 #include "Options.h" 00022 #include "performance.h" 00023 #include "Paso.h" 00024 00025 typedef struct Paso_TransportProblem { 00026 00027 bool_t valid_matrices; 00028 double dt_max_R; /* safe time step size for reactive part */ 00029 double dt_max_T; /* safe time step size for transport part */ 00030 double* constraint_mask; 00031 00032 Paso_SystemMatrix * transport_matrix; 00033 Paso_SystemMatrix * mass_matrix; 00034 00035 Paso_SystemMatrix * iteration_matrix; 00036 double* main_diagonal_low_order_transport_matrix; 00037 double* lumped_mass_matrix; /* 'relevant' lumped mass matrix is assumed to be positive. 00038 values with corresponding constraint_mask>0 value are set to -1 00039 to indicate the value infinity */ 00040 double* reactive_matrix; 00041 double* main_diagonal_mass_matrix; 00042 00043 Esys_MPIInfo *mpi_info; 00044 dim_t reference_counter; 00045 00046 } Paso_TransportProblem; 00047 00048 00049 00050 PASO_DLL_API 00051 Paso_TransportProblem* Paso_TransportProblem_getReference(Paso_TransportProblem* in); 00052 00053 PASO_DLL_API 00054 Paso_TransportProblem* Paso_TransportProblem_alloc(Paso_SystemMatrixPattern *pattern, int block_size); 00055 00056 PASO_DLL_API 00057 dim_t Paso_TransportProblem_getBlockSize(const Paso_TransportProblem* in); 00058 00059 PASO_DLL_API 00060 double Paso_TransportProblem_getSafeTimeStepSize(Paso_TransportProblem* in); 00061 00062 PASO_DLL_API 00063 Paso_SystemMatrix* Paso_TransportProblem_borrowTransportMatrix(Paso_TransportProblem* in); 00064 00065 PASO_DLL_API 00066 Paso_SystemMatrix* Paso_TransportProblem_borrowMassMatrix(Paso_TransportProblem* in); 00067 00068 PASO_DLL_API 00069 void Paso_TransportProblem_solve(Paso_TransportProblem* fctp, double* u, double dt, double* u0, double* q, Paso_Options* options); 00070 00071 PASO_DLL_API 00072 double* Paso_TransportProblem_borrowLumpedMassMatrix(Paso_TransportProblem* in); 00073 00074 PASO_DLL_API 00075 dim_t Paso_TransportProblem_getTotalNumRows(Paso_TransportProblem* in); 00076 00077 PASO_DLL_API 00078 void Paso_TransportProblem_free(Paso_TransportProblem* in); 00079 00080 PASO_DLL_API 00081 void Paso_TransportProblem_reset(Paso_TransportProblem* in); 00082 00083 PASO_DLL_API 00084 Paso_Connector* Paso_TransportProblem_borrowConnector(const Paso_TransportProblem* in); 00085 00086 PASO_DLL_API 00087 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); 00088 00089 PASO_DLL_API 00090 void Paso_TransportProblem_insertConstraint(Paso_TransportProblem* fctp, const double* r, double* source); 00091 00092 00093 PASO_DLL_API 00094 void Paso_TransportProblem_setUpConstraint(Paso_TransportProblem* fctp, const double* q); 00095 00096 #define Paso_TransportProblem_borrowMainDiagonalPointer(_fct_) Paso_SparseMatrix_borrowMainDiagonalPointer((_fct_)->mass_matrix->mainBlock) 00097 #define Paso_TransportProblem_getBlockSize(__in__) (__in__)->transport_matrix->row_block_size 00098 #define Paso_TransportProblem_borrowConnector(__in__) (__in__)->transport_matrix->pattern->col_connector 00099 #define Paso_TransportProblem_borrowTransportMatrix(__in__) (__in__)->transport_matrix 00100 #define Paso_TransportProblem_borrowMassMatrix(__in__) (__in__)->mass_matrix 00101 #define Paso_TransportProblem_borrowLumpedMassMatrix(__in__) (__in__)->lumped_mass_matrix 00102 #define Paso_TransportProblem_getTotalNumRows(__in__) Paso_SystemMatrix_getTotalNumRows((__in__)->transport_matrix) 00103 00104 00105 00106 00107 #endif /* #ifndef INC_PASOTRANSPORT */