Transport.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __PASO_TRANSPORT_H__
#define __PASO_TRANSPORT_H__
#define DT_FACTOR_MAX 100000.
#include "Paso.h"
#include "Options.h"
#include "SystemMatrix.h"
#include <escript/AbstractTransportProblem.h>
namespace paso {
class PASO_DLL_API TransportProblem;
typedef boost::shared_ptr<TransportProblem> TransportProblem_ptr;
typedef boost::shared_ptr<const TransportProblem> const_TransportProblem_ptr;
class PASO_DLL_API TransportProblem : public escript::AbstractTransportProblem,
public boost::enable_shared_from_this<TransportProblem>
{
public:
TransportProblem();
TransportProblem(SystemMatrixPattern_ptr pattern, int blocksize,
const escript::FunctionSpace& functionspace);
~TransportProblem();
virtual void resetTransport(bool preserveSolverData) const;
void solve(double* u, double dt, double* u0, double* q, Options* options);
virtual double getSafeTimeStepSize() const;
virtual double getUnlimitedTimeStepSize() const;
void insertConstraint(const double* r, double* source) const;
void setUpConstraint(const double* q);
inline dim_t getBlockSize() const
{
return transport_matrix->row_block_size;
}
inline SystemMatrix_ptr<double> borrowTransportMatrix() const
{
return transport_matrix;
}
inline SystemMatrix_ptr<double> borrowMassMatrix() const
{
return mass_matrix;
}
inline double* borrowLumpedMassMatrix() const
{
return lumped_mass_matrix;
}
inline dim_t getTotalNumRows() const
{
return transport_matrix->getTotalNumRows();
}
inline Connector_ptr borrowConnector() const
{
return transport_matrix->pattern->col_connector;
}
inline index_t* borrowMainDiagonalPointer() const
{
return mass_matrix->mainBlock->borrowMainDiagonalPointer();
}
inline static int getTypeId(int solver, int preconditioner,
int package, bool symmetry,
const escript::JMPI& mpi_info)
{
return MATRIX_FORMAT_DEFAULT + MATRIX_FORMAT_BLK1;
}
SystemMatrix_ptr<double> transport_matrix;
SystemMatrix_ptr<double> mass_matrix;
SystemMatrix_ptr<double> iteration_matrix;
mutable bool valid_matrices;
mutable double dt_max_R;
mutable double dt_max_T;
mutable double* constraint_mask;
double* main_diagonal_low_order_transport_matrix;
double* lumped_mass_matrix;
double* reactive_matrix;
double* main_diagonal_mass_matrix;
escript::JMPI mpi_info;
private:
virtual void setToSolution(escript::Data& out, escript::Data& u0,
escript::Data& source, double dt,
boost::python::object& options);
virtual void copyConstraint(escript::Data& source, escript::Data& q,
escript::Data& r);
};
} // namespace paso
#endif // __PASO_TRANSPORT_H__
Options.h
Paso.h
MATRIX_FORMAT_BLK1
#define MATRIX_FORMAT_BLK1
Definition: Paso.h:63
MATRIX_FORMAT_DEFAULT
#define MATRIX_FORMAT_DEFAULT
Definition: Paso.h:61
SystemMatrix.h
escript::AbstractTransportProblem
Give a short description of what AbstractTransportProblem does.
Definition: AbstractTransportProblem.h:45
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
escript::FunctionSpace
Definition: FunctionSpace.h:36
paso::TransportProblem
Definition: Transport.h:38
paso::TransportProblem::transport_matrix
SystemMatrix_ptr< double > transport_matrix
Definition: Transport.h:102
paso::TransportProblem::valid_matrices
bool valid_matrices
Definition: Transport.h:106
paso::TransportProblem::mass_matrix
SystemMatrix_ptr< double > mass_matrix
Definition: Transport.h:103
paso::TransportProblem::reactive_matrix
double * reactive_matrix
Definition: Transport.h:118
paso::TransportProblem::getTypeId
static int getTypeId(int solver, int preconditioner, int package, bool symmetry, const escript::JMPI &mpi_info)
Definition: Transport.h:95
paso::TransportProblem::borrowMainDiagonalPointer
index_t * borrowMainDiagonalPointer() const
Definition: Transport.h:90
paso::TransportProblem::borrowMassMatrix
SystemMatrix_ptr< double > borrowMassMatrix() const
Definition: Transport.h:70
paso::TransportProblem::getBlockSize
dim_t getBlockSize() const
Definition: Transport.h:60
paso::TransportProblem::main_diagonal_mass_matrix
double * main_diagonal_mass_matrix
Definition: Transport.h:119
paso::TransportProblem::borrowLumpedMassMatrix
double * borrowLumpedMassMatrix() const
Definition: Transport.h:75
paso::TransportProblem::borrowConnector
Connector_ptr borrowConnector() const
Definition: Transport.h:85
paso::TransportProblem::mpi_info
escript::JMPI mpi_info
Definition: Transport.h:121
paso::TransportProblem::getTotalNumRows
dim_t getTotalNumRows() const
Definition: Transport.h:80
paso::TransportProblem::constraint_mask
double * constraint_mask
Definition: Transport.h:111
paso::TransportProblem::borrowTransportMatrix
SystemMatrix_ptr< double > borrowTransportMatrix() const
Definition: Transport.h:65
paso::TransportProblem::iteration_matrix
SystemMatrix_ptr< double > iteration_matrix
Definition: Transport.h:104
paso::TransportProblem::main_diagonal_low_order_transport_matrix
double * main_diagonal_low_order_transport_matrix
Definition: Transport.h:113
paso::TransportProblem::dt_max_T
double dt_max_T
safe time step size for transport part
Definition: Transport.h:110
paso::TransportProblem::lumped_mass_matrix
double * lumped_mass_matrix
Definition: Transport.h:117
paso::TransportProblem::dt_max_R
double dt_max_R
safe time step size for reactive part
Definition: Transport.h:108
paso::TransportProblem::TransportProblem
TransportProblem()
Default constructor - throws exception.
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
paso
Definition: BiCGStab.cpp:25
paso::TransportProblem_ptr
boost::shared_ptr< TransportProblem > TransportProblem_ptr
Definition: Transport.h:32
paso::SystemMatrix_ptr
boost::shared_ptr< SystemMatrix< T > > SystemMatrix_ptr
Definition: SystemMatrix.h:42
paso::SystemMatrixPattern_ptr
boost::shared_ptr< SystemMatrixPattern > SystemMatrixPattern_ptr
Definition: SystemMatrixPattern.h:40
paso::Connector_ptr
boost::shared_ptr< Connector > Connector_ptr
Definition: Coupler.h:38
paso::const_TransportProblem_ptr
boost::shared_ptr< const TransportProblem > const_TransportProblem_ptr
Definition: Transport.h:34
PASO_DLL_API
#define PASO_DLL_API
Definition: paso/src/system_dep.h:29
paso::Options
Definition: Options.h:80