Commit 2d76142b authored by Praetorius, Simon's avatar Praetorius, Simon

make operatorlist dataelement be of type BoundaryCondition

parent ab4782d4
Pipeline #1612 passed with stage
in 30 minutes and 53 seconds
......@@ -44,8 +44,7 @@ int main(int argc, char** argv)
prob.addVectorOperator(opForce, 0);
// set boundary condition
auto boundary = [](auto const& x){ return x[0] < 1.e-8 || x[1] < 1.e-8 || x[0] > 1.0-1.e-8 || x[1] > 1.0-1.e-8; };
prob.addDirichletBC(boundary, 0, 0, g);
prob.addDirichletBC(BoundaryType{1}, 0, 0, g);
AdaptInfo adaptInfo("adapt");
......
......@@ -88,6 +88,7 @@ int main(int argc, char** argv)
run(grid1);
#endif
// NOTE: 'periodic' YaspGrid not supported yet, but a simple YaspGrid can be made periodic
Dune::YaspGrid<2> grid2({1.0,1.0}, {2,2});
run(grid2);
......
......@@ -55,7 +55,7 @@ namespace AMDiS
},
[&](auto const& bis, auto& operators) {
for (auto data : operators) {
if (data.boundaryManager->boundaryId(bis) == data.id)
if (data.bc.onBoundary(bis))
data.op->assemble(bis, node, elementVector);
}
});
......@@ -76,7 +76,7 @@ namespace AMDiS
},
[&](auto const& bis, auto& operators) {
for (auto data : operators) {
if (data.boundaryManager->boundaryId(bis) == data.id)
if (data.bc.onBoundary(bis))
data.op->assemble(bis, rowNode, colNode, elementMatrix);
}
});
......
......@@ -3,8 +3,7 @@
#include <list>
#include <memory>
#include <amdis/Boundary.hpp>
#include <amdis/BoundaryManager.hpp>
#include <amdis/BoundaryCondition.hpp>
#include <amdis/LocalAssemblerBase.hpp>
#include <amdis/utility/TreeData.hpp>
......@@ -14,11 +13,10 @@ namespace AMDiS
{
template <class E> struct element_operator { using type = E; };
template <class I> struct intersection_operator { using type = I; };
template <class I> struct boundary_operator
template <class I> struct boundary_operator : public BoundaryCondition
{
using type = I;
std::shared_ptr<BoundaryManagerBase> boundaryManager;
BoundaryType id;
using BoundaryCondition::BoundaryCondition;
};
}
......@@ -32,8 +30,7 @@ namespace AMDiS
struct DataElement
{
std::shared_ptr<OperatorType> op;
std::shared_ptr<BoundaryManagerBase> boundaryManager;
BoundaryType id;
BoundaryCondition bc;
};
/// Lists of \ref DataElement on the Element, BoundaryIntersction, and InteriorIntersections
......@@ -91,7 +88,7 @@ namespace AMDiS
template <class Op>
void push(tag::boundary_operator<Intersection> b, Op&& op)
{
boundary_.push_back({std::forward<Op>(op), b.boundaryManager, b.id});
boundary_.push_back({std::forward<Op>(op), b});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment