47 #ifndef MUELU_MATLABUTILS_DECL_HPP
48 #define MUELU_MATLABUTILS_DECL_HPP
52 #if !defined(HAVE_MUELU_MATLAB) || !defined(HAVE_MUELU_EPETRA)
53 #error "Muemex requires MATLAB, Epetra and Tpetra."
62 #include <Teuchos_DefaultComm.hpp>
68 #include "MueLu_Graph_decl.hpp"
69 #include "Epetra_MultiVector.h"
70 #include "Epetra_CrsMatrix.h"
73 #include "Xpetra_MapFactory.hpp"
78 #include "Kokkos_DynRankView.hpp"
103 #ifdef HAVE_MUELU_INTREPID2
105 FIELDCONTAINER_ORDINAL
109 typedef Tpetra::KokkosCompat::KokkosDeviceWrapperNode<Kokkos::Serial, Kokkos::HostSpace>
mm_node_t;
131 #ifdef HAVE_MUELU_INTREPID2
132 typedef Kokkos::DynRankView<mm_LocalOrd, typename mm_node_t::device_type> FieldContainer_ordinal;
141 template <
typename T>
144 template <
typename T>
158 template <
typename T>
161 template <
typename T>
164 template <
typename T>
167 template <
typename T>
171 template <
typename T>
174 template <
typename T>
178 template <
typename Scalar =
double,
typename LocalOrdinal = mm_LocalOrd,
typename GlobalOrdinal = mm_GlobalOrd,
typename Node = mm_node_t>
181 template <
typename Scalar =
double,
typename LocalOrdinal = mm_LocalOrd,
typename GlobalOrdinal = mm_GlobalOrd,
typename Node = mm_node_t>
185 template <
typename Scalar>
187 template <
typename Scalar>
189 template <
typename Scalar>
194 std::vector<std::string>
tokenizeList(
const std::string& param);
202 static inline std::string&
ltrim(std::string& s) {
203 s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
208 static inline std::string&
rtrim(std::string& s) {
209 s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
214 static inline std::string&
trim(std::string& s) {
220 #endif // HAVE_MUELU_MATLAB error handler
221 #endif // MUELU_MATLABUTILS_DECL_HPP guard
Xpetra::MultiVector< double, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Xpetra_MultiVector_double
mxArray * convertToMatlab()
bool isValidMatlabAggregates(const mxArray *mxa)
template mxArray * saveDataToMatlab(bool &data)
LocalOrdinal local_ordinal_type
std::vector< std::string > tokenizeList(const std::string ¶ms)
Xpetra::MultiVector< complex_t, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Xpetra_MultiVector_complex
Xpetra::CrsGraph< mm_LocalOrd, mm_GlobalOrd, mm_node_t > Xpetra_CrsGraph
GlobalOrdinal global_ordinal_type
Container class for aggregation information.
Tpetra::CrsMatrix< complex_t, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Tpetra_CrsMatrix_complex
Tpetra::Map::local_ordinal_type mm_LocalOrd
Tpetra::Map::global_ordinal_type mm_GlobalOrd
std::vector< RCP< MuemexArg > > callMatlab(std::string function, int numOutputs, std::vector< RCP< MuemexArg > > args)
void fillMatlabArray(Scalar *array, const mxArray *mxa, int n)
T loadDataFromMatlab(const mxArray *mxa)
Tpetra::KokkosCompat::KokkosDeviceWrapperNode< Kokkos::Serial, Kokkos::HostSpace > mm_node_t
bool isValidMatlabGraph(const mxArray *mxa)
MueLu::Hierarchy< complex_t, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Hierarchy_complex
MuemexType getMuemexType(const T &data)
std::vector< Teuchos::RCP< MuemexArg > > processNeeds(const Factory *factory, std::string &needsParam, Level &lvl)
void addLevelVariable(const T &data, std::string &name, Level &lvl, const FactoryBase *fact=NoFactory::get())
static const NoFactory * get()
Teuchos::RCP< Teuchos::ParameterList > getInputParamList()
Base class for factories (e.g., R, P, and A_coarse).
Xpetra::Vector< mm_LocalOrd, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Xpetra_ordinal_vector
MuemexArg(MuemexType dataType)
MueLu::AmalgamationInfo< mm_LocalOrd, mm_GlobalOrd, mm_node_t > MAmalInfo
MueLu::DefaultScalar Scalar
int * mwIndex_to_int(int N, mwIndex *mwi_array)
Class that holds all level-specific information.
MueLu::Hierarchy< double, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Hierarchy_double
Xpetra::Matrix< double, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Xpetra_Matrix_double
const T & getLevelVariable(std::string &name, Level &lvl)
MueLu::LWGraph< mm_LocalOrd, mm_GlobalOrd, mm_node_t > MGraph
Xpetra::Matrix< complex_t, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Xpetra_Matrix_complex
static std::string & trim(std::string &s)
void callMatlabNoArgs(std::string function)
static std::string & ltrim(std::string &s)
std::complex< double > complex_t
static std::string & rtrim(std::string &s)
MueLu::Aggregates< mm_LocalOrd, mm_GlobalOrd, mm_node_t > MAggregates
Tpetra::Map muemex_map_type
Tpetra::MultiVector< complex_t, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Tpetra_MultiVector_complex
Lightweight MueLu representation of a compressed row storage graph.
Xpetra::Map< mm_LocalOrd, mm_GlobalOrd, mm_node_t > Xpetra_map
mxArray * createMatlabSparse(int numRows, int numCols, int nnz)
Tpetra::MultiVector< double, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Tpetra_MultiVector_double
void processProvides(std::vector< Teuchos::RCP< MuemexArg > > &mexOutput, const Factory *factory, std::string &providesParam, Level &lvl)
minimal container class for storing amalgamation information
mxArray * createMatlabMultiVector(int numRows, int numCols)
Tpetra::CrsMatrix< double, mm_LocalOrd, mm_GlobalOrd, mm_node_t > Tpetra_CrsMatrix_double
Provides methods to build a multigrid hierarchy and apply multigrid cycles.
Teuchos::RCP< MuemexArg > convertMatlabVar(const mxArray *mxa)