escript  Revision_
AbstractAssembler.h
Go to the documentation of this file.
00001 
00002 /*****************************************************************************
00003 *
00004 * Copyright (c) 2003-2014 by University of Queensland
00005 * http://www.uq.edu.au
00006 *
00007 * Primary Business: Queensland, Australia
00008 * Licensed under the Open Software License version 3.0
00009 * http://www.opensource.org/licenses/osl-3.0.php
00010 *
00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
00012 * Development 2012-2013 by School of Earth Sciences
00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
00014 *
00015 *****************************************************************************/
00016 #ifndef __RIPLEY_ABSTRACTASSEMBLER_H__
00017 #define __RIPLEY_ABSTRACTASSEMBLER_H__
00018 
00019 #include <map>
00020 #include <escript/Data.h>
00021 #include <ripley/Ripley.h>
00022 #include <ripley/RipleyException.h>
00023 #include <paso/SystemMatrix.h>
00024 
00025 namespace ripley {
00026 
00027 escript::Data unpackData(std::string target,
00028         std::map<std::string, escript::Data> mapping);
00029 
00030 class RipleyDomain;
00031 /* returns the data associated with the string key or an empty data object
00032    if the map does not contain the given key */
00033 escript::Data unpackData(std::string, std::map<std::string, escript::Data>);
00034 
00035 class AbstractAssembler {
00036 public:
00037     virtual ~AbstractAssembler() {};
00038     /* The default RipleyDomain assemblers, with original signatures */
00039     
00042     void assemblePDESingle(paso::SystemMatrix_ptr mat, escript::Data& rhs,
00043             const escript::Data& A, const escript::Data& B,
00044             const escript::Data& C, const escript::Data& D,
00045             const escript::Data& X, const escript::Data& Y) const {
00046         throw RipleyException("This assembler does not support "
00047                 "old style signatures");
00048     }
00049 
00052     void assemblePDEBoundarySingle(paso::SystemMatrix_ptr mat,
00053             escript::Data& rhs, const escript::Data& d,
00054             const escript::Data& y) const {
00055         throw RipleyException("This assembler does not support "
00056                 "old style signatures");
00057     }
00058 
00061     void assemblePDESingleReduced(paso::SystemMatrix_ptr mat,
00062             escript::Data& rhs, const escript::Data& A, const escript::Data& B,
00063             const escript::Data& C, const escript::Data& D,
00064             const escript::Data& X, const escript::Data& Y) const {
00065         throw RipleyException("This assembler does not support "
00066                 "old style signatures");
00067     }
00068     
00071     void assemblePDEBoundarySingleReduced(paso::SystemMatrix_ptr mat,
00072             escript::Data& rhs, const escript::Data& d,
00073             const escript::Data& y) const {
00074         throw RipleyException("This assembler does not support "
00075                 "old style signatures");
00076     }
00077     
00080     void assemblePDESystem(paso::SystemMatrix_ptr mat, escript::Data& rhs,
00081             const escript::Data& A, const escript::Data& B,
00082             const escript::Data& C, const escript::Data& D,
00083             const escript::Data& X, const escript::Data& Y) {
00084         throw RipleyException("This assembler does not support "
00085                 "old style signatures");
00086     }
00087     
00090     void assemblePDEBoundarySystem(paso::SystemMatrix_ptr mat,
00091             escript::Data& rhs, const escript::Data& d,
00092             const escript::Data& y) const {
00093         throw RipleyException("This assembler does not support "
00094                 "old style signatures");
00095     }
00096 
00099     void assemblePDESystemReduced(paso::SystemMatrix_ptr mat,
00100             escript::Data& rhs, const escript::Data& A, const escript::Data& B,
00101             const escript::Data& C, const escript::Data& D,
00102             const escript::Data& X, const escript::Data& Y) {
00103         throw RipleyException("This assembler does not support "
00104                 "old style signatures");
00105     }
00106 
00109     void assemblePDEBoundarySystemReduced(paso::SystemMatrix_ptr mat,
00110             escript::Data& rhs, const escript::Data& d,
00111             const escript::Data& y) const {
00112         throw RipleyException("This assembler does not support "
00113                 "old style signatures");
00114     }
00115     
00116     /* The new interface for assemblers */
00117     virtual void assemblePDESingle(paso::SystemMatrix_ptr mat,
00118                     escript::Data& rhs,
00119                     std::map<std::string, escript::Data> coefs) const = 0;
00120     virtual void assemblePDEBoundarySingle(paso::SystemMatrix_ptr mat,
00121                     escript::Data& rhs,
00122                     std::map<std::string, escript::Data> coefs) const = 0;
00123     virtual void assemblePDESingleReduced(paso::SystemMatrix_ptr mat,
00124                     escript::Data& rhs,
00125                     std::map<std::string, escript::Data> coefs) const = 0;
00126     virtual void assemblePDEBoundarySingleReduced(paso::SystemMatrix_ptr mat,
00127                     escript::Data& rhs,
00128                     std::map<std::string, escript::Data> coefs) const = 0;
00129     virtual void assemblePDESystem(paso::SystemMatrix_ptr mat,
00130                     escript::Data& rhs,
00131                     std::map<std::string, escript::Data> coefs) const = 0;
00132     virtual void assemblePDEBoundarySystem(paso::SystemMatrix_ptr mat,
00133                     escript::Data& rhs,
00134                     std::map<std::string, escript::Data> coefs) const = 0;
00135     virtual void assemblePDESystemReduced(paso::SystemMatrix_ptr mat,
00136                     escript::Data& rhs,
00137                     std::map<std::string, escript::Data> coefs) const = 0;
00138     virtual void assemblePDEBoundarySystemReduced(paso::SystemMatrix_ptr mat,
00139                     escript::Data& rhs,
00140                     std::map<std::string, escript::Data> coefs) const = 0;
00141 
00142     virtual void collateFunctionSpaceTypes(std::vector<int>& fsTypes, 
00143             std::map<std::string, escript::Data> coefs) const = 0;
00144 };
00145 
00146 } // namespace ripley
00147 
00148 
00149 #endif // __RIPLEY_ABSTRACTASSEMBLER_H__
00150