21 #ifndef bempp_local_assembler_construction_helper_hpp
22 #define bempp_local_assembler_construction_helper_hpp
24 #include "../common/common.hpp"
26 #include "assembly_options.hpp"
27 #include "../common/not_implemented_error.hpp"
28 #include "../common/shared_ptr.hpp"
29 #include "../fiber/raw_grid_geometry.hpp"
30 #include "../fiber/opencl_handler.hpp"
31 #include "../grid/geometry_factory.hpp"
32 #include "../grid/grid.hpp"
33 #include "../grid/grid_view.hpp"
34 #include "../space/space.hpp"
36 #include "../common/boost_make_shared_fwd.hpp"
46 template <
typename CoordinateType,
typename BasisFunctionType>
47 static void collectGridData(
50 shared_ptr<GeometryFactory>& geometryFactory) {
53 rawGeometry = boost::make_shared<RawGridGeometry>(space.
gridDimension(),
56 view.getRawElementData(
57 rawGeometry->vertices(), rawGeometry->elementCornerIndices(),
58 rawGeometry->auxData());
62 template <
typename BasisFunctionType>
63 static void collectShapesets(
66 typedef std::vector<const Fiber::Shapeset<BasisFunctionType>*> ShapesetPtrVector;
67 shapesets = boost::make_shared<ShapesetPtrVector>();
68 getAllShapesets(space, *shapesets);
73 template <
typename CoordinateType>
74 static void makeOpenClHandler(
77 shared_ptr<Fiber::OpenClHandler>& openClHandler) {
78 openClHandler = boost::make_shared<Fiber::OpenClHandler>(openClOptions);
79 if (openClHandler->UseOpenCl())
80 openClHandler->pushGeometry(rawGeometry->vertices(),
81 rawGeometry->elementCornerIndices());
84 template <
typename CoordinateType>
85 static void makeOpenClHandler(
89 shared_ptr<Fiber::OpenClHandler>& openClHandler) {
90 openClHandler = boost::make_shared<Fiber::OpenClHandler>(openClOptions);
91 if (openClHandler->UseOpenCl()) {
92 if (testRawGeometry.get() == trialRawGeometry.get())
93 openClHandler->pushGeometry(testRawGeometry->vertices(),
94 testRawGeometry->elementCornerIndices());
97 "LocalAssemblerConstructionHelper::makeOpenClHandler(): "
98 "OpenCL-based assembly of operators with test and trial "
99 "spaces defined on different grids is not currently supported");
shared_ptr< GeometryFactory > elementGeometryFactory() const
Return the GeometryFactory associated with the mesh.
Definition: space.hpp:278
Function space.
Definition: assembled_potential_operator.hpp:35
Exception thrown on attempt to access an unimplemented feature.
Definition: not_implemented_error.hpp:32
int worldDimension() const
Return the underlying world dimension.
Definition: space.cpp:185
int gridDimension() const
Return the underlying grid dimension.
Definition: space.cpp:179
Collection of shape functions defined on a reference element.
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:34
Abstract wrapper of a grid view.
Definition: grid_view.hpp:48
const GridView & gridView() const
Return the grid view of the current space.
Definition: space.cpp:190
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:35
Utility functions used during weak-form assembly.
Definition: local_assembler_construction_helper.hpp:44
Definition: opencl_options.hpp:29