Panzer Version of the Day
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
panzer::Integrator_BasisTimesScalar< EvalT, Traits > Class Template Reference

Computes $ Ma(x)b(x)\cdots\int s(x)\phi(x)\,dx $. More...

#include <Panzer_Integrator_BasisTimesScalar.hpp>

Inheritance diagram for panzer::Integrator_BasisTimesScalar< EvalT, Traits >:
Inheritance graph
[legend]

Classes

struct  FieldMultTag
 This empty struct allows us to optimize operator()() depending on the number of field multipliers. More...
 

Public Member Functions

 Integrator_BasisTimesScalar (const panzer::EvaluatorStyle &evalStyle, const std::string &resName, const std::string &valName, const panzer::BasisIRLayout &basis, const panzer::IntegrationRule &ir, const double &multiplier=1, const std::vector< std::string > &fmNames=std::vector< std::string >())
 Main Constructor.
 
 Integrator_BasisTimesScalar (const Teuchos::ParameterList &p)
 ParameterList Constructor.
 
void postRegistrationSetup (typename Traits::SetupData sd, PHX::FieldManager< Traits > &fm)
 Post-Registration Setup.
 
void evaluateFields (typename Traits::EvalData workset)
 Evaluate Fields.
 
template<int NUM_FIELD_MULT>
KOKKOS_INLINE_FUNCTION void operator() (const FieldMultTag< NUM_FIELD_MULT > &tag, const std::size_t &cell) const
 Perform the integration.
 
template<int NUM_FIELD_MULT>
KOKKOS_INLINE_FUNCTION void operator() (const FieldMultTag< NUM_FIELD_MULT > &, const size_t &cell) const
 
- Public Member Functions inherited from panzer::EvaluatorWithBaseImpl< Traits >
void setDetailsIndex (const int di)
 An evaluator builder sets the details index.
 
- Public Member Functions inherited from panzer::DomainEvaluator
 DomainEvaluator (DomainType domain=ALL)
 Constructor.
 
virtual ~DomainEvaluator ()=default
 Default destructor.
 
void setDomain (const DomainType domain)
 Set the domain for the evaluator.
 
DomainType getDomain ()
 Get the domain for the evaluator.
 
virtual int cellStartIndex (const panzer::Workset &workset) const
 Returns the starting cell for the specified domain for a given workset.
 
virtual int cellEndIndex (const panzer::Workset &workset) const
 Returns the non-inclusive end cell for the specified domain for a given workset.
 

Private Types

using ScalarT = typename EvalT::ScalarT
 The scalar type.
 

Private Member Functions

Teuchos::RCP< Teuchos::ParameterList > getValidParameters () const
 Get Valid Parameters.
 

Private Attributes

const panzer::EvaluatorStyle evalStyle_
 An enum determining the behavior of this Evaluator.
 
PHX::MDField< ScalarT, panzer::Cell, panzer::BASISfield_
 A field to which we'll contribute, or in which we'll store, the result of computing this integral.
 
PHX::MDField< const ScalarT, panzer::Cell, panzer::IPscalar_
 A field representing the scalar function we're integrating ( $ s $).
 
double multiplier_
 The scalar multiplier out in front of the integral ( $ M
       $).
 
std::vector< PHX::MDField< const ScalarT, panzer::Cell, panzer::IP > > fieldMults_
 The (possibly empty) list of fields that are multipliers out in front of the integral ( $ a(x) $, $ b(x) $, etc.).
 
PHX::View< Kokkos::View< const ScalarT **, typename PHX::DevLayout< ScalarT >::type, Kokkos::MemoryUnmanaged > * > kokkosFieldMults_
 The PHX::View representation of the (possibly empty) list of fields that are multipliers out in front of the integral ( $ a(x) $, $ b(x) $, etc.).
 
int numQP_
 The number of quadrature points for each cell.
 
std::string basisName_
 The name of the basis we're using.
 
std::size_t basisIndex_
 The index in the Workset bases for our particular BasisIRLayout name.
 
PHX::MDField< double, panzer::Cell, panzer::BASIS, panzer::IPbasis_
 The scalar basis information necessary for integration.
 
