1 #ifndef DUNE_FEM_PASS_DGINVERSEMASS_HH
2 #define DUNE_FEM_PASS_DGINVERSEMASS_HH
24 template<
int functionalId,
class PreviousPass >
28 typedef typename PreviousPass::PassIds PassIds;
29 typedef typename PreviousPass::NextArgumentType LocalArgumentType;
30 typedef typename PreviousPass::GlobalArgumentType GlobalArgumentType;
31 typedef typename PushFrontTuple< LocalArgumentType, GlobalArgumentType * >::type TotalArgumentType;
35 = Dune::FirstTypeIndex< PassIds, std::integral_constant< int, functionalId > >::type::value;
36 typedef typename std::tuple_element< functionalPosition, TotalArgumentType >::type
DestinationPtrType;
58 template<
int functionalId,
class PreviousPass,
int id >
60 :
public Dune::Fem::LocalPass< DGInverseMassPassDiscreteModel< functionalId, PreviousPass >, PreviousPass, id >
83 typedef typename DiscreteFunctionSpaceType::GridPartType GridPartType;
87 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
102 PreviousPass &previousPass,
104 const int volQuadOrd = -1,
105 const int faceQuadOrd = -1)
107 localMassMatrix_(
space, ( volQuadOrd == -1 ) ? (2*
space.order()) : volQuadOrd ),
115 out <<
"DGInverseMassPass: " <<
"\\\\" << std::endl;
152 typename DestinationType::LocalFunctionType localDestination = dest_->localFunction( entity );
153 localDestination.assign( std::get< functionalPosition >( *arg_ )->localFunction( entity ) );
154 localMassMatrix_.
applyInverse( entity, localDestination );
158 template <
class NBChecker>
159 void applyLocal(
const EntityType& entity,
const NBChecker& )
const
167 template <
class NBChecker>
176 template <
class NBChecker>
179 DUNE_THROW(InvalidStateException,
"DGInverseMassPass does not need a second phase for ThreadPass");
188 typedef typename GridPartType::template Codim< 0 >::template Partition< All_Partition >::IteratorType
IteratorType;
189 const GridPartType &gridPart =
space().gridPart();
190 const IteratorType end = gridPart.template end< 0, All_Partition >();
191 for(
IteratorType it = gridPart.template begin< 0, All_Partition >(); it != end; ++it )
205 LocalMassMatrixType localMassMatrix_;
Definition: bindguard.hh:11
void applyInverse(MassCaller &caller, const EntityType &entity, LocalFunction &lf) const
Definition: localmassmatrix.hh:239
DeleteHandlerType * deleteHandler_
object to delete destination_
Definition: common/pass.hh:376
DestinationType * destination_
destination (might be set from outside)
Definition: common/pass.hh:373
void printTexInfo(std::ostream &out) const
printTex info of operator
Definition: common/pass.hh:206
PushFrontTuple< LocalArgumentType, const GlobalArgumentType * >::type TotalArgumentType
Definition: common/pass.hh:173
const DestinationType & destination() const
return reference to internal discrete function
Definition: common/pass.hh:253
int passNumber() const
Definition: common/pass.hh:179
Dune::PushBackTuple< typename PreviousPassType::PassIds, std::integral_constant< int, passIdImp > >::type PassIds
pass ids up to here (tuple of integral constants)
Definition: common/pass.hh:153
Specialisation of Pass which provides a grid walk-through, but leaves open what needs to be done on e...
Definition: local.hh:36
const DiscreteFunctionSpaceType & space() const
return reference to space
Definition: local.hh:92
DiscreteFunctionSpaceType::IteratorType IteratorType
iterator over the space
Definition: local.hh:54
DiscreteModelImp::Traits::DestinationType DestinationType
the discrete function representing the return value of this pass
Definition: local.hh:50
Definition: dginversemass.hh:26
std::tuple_element< functionalPosition, TotalArgumentType >::type DestinationPtrType
Definition: dginversemass.hh:36
static const std::size_t functionalPosition
Definition: dginversemass.hh:35
Definition: dginversemass.hh:39
CachingQuadrature< typename DiscreteFunctionSpaceType::GridPartType, 1 > FaceQuadratureType
Definition: dginversemass.hh:43
DestinationType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: dginversemass.hh:41
std::remove_pointer< DestinationPtrType >::type DestinationType
Definition: dginversemass.hh:40
CachingQuadrature< typename DiscreteFunctionSpaceType::GridPartType, 0 > VolumeQuadratureType
Definition: dginversemass.hh:42
Pass applying the local inverse mass matrix on each element.
Definition: dginversemass.hh:61
BaseType::TotalArgumentType TotalArgumentType
argument type
Definition: dginversemass.hh:73
void compute(const TotalArgumentType &argument, DestinationType &destination) const
Definition: dginversemass.hh:183
void applyLocalInterior(const EntityType &entity, const NBChecker &) const
apply local for all elements that do not need information from other processes (here all elements)
Definition: dginversemass.hh:168
void finalize(const TotalArgumentType &argument, DestinationType &destination, const bool) const
finalize for ThreadPass
Definition: dginversemass.hh:135
void applyLocalProcessBoundary(const EntityType &entity, const NBChecker &) const
apply local for all elements that need information from other processes (here no elements)
Definition: dginversemass.hh:177
void finalize(const TotalArgumentType &argument, DestinationType &destination) const
interface method
Definition: dginversemass.hh:141
bool requireCommunication() const
this pass needs no communication
Definition: dginversemass.hh:119
void printTexInfo(std::ostream &out) const
Definition: dginversemass.hh:112
void prepare(const TotalArgumentType &argument, DestinationType &destination, const bool) const
prepare for ThreadPass
Definition: dginversemass.hh:129
DGInverseMassPassDiscreteModel< functionalId, PreviousPass > DiscreteModelType
type of the discrete model used
Definition: dginversemass.hh:67
void applyLocal(const EntityType &entity, const NBChecker &) const
apply local with neighbor checker (not needed here)
Definition: dginversemass.hh:159
BaseType::DestinationType DestinationType
destination type
Definition: dginversemass.hh:75
BaseType::PassIds PassIds
pass ids up to here (tuple of integral constants)
Definition: dginversemass.hh:70
DiscreteModelType::Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
discrete function space type
Definition: dginversemass.hh:78
void applyLocal(const EntityType &entity) const
apply inverse mass matrix locally
Definition: dginversemass.hh:148
DGInverseMassPass(const DiscreteModelType &discreteModel, PreviousPass &previousPass, const DiscreteFunctionSpaceType &space, const int volQuadOrd=-1, const int faceQuadOrd=-1)
constructor for use with thread pass
Definition: dginversemass.hh:101
DGInverseMassPass(PreviousPass &previousPass, const DiscreteFunctionSpaceType &space)
Definition: dginversemass.hh:92
void prepare(const TotalArgumentType &argument, DestinationType &destination) const
interface method
Definition: dginversemass.hh:122
Definition: discretemodel.hh:423
quadrature class supporting base function caching
Definition: cachingquadrature.hh:38