Skip to content
Snippets Groups Projects
Commit b17adfe7 authored by Jö Fahlke's avatar Jö Fahlke
Browse files

constraints(): inline applyToTreePath()

parent 7c13e792
No related branches found
No related tags found
No related merge requests found
......@@ -3,24 +3,6 @@
namespace PPS {
/* The signature is the same as for the public applyToTreePair
* function in Dune::Typtree, despite the additionally passed
* treePath argument. The path passed here is associated to
* the tree and the relative paths of the children (wrt. to tree)
* are appended to this. Hence the behavior of the public function
* is resembled by passing an empty treePath.
*/
/*
* This is the overload for leaf traversal
*/
template<class T1, class T2, class TreePath, class V,
std::enable_if_t<(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
{
visitor.leaf(tree1, tree2, treePath);
}
template<typename P, typename GFS, typename CG>
void constraints(const P& p, const GFS& gfs, CG& cg,
const bool verbose = false)
......@@ -60,9 +42,9 @@ namespace PPS {
using ElementWrapper = Dune::PDELab::ElementGeometry<Element>;
using IntersectionWrapper = Dune::PDELab::IntersectionGeometry<Intersection>;
applyToTreePair
(p,lfs_e,Dune::TypeTree::hybridTreePath(),
Dune::PDELab::VolumeConstraints<ElementWrapper,CL>(ElementWrapper(element),cl_self));
Dune::PDELab::VolumeConstraints<ElementWrapper,CL>
(ElementWrapper(element),cl_self).
leaf(p, lfs_e, Dune::TypeTree::hybridTreePath());
// iterate over intersections and call metaprogram
unsigned int intersection_index = 0;
......@@ -85,9 +67,10 @@ namespace PPS {
CL cl_neighbor;
applyToTreePair
(lfs_e,lfs_f,Dune::TypeTree::hybridTreePath(),
Dune::PDELab::SkeletonConstraints<IntersectionWrapper,CL>(IntersectionWrapper(intersection,intersection_index),cl_self,cl_neighbor));
Dune::PDELab::SkeletonConstraints<IntersectionWrapper,CL>
(IntersectionWrapper(intersection,intersection_index),
cl_self,cl_neighbor).
leaf(lfs_e,lfs_f,Dune::TypeTree::hybridTreePath());
if (!cl_neighbor.empty())
{
......@@ -100,9 +83,9 @@ namespace PPS {
}
case Dune::PDELab::IntersectionType::boundary:
applyToTreePair
(p,lfs_e,Dune::TypeTree::hybridTreePath(),
Dune::PDELab::BoundaryConstraints<IntersectionWrapper,CL>(IntersectionWrapper(intersection,intersection_index),cl_self));
Dune::PDELab::BoundaryConstraints<IntersectionWrapper,CL>
(IntersectionWrapper(intersection,intersection_index),cl_self).
leaf(p,lfs_e,Dune::TypeTree::hybridTreePath());
break;
case Dune::PDELab::IntersectionType::periodic:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment