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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6651 - (hide annotations)
Wed Feb 7 02:12:08 2018 UTC (20 months, 2 weeks ago) by jfenwick
File MIME type: text/plain
File size: 3830 byte(s)
Make everyone sad by touching all the files

Copyright dates update

1 gross 2987
2 jfenwick 3981 /*****************************************************************************
3 gross 2987 *
4 jfenwick 6651 * Copyright (c) 2003-2018 by The University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 gross 2987 *
7     * Primary Business: Queensland, Australia
8 jfenwick 6112 * Licensed under the Apache License, version 2.0
9     * http://www.apache.org/licenses/LICENSE-2.0
10 gross 2987 *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 * Development 2012-2013 by School of Earth Sciences
13     * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 jfenwick 3981 *
15     *****************************************************************************/
16 gross 2987
17    
18 caltinay 4867 #ifndef __PASO_TRANSPORT_H__
19     #define __PASO_TRANSPORT_H__
20 gross 2987
21 gross 3014 #define DT_FACTOR_MAX 100000.
22 gross 2987
23 caltinay 6001 #include "Paso.h"
24     #include "Options.h"
25 gross 2987 #include "SystemMatrix.h"
26    
27 caltinay 5929 #include <escript/AbstractTransportProblem.h>
28    
29 caltinay 4867 namespace paso {
30 gross 3014
31 caltinay 5929 class TransportProblem;
32 caltinay 4867 typedef boost::shared_ptr<TransportProblem> TransportProblem_ptr;
33     typedef boost::shared_ptr<const TransportProblem> const_TransportProblem_ptr;
34 caltinay 4836
35 caltinay 5929 class TransportProblem : public escript::AbstractTransportProblem,
36     public boost::enable_shared_from_this<TransportProblem>
37 caltinay 4867 {
38 caltinay 5929 public:
39     /// Default constructor - throws exception
40     TransportProblem();
41    
42     TransportProblem(SystemMatrixPattern_ptr pattern, int blocksize,
43     const escript::FunctionSpace& functionspace);
44    
45 caltinay 4867 ~TransportProblem();
46 gross 2987
47 gross 6441 virtual void resetTransport(bool preserveSolverData) const;
48 gross 2987
49 caltinay 4867 void solve(double* u, double dt, double* u0, double* q, Options* options);
50 gross 2987
51 caltinay 5929 virtual double getSafeTimeStepSize() const;
52 gross 2987
53 caltinay 5929 virtual double getUnlimitedTimeStepSize() const;
54 gross 2987
55 caltinay 5929 void insertConstraint(const double* r, double* source) const;
56    
57 caltinay 4867 void setUpConstraint(const double* q);
58 gross 2987
59 caltinay 4867 inline dim_t getBlockSize() const
60     {
61     return transport_matrix->row_block_size;
62     }
63 gross 2987
64 caltinay 4867 inline SystemMatrix_ptr borrowTransportMatrix() const
65     {
66     return transport_matrix;
67     }
68 gross 2987
69 caltinay 4867 inline SystemMatrix_ptr borrowMassMatrix() const
70     {
71     return mass_matrix;
72     }
73 gross 2987
74 caltinay 4867 inline double* borrowLumpedMassMatrix() const
75     {
76     return lumped_mass_matrix;
77     }
78 gross 2987
79 caltinay 4867 inline dim_t getTotalNumRows() const
80     {
81     return transport_matrix->getTotalNumRows();
82     }
83 gross 2987
84 caltinay 4867 inline Connector_ptr borrowConnector() const
85     {
86     return transport_matrix->pattern->col_connector;
87     }
88 gross 2987
89 caltinay 4867 inline index_t* borrowMainDiagonalPointer() const
90     {
91     return mass_matrix->mainBlock->borrowMainDiagonalPointer();
92     }
93 gross 2987
94 caltinay 5929 inline static int getTypeId(int solver, int preconditioner,
95     int package, bool symmetry,
96 caltinay 5997 const escript::JMPI& mpi_info)
97 caltinay 4867 {
98     return MATRIX_FORMAT_DEFAULT + MATRIX_FORMAT_BLK1;
99     }
100 gross 2987
101 caltinay 4867 SystemMatrix_ptr transport_matrix;
102     SystemMatrix_ptr mass_matrix;
103     SystemMatrix_ptr iteration_matrix;
104 gross 2987
105 caltinay 5929 mutable bool valid_matrices;
106 caltinay 4867 /// safe time step size for reactive part
107 caltinay 5929 mutable double dt_max_R;
108 caltinay 4867 /// safe time step size for transport part
109 caltinay 5929 mutable double dt_max_T;
110     mutable double* constraint_mask;
111 gross 2987
112 caltinay 4867 double* main_diagonal_low_order_transport_matrix;
113     /// 'relevant' lumped mass matrix is assumed to be positive.
114     /// Values with corresponding constraint_mask > 0 value are set to -1
115     /// to indicate the value infinity
116     double* lumped_mass_matrix;
117     double* reactive_matrix;
118     double* main_diagonal_mass_matrix;
119 gross 2987
120 caltinay 5997 escript::JMPI mpi_info;
121 caltinay 5929
122     private:
123     virtual void setToSolution(escript::Data& out, escript::Data& u0,
124     escript::Data& source, double dt,
125     boost::python::object& options);
126    
127     virtual void copyConstraint(escript::Data& source, escript::Data& q,
128     escript::Data& r);
129 caltinay 4867 };
130 gross 2987
131 caltinay 4867 } // namespace paso
132 gross 2987
133 caltinay 4867 #endif // __PASO_TRANSPORT_H__
134 gross 2987

  ViewVC Help
Powered by ViewVC 1.1.26