blitzdg
an open-source project aiming to implement parallel discontinuous Galerkin (dg) solvers for common partial differential equations systems using blitz++ for array and tensor manipulations and MPI for distributed parallelism.
constraintadapter.h
1 
2 // Copyright Joakim Karlsson & Kim Gräsman 2010-2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef IGLOO_CONSTRAINTADAPTER_H
8 #define IGLOO_CONSTRAINTADAPTER_H
9 
10 namespace snowhouse {
11 
12  template <typename ConstraintType>
14  {
15  ConstraintAdapter(const ConstraintType& constraint) : m_constraint(constraint)
16  {
17  }
18 
19  template <typename ConstraintListType, typename ActualType>
20  void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
21  {
22  result.push(m_constraint(actual));
23  EvaluateConstraintList(list.m_tail, result, operators, actual);
24  }
25 
26  ConstraintType m_constraint;
27  };
28 
29  template<typename ConstraintType>
30  struct Stringizer< ConstraintAdapter<ConstraintType> >
31  {
32  static std::string ToString(const ConstraintAdapter<ConstraintType>& constraintAdapter)
33  {
34  return snowhouse::Stringize(constraintAdapter.m_constraint);
35  }
36  };
37 }
38 
39 #endif
Definition: assert.h:13
Definition: constraintadapter.h:13
Definition: stringize.h:71