PHX::View< ScalarT * > tmp_
 For storing temporaries, one value per thread.
 
PHX::View< ScalarT * > tmp2_
 For storing temporaries, one value per thread.
 

Additional Inherited Members

- Public Types inherited from panzer::DomainEvaluator
enum  DomainType : int {
  OWNED =0 , GHOST =1 , REAL =2 , VIRTUAL =3 ,
  EXTERNAL =4 , ALL =5
}
 Domain types supported by worksets. More...
 
- Protected Attributes inherited from panzer::EvaluatorWithBaseImpl< Traits >
WorksetDetailsAccessor wda
 

Detailed Description

template<typename EvalT, typename Traits>
class panzer::Integrator_BasisTimesScalar< EvalT, Traits >

Computes $ Ma(x)b(x)\cdots\int s(x)\phi(x)\,dx $.

Evaluates the integral

\[
  Ma(x)b(x)\cdots\int s(x)\phi(x)\,dx,
\]

where $ M $ is some constant, $ a(x) $, $ b(x) $, etc., are some fields that depend on position, $ s $ is some scalar function, and $ \phi $ is some scalar basis.

Definition at line 80 of file Panzer_Integrator_BasisTimesScalar.hpp.

Member Typedef Documentation

◆ ScalarT

template<typename EvalT , typename Traits >
using panzer::Integrator_BasisTimesScalar< EvalT, Traits >::ScalarT = typename EvalT::ScalarT
private

The scalar type.

Definition at line 254 of file Panzer_Integrator_BasisTimesScalar.hpp.

Constructor & Destructor Documentation

◆ Integrator_BasisTimesScalar() [1/2]

template<typename EvalT , typename Traits >
panzer::Integrator_BasisTimesScalar< EvalT, Traits >::Integrator_BasisTimesScalar ( const panzer::EvaluatorStyle & evalStyle,
const std::string & resName,
const std::string & valName,
const panzer::BasisIRLayout & basis,
const panzer::IntegrationRule & ir,
const double & multiplier = 1,
const std::vector< std::string > & fmNames = std::vector<std::string>() )

Main Constructor.

Creates an Evaluator to evaluate the integral

\[
  Ma(x)b(x)\cdots\int s(x)\phi(x)\,dx,
\]

where $ M $ is some constant, $ a(x) $, $ b(x) $, etc., are some fields that depend on position, $ s $ is some scalar function, and $ \phi $ is some scalar basis.

Parameters
[in]evalStyleAn enum declaring the behavior of this Evaluator, which is to either:
  • compute and contribute (CONTRIBUTES), or
  • compute and store (EVALUATES).
[in]resNameThe name of either the contributed or evaluated field, depending on evalStyle.
[in]valNameThe name of the scalar value being integrated ( $ s $).
[in]basisThe scalar basis that you'd like to use ( $
                      \phi $).
[in]irThe integration rule that you'd like to use.
[in]multiplierThe scalar multiplier out in front of the integral you're computing ( $ M $). If not specified, this defaults to 1.
[in]fmNamesA list of names of fields that are multipliers out in front of the integral you're computing ( $ a(x) $, $ b(x) $, etc.). If not specified, this defaults to an empty vector.
Exceptions
std::invalid_argumentIf any of the inputs are invalid.
std::logic_errorIf the basis supplied is not a scalar basis.

Definition at line 65 of file Panzer_Integrator_BasisTimesScalar_impl.hpp.

◆ Integrator_BasisTimesScalar() [2/2]

template<typename EvalT , typename Traits >
panzer::Integrator_BasisTimesScalar< EvalT, Traits >::Integrator_BasisTimesScalar ( const Teuchos::ParameterList & p)

ParameterList Constructor.

Creates an Evaluator to evaluate the integral

\[
  Ma(x)b(x)\cdots\int s(x)\phi(x)\,dx,
\]

where $ M $ is some constant, $ a(x) $, $ b(x) $, etc., are some fields that depend on position, $ s $ is some scalar function, and $ \phi $ is some scalar basis.

