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

GridOperator: get rid of PDELab constraints

parent 22d550c4
No related branches found
No related tags found
No related merge requests found
......@@ -88,18 +88,20 @@ void driver (const GV& gv, Dune::ParameterTree& ptree)
// Assemble constraints
//== Exercise 2 {
#ifdef NITSCHE
using CC = Dune::PDELab::ConstraintsTransformation<
Dune::PDELab::DOFIndex<long unsigned int, 1ul, 2ul>,
Dune::PDELab::MultiIndex<long unsigned int, 1ul>,
double>;
#else
#ifndef NITSCHE
typedef typename GFS::template
ConstraintsContainer<RF>::Type CC;
CC cc;
Dune::PDELab::constraints(b,gfs,cc); // assemble constraints
std::cout << "constrained dofs=" << cc.size() << " of "
<< gfs.globalSize() << std::endl;
std::vector<std::size_t> cc_plain;
cc_plain.reserve(cc.size());
for(const auto &c : cc)
{
assert(c.first.size() == 1);
cc_plain.push_back(c.first[0]);
}
#endif
//== }
......@@ -127,14 +129,13 @@ void driver (const GV& gv, Dune::ParameterTree& ptree)
typedef PPS::GridOperator<
GV, LFE,
LOP, /* local operator */
RF,RF,RF, /* domain, range, jacobian field type*/
CC,CC /* constraints for ansatz and test space */
RF,RF,RF /* domain, range, jacobian field type*/
> GO;
//== Exercise 2 {
#ifdef NITSCHE
GO go(gv, {}, lop);
#else
GO go(gv, {}, cc, cc,lop);
GO go(gv, {}, lop, cc_plain);
#endif
//== }
......
......@@ -41,10 +41,7 @@ namespace PPS {
*/
template<class GridView, class LocalFiniteElement, typename LocalOperator,
typename DF, typename RF, typename JF,
typename CU,
typename CV
>
typename DF, typename RF, typename JF>
class GridOperator
{
public:
......@@ -58,16 +55,9 @@ namespace PPS {
//! Constructor for non trivial constraints
GridOperator(GridView gv, LocalFiniteElement lfe,
const CU & cu_, const CV & cv, LocalOperator & lop)
: gv_(std::move(gv)), lop_(lop), lfe_(std::move(lfe))
{
cv_.reserve(cv.size());
for(const auto &c : cv)
{
assert(c.first.size() == 1);
cv_.push_back(c.first[0]);
}
}
LocalOperator & lop, std::vector<std::size_t> cv)
: gv_(std::move(gv)), lop_(lop), lfe_(std::move(lfe)), cv_(std::move(cv))
{}
//! Constructor for empty constraints
GridOperator(GridView gv, LocalFiniteElement lfe, LocalOperator & lop)
......
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