mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
MILU: optionally instantiate for float
This commit is contained in:
parent
554bb7d8b7
commit
f94f1d1012
@ -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&);
|
#define INSTANTIATE_ILUN(...) \
|
||||||
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(...) \
|
|
||||||
template void milun_decomposition(const __VA_ARGS__&, int, MILU_VARIANT, \
|
template void milun_decomposition(const __VA_ARGS__&, int, MILU_VARIANT, \
|
||||||
__VA_ARGS__&,Reorderer&,Reorderer&);
|
__VA_ARGS__&,Reorderer&,Reorderer&);
|
||||||
|
|
||||||
#define INSTANCE_FULL(...) \
|
#define INSTANTIATE_FULL(T,...) \
|
||||||
INSTANCE(__VA_ARGS__) \
|
INSTANTIATE(T,__VA_ARGS__) \
|
||||||
INSTANCE_ILUN(__VA_ARGS__)
|
INSTANTIATE_ILUN(__VA_ARGS__)
|
||||||
|
|
||||||
#define INSTANCE_BLOCK(Dim) \
|
#define INSTANTIATE_DIM(T,Dim) \
|
||||||
INSTANCE_FULL(Dune::BCRSMatrix<MatrixBlock<double,Dim,Dim>>)
|
INSTANTIATE_FULL(T,Dune::BCRSMatrix<MatrixBlock<T,Dim,Dim>>) \
|
||||||
|
INSTANTIATE_FULL(T,Dune::BCRSMatrix<Dune::FieldMatrix<T,Dim,Dim>>)
|
||||||
|
|
||||||
#define INSTANCE_FM(Dim) \
|
#define INSTANTIATE_TYPE(T) \
|
||||||
INSTANCE_FULL(Dune::BCRSMatrix<Dune::FieldMatrix<double,Dim,Dim>>)
|
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)
|
INSTANTIATE_TYPE(double)
|
||||||
INSTANCE_FM(2)
|
|
||||||
INSTANCE_FM(3)
|
|
||||||
INSTANCE_FM(4)
|
|
||||||
INSTANCE_FM(5)
|
|
||||||
INSTANCE_FM(6)
|
|
||||||
|
|
||||||
INSTANCE_BLOCK(1)
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
INSTANCE_BLOCK(2)
|
INSTANTIATE_TYPE(float)
|
||||||
INSTANCE_BLOCK(3)
|
#endif
|
||||||
INSTANCE_BLOCK(4)
|
|
||||||
INSTANCE_BLOCK(5)
|
|
||||||
INSTANCE_BLOCK(6)
|
|
||||||
|
|
||||||
} // end namespace detail
|
} // end namespace detail
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user