Note
This constructor exists to preserve the older way of creating an Evaluator with a ParameterList; however, it is strongly advised that you not use this ParameterList Constructor, but rather that you favor the Main Constructor with its compile-time argument checking instead.
Parameters
[in]pA ParameterList of the form
<ParameterList>
<Parameter name = "Residual Name" type = "std::string" value = (required) />
<Parameter name = "Value Name" type = "std::string" value = (required) />
<Parameter name = "Basis" type = "RCP<panzer::BasisIRLayout>" value = (required) />
<Parameter name = "IR" type = "RCP<panzer::IntegrationRule>" value = (required) />
<Parameter name = "Multiplier" type = "double" value = (required) />
<Parameter name = "Field Multipliers" type = "RCP<const std::vector<std::string>>" value = null (default)/>
</ParameterList>
where
  • "Residual Name" is the name for the term this Evaluator is evaluating,
  • "Value Name" is the name of the scalar value being integrated ( $ s $),
  • "Basis" is the scalar basis that you'd like to use ( $ \phi $),
  • "IR" is the integration rule that you'd like to use,
  • "Multiplier" is the scalar multiplier out in front of the integral you're computing ( $ M $), and
  • "Field Multipliers" is an optional list of names of fields that are multipliers out in front of the integral you're computing ( $ a(x) $, $ b(x) $, etc.).

Definition at line 142 of file Panzer_Integrator_BasisTimesScalar_impl.hpp.

Member Function Documentation

◆ postRegistrationSetup()

template<typename EvalT , typename Traits >
void panzer::Integrator_BasisTimesScalar< EvalT, Traits >::postRegistrationSetup ( typename Traits::SetupData sd,
PHX::FieldManager< Traits > & fm )

Post-Registration Setup.

Get the PHX::Views of the field multipliers, and determine the index in the Workset bases for our particular basis name.

Parameters
[in]sdEssentially a list of Worksets, which are collections of cells (elements) that all live on a single process.
[in]fmThis is unused, though part of the interface.

Definition at line 173 of file Panzer_Integrator_BasisTimesScalar_impl.hpp.

◆ evaluateFields()

template<typename EvalT , typename Traits >
void panzer::Integrator_BasisTimesScalar< EvalT, Traits >::evaluateFields ( typename Traits::EvalData workset)

Evaluate Fields.

This actually performs the integration by calling operator()() in a Kokkos::parallel_for over the cells in the Workset.

Parameters
[in]worksetThe Workset on which you're going to do the integration.

Definition at line 279 of file Panzer_Integrator_BasisTimesScalar_impl.hpp.

◆ operator()() [1/2]

template<typename EvalT , typename Traits >
template<int NUM_FIELD_MULT>
KOKKOS_INLINE_FUNCTION void panzer::Integrator_BasisTimesScalar< EvalT, Traits >::operator() ( const FieldMultTag< NUM_FIELD_MULT > & tag,
const std::size_t & cell ) const

Perform the integration.

Generally speaking, for a given cell in the Workset, this routine loops over quadrature points and bases to perform the integration, scaling the vector field to be integrated by the multiplier ( $ M
$) and any field multipliers ( $ a(x) $, $ b(x) $, etc.).

Note
Optimizations are made for the cases in which we have no field multipliers or only a single one.
Parameters
[in]tagAn indication of the number of field multipliers we have; either 0, 1, or something else.
[in]cellThe cell in the Workset over which to integrate.

◆ getValidParameters()

template<typename EvalT , typename TRAITS >
Teuchos::RCP< Teuchos::ParameterList > panzer::Integrator_BasisTimesScalar< EvalT, TRAITS >::getValidParameters ( ) const
private

Get Valid Parameters.

Get all the parameters that we support such that the ParameterList Constructor can do some validation of the input ParameterList.

Returns
A ParameterList with all the valid parameters (keys) in it. The values tied to those keys are meaningless default values.

Definition at line 307 of file Panzer_Integrator_BasisTimesScalar_impl.hpp.

◆ operator()() [2/2]

