28 typedef ext::shared_ptr<Fdm1dMesher>
T;
30 ext::shared_ptr<FdmLinearOpLayout> getLayoutFromMeshers(
31 const std::vector<ext::shared_ptr<Fdm1dMesher> > & meshers) {
32 std::vector<Size> dim(meshers.size());
33 for (
Size i=0; i < dim.size(); ++i) {
34 dim[i] = meshers[i]->size();
36 return ext::make_shared<FdmLinearOpLayout>(std::move(dim));
41 const ext::shared_ptr<Fdm1dMesher>& mesher)
42 :
FdmMesher(getLayoutFromMeshers({mesher})),
48 const ext::shared_ptr<Fdm1dMesher>& m1,
49 const ext::shared_ptr<Fdm1dMesher>& m2)
50 :
FdmMesher(getLayoutFromMeshers({m1, m2})),
55 const ext::shared_ptr<Fdm1dMesher>& m1,
56 const ext::shared_ptr<Fdm1dMesher>& m2,
57 const ext::shared_ptr<Fdm1dMesher>& m3)
58 :
FdmMesher(getLayoutFromMeshers({m1, m2, m3})),
63 const ext::shared_ptr<Fdm1dMesher>& m1,
64 const ext::shared_ptr<Fdm1dMesher>& m2,
65 const ext::shared_ptr<Fdm1dMesher>& m3,
66 const ext::shared_ptr<Fdm1dMesher>& m4)
67 :
FdmMesher(getLayoutFromMeshers({m1, m2, m3, m4})),
72 const std::vector<ext::shared_ptr<Fdm1dMesher> > & mesher)
77 const ext::shared_ptr<FdmLinearOpLayout>& layout,
78 const std::vector<ext::shared_ptr<Fdm1dMesher> > & mesher)
80 for (
Size i=0; i < mesher.size(); ++i) {
82 "size of 1d mesher " << i <<
" does not fit to layout");
87 Size direction)
const {
92 Size direction)
const {
97 Size direction)
const {
104 for (
const auto& iter : *
layout_) {
105 retVal[iter.index()] =
106 mesher_[direction]->locations()[iter.coordinates()[direction]];
112 const std::vector<ext::shared_ptr<Fdm1dMesher> >&
1-D array used in linear algebra.
const std::vector< Size > & coordinates() const
Real dminus(const FdmLinearOpIterator &iter, Size direction) const override
Array locations(Size direction) const override
const std::vector< ext::shared_ptr< Fdm1dMesher > > & getFdm1dMeshers() const
FdmMesherComposite(const ext::shared_ptr< FdmLinearOpLayout > &layout, const std::vector< ext::shared_ptr< Fdm1dMesher > > &mesher)
Real dplus(const FdmLinearOpIterator &iter, Size direction) const override
const std::vector< ext::shared_ptr< Fdm1dMesher > > mesher_
Real location(const FdmLinearOpIterator &iter, Size direction) const override
const ext::shared_ptr< FdmLinearOpLayout > layout_
const ext::shared_ptr< FdmLinearOpLayout > & layout() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
memory layout of a fdm linear operator
FdmMesher which is a composite of Fdm1dMesher.
const ext::shared_ptr< FdmMesher > mesher_
std::size_t Size
size of a container