MILU: optionally instantiate for float

This commit is contained in:
Arne Morten Kvarving 2024-04-12 13:11:09 +02:00
parent 554bb7d8b7
commit f94f1d1012

View File

@ -255,45 +255,41 @@ void milun_decomposition(const M& A, int n, MILU_VARIANT milu, M& ILU,
}
}
#define INSTANTIATE(T, ...) \
template void milu0_decomposition<__VA_ARGS__> \
(__VA_ARGS__&,std::function<T(const T&)>, std::function<T(const T&)>, \
std::vector<typename __VA_ARGS__::block_type>*);
template double Opm::detail::identityFunctor(const double&);
template double Opm::detail::oneFunctor(const double&);
template double Opm::detail::signFunctor(const double&);
template double Opm::detail::isPositiveFunctor(const double&);
template double Opm::detail::absFunctor(const double&);
#define INSTANCE(...) \
template void milu0_decomposition<__VA_ARGS__> \
(__VA_ARGS__&,std::function<double(const double&)>, std::function<double(const double&)>, \
std::vector<typename __VA_ARGS__::block_type>*);
#define INSTANCE_ILUN(...) \
#define INSTANTIATE_ILUN(...) \
template void milun_decomposition(const __VA_ARGS__&, int, MILU_VARIANT, \
__VA_ARGS__&,Reorderer&,Reorderer&);
#define INSTANCE_FULL(...) \
INSTANCE(__VA_ARGS__) \
INSTANCE_ILUN(__VA_ARGS__)
#define INSTANTIATE_FULL(T,...) \
INSTANTIATE(T,__VA_ARGS__) \
INSTANTIATE_ILUN(__VA_ARGS__)
#define INSTANCE_BLOCK(Dim) \
INSTANCE_FULL(Dune::BCRSMatrix<MatrixBlock<double,Dim,Dim>>)
#define INSTANTIATE_DIM(T,Dim) \
INSTANTIATE_FULL(T,Dune::BCRSMatrix<MatrixBlock<T,Dim,Dim>>) \
INSTANTIATE_FULL(T,Dune::BCRSMatrix<Dune::FieldMatrix<T,Dim,Dim>>)
#define INSTANCE_FM(Dim) \
INSTANCE_FULL(Dune::BCRSMatrix<Dune::FieldMatrix<double,Dim,Dim>>)
#define INSTANTIATE_TYPE(T) \
template T identityFunctor(const T&); \
template T oneFunctor(const T&); \
template T signFunctor(const T&); \
template T isPositiveFunctor(const T&); \
template T absFunctor(const T&); \
INSTANTIATE_DIM(T,1) \
INSTANTIATE_DIM(T,2) \
INSTANTIATE_DIM(T,3) \
INSTANTIATE_DIM(T,4) \
INSTANTIATE_DIM(T,5) \
INSTANTIATE_DIM(T,6)
INSTANCE_FM(1)
INSTANCE_FM(2)
INSTANCE_FM(3)
INSTANCE_FM(4)
INSTANCE_FM(5)
INSTANCE_FM(6)
INSTANTIATE_TYPE(double)
INSTANCE_BLOCK(1)
INSTANCE_BLOCK(2)
INSTANCE_BLOCK(3)
INSTANCE_BLOCK(4)
INSTANCE_BLOCK(5)
INSTANCE_BLOCK(6)
#if FLOW_INSTANTIATE_FLOAT
INSTANTIATE_TYPE(float)
#endif
} // end namespace detail