template<typename EvalT , typename Traits >
template<int NUM_FIELD_MULT>
KOKKOS_INLINE_FUNCTION void panzer::Integrator_BasisTimesScalar< EvalT, Traits >::operator() ( const FieldMultTag< NUM_FIELD_MULT > & ,
const size_t & cell ) const

Definition at line 214 of file Panzer_Integrator_BasisTimesScalar_impl.hpp.

Member Data Documentation

◆ evalStyle_

template<typename EvalT , typename Traits >
const panzer::EvaluatorStyle panzer::Integrator_BasisTimesScalar< EvalT, Traits >::evalStyle_
private

An enum determining the behavior of this Evaluator.

This Evaluator will compute the result of its integration and then:

  • CONTRIBUTES: contribute it to a specified residual, not saving anything; or
  • EVALUATES: save it under a specified name for future use.

Definition at line 264 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ field_

template<typename EvalT , typename Traits >
PHX::MDField<ScalarT, panzer::Cell, panzer::BASIS> panzer::Integrator_BasisTimesScalar< EvalT, Traits >::field_
private

A field to which we'll contribute, or in which we'll store, the result of computing this integral.

Definition at line 270 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ scalar_

template<typename EvalT , typename Traits >
PHX::MDField<const ScalarT, panzer::Cell, panzer::IP> panzer::Integrator_BasisTimesScalar< EvalT, Traits >::scalar_
private

A field representing the scalar function we're integrating ( $ s $).

Definition at line 276 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ multiplier_

template<typename EvalT , typename Traits >
double panzer::Integrator_BasisTimesScalar< EvalT, Traits >::multiplier_
private

The scalar multiplier out in front of the integral ( $ M
       $).

Definition at line 282 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ fieldMults_

template<typename EvalT , typename Traits >
std::vector<PHX::MDField<const ScalarT, panzer::Cell, panzer::IP> > panzer::Integrator_BasisTimesScalar< EvalT, Traits >::fieldMults_
private

The (possibly empty) list of fields that are multipliers out in front of the integral ( $ a(x) $, $ b(x) $, etc.).

Definition at line 288 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ kokkosFieldMults_

template<typename EvalT , typename Traits >
PHX::View<Kokkos::View<const ScalarT**, typename PHX::DevLayout<ScalarT>::type, Kokkos::MemoryUnmanaged>*> panzer::Integrator_BasisTimesScalar< EvalT, Traits >::kokkosFieldMults_
private

The PHX::View representation of the (possibly empty) list of fields that are multipliers out in front of the integral ( $ a(x) $, $ b(x) $, etc.).

Definition at line 295 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ numQP_

template<typename EvalT , typename Traits >
int panzer::Integrator_BasisTimesScalar< EvalT, Traits >::numQP_
private

The number of quadrature points for each cell.

Definition at line 300 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ basisName_

template<typename EvalT , typename Traits >
std::string panzer::Integrator_BasisTimesScalar< EvalT, Traits >::basisName_
private

The name of the basis we're using.

Definition at line 305 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ basisIndex_

template<typename EvalT , typename Traits >
std::size_t panzer::Integrator_BasisTimesScalar< EvalT, Traits >::basisIndex_
private

The index in the Workset bases for our particular BasisIRLayout name.

Definition at line 311 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ basis_

template<typename EvalT , typename Traits >
PHX::MDField<double, panzer::Cell, panzer::BASIS, panzer::IP> panzer::Integrator_BasisTimesScalar< EvalT, Traits >::basis_
private

The scalar basis information necessary for integration.

Definition at line 316 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ tmp_

template<typename EvalT , typename Traits >
PHX::View<ScalarT*> panzer::Integrator_BasisTimesScalar< EvalT, Traits >::tmp_
private

For storing temporaries, one value per thread.

Definition at line 319 of file Panzer_Integrator_BasisTimesScalar.hpp.

◆ tmp2_

template<typename EvalT , typename Traits >
PHX::View<ScalarT*> panzer::Integrator_BasisTimesScalar< EvalT, Traits >::tmp2_
private

For storing temporaries, one value per thread.

Definition at line 321 of file Panzer_Integrator_BasisTimesScalar.hpp.


The documentation for this class was generated from the following files: