Tempus
Version of the Day
Time Integration
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp
Go to the documentation of this file.
1
// @HEADER
2
// ****************************************************************************
3
// Tempus: Copyright (2017) Sandia Corporation
4
//
5
// Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6
// ****************************************************************************
7
// @HEADER
8
9
#ifndef Tempus_StepperNewmarkImplicitAFormModifierXBase_hpp
10
#define Tempus_StepperNewmarkImplicitAFormModifierXBase_hpp
11
12
#include "Tempus_config.hpp"
13
#include "Tempus_SolutionHistory.hpp"
14
#include "
Tempus_StepperNewmarkImplicitAFormAppAction.hpp
"
15
16
17
namespace
Tempus {
18
36
template
<
class
Scalar>
37
class
StepperNewmarkImplicitAFormModifierXBase
38
:
virtual
public
Tempus::StepperNewmarkImplicitAFormAppAction
<Scalar>
39
{
40
private
:
41
42
/* \brief Adaptor execute function
43
*
44
* This is an adaptor function to bridge between the AppAction
45
* interface and the ModifierX interface. It is meant to be private
46
* and non-virtual as deriving from this class should only need to
47
* implement the modify function.
48
*
49
* For the ModifierX interface, this adaptor maps the
50
* StepperNewmarkImplicitAFormAppAction::ACTION_LOCATION to the
51
* StepperNewmarkImplicitAFormModifierX::MODIFIERX_TYPE, and only pass the solution
52
* (\f$x\f$ and/or \f$\dot{x}\f$ and other parameters to the modify
53
* function.
54
*/
55
void
execute
(
56
Teuchos::RCP
<
SolutionHistory<Scalar>
> sh,
57
Teuchos::RCP
<
StepperNewmarkImplicitAForm<Scalar>
> stepper,
58
const
typename
StepperNewmarkImplicitAFormAppAction<Scalar>::ACTION_LOCATION
actLoc)
59
{
60
using
Teuchos::RCP
;
61
62
MODIFIER_TYPE
modType =
X_BEGIN_STEP
;
63
RCP<SolutionState<Scalar> > workingState = sh->getWorkingState();
64
const
Scalar time = workingState->getTime();
65
const
Scalar dt = workingState->getTimeStep();
66
RCP<Thyra::VectorBase<Scalar> > x;
67
68
switch
(actLoc) {
69
case
StepperNewmarkImplicitAFormAppAction<Scalar>::BEGIN_STEP
:
70
{
71
modType =
X_BEGIN_STEP
;
72
x = workingState->getX();
73
break
;
74
}
75
case
StepperNewmarkImplicitAFormAppAction<Scalar>::BEFORE_SOLVE
:
76
{
77
modType =
X_BEFORE_SOLVE
;
78
x = workingState->getX();
79
break
;
80
}
81
case
StepperNewmarkImplicitAFormAppAction<Scalar>::AFTER_SOLVE
:
82
{
83
modType =
X_AFTER_SOLVE
;
84
x = workingState->getX();
85
break
;
86
}
87
case
StepperNewmarkImplicitAFormAppAction<Scalar>::END_STEP
:
88
{
89
modType =
X_END_STEP
;
90
x = workingState->getX();
91
break
;
92
}
93
default
:
94
TEUCHOS_TEST_FOR_EXCEPTION
(
true
, std::logic_error,
95
"Error - unknown action location.\n"
);
96
}
97
98
this->
modify
(x, time, dt, modType);
99
}
100
101
public
:
102
104
enum
MODIFIER_TYPE
{
105
X_BEGIN_STEP
,
106
X_BEFORE_SOLVE
,
107
X_AFTER_SOLVE
,
108
X_END_STEP
109
};
110
112
virtual
void
modify
(
113
Teuchos::RCP
<
Thyra::VectorBase<Scalar>
>
/* x */
,
114
const
Scalar
/* time */
,
const
Scalar
/* dt */
,
115
const
MODIFIER_TYPE
modType) = 0;
116
117
};
118
119
}
// namespace Tempus
120
121
#endif // Tempus_StepperNewmarkImplicitAFormModifierXBase_hpp
Tempus::StepperNewmarkImplicitAFormAppAction
Application Action for StepperNewmarkImplicitAForm.
Definition:
Tempus_StepperNewmarkImplicitAFormAppAction.hpp:34
TEUCHOS_TEST_FOR_EXCEPTION
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Tempus::StepperNewmarkImplicitAFormModifierXBase::execute
void execute(Teuchos::RCP< SolutionHistory< Scalar > > sh, Teuchos::RCP< StepperNewmarkImplicitAForm< Scalar > > stepper, const typename StepperNewmarkImplicitAFormAppAction< Scalar >::ACTION_LOCATION actLoc)
Execute application action for NewmarkImplicitAForm Stepper.
Definition:
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp:55
Tempus::StepperNewmarkImplicitAFormModifierXBase::modify
virtual void modify(Teuchos::RCP< Thyra::VectorBase< Scalar > >, const Scalar, const Scalar, const MODIFIER_TYPE modType)=0
Modify solution based on the MODIFIER_TYPE.
Tempus::StepperNewmarkImplicitAFormModifierXBase< double >::MODIFIER_TYPE
MODIFIER_TYPE
Indicates the location of application action (see algorithm).
Definition:
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp:104
Tempus::StepperNewmarkImplicitAFormModifierXBase::X_BEGIN_STEP
Modify at the beginning of the step.
Definition:
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp:105
Thyra::VectorBase
Tempus_StepperNewmarkImplicitAFormAppAction.hpp
Tempus::SolutionHistory
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Definition:
Tempus_Integrator.hpp:25
Tempus::StepperNewmarkImplicitAFormModifierXBase
Base ModifierX for StepperNewmarkImplicitAForm.
Definition:
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp:37
Tempus::StepperNewmarkImplicitAFormModifierXBase::X_AFTER_SOLVE
Modify after the implicit solve.
Definition:
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp:107
Teuchos::RCP
Tempus::StepperNewmarkImplicitAFormModifierXBase::X_END_STEP
Modify at the end of the step.
Definition:
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp:108
Tempus::StepperNewmarkImplicitAFormAppAction::ACTION_LOCATION
ACTION_LOCATION
Indicates the location of application action (see algorithm).
Definition:
Tempus_StepperNewmarkImplicitAFormAppAction.hpp:39
Tempus::StepperNewmarkImplicitAForm
Newmark time stepper in acceleration form (a-form).
Definition:
Tempus_StepperNewmarkImplicitAForm_decl.hpp:92
Tempus::StepperNewmarkImplicitAFormModifierXBase::X_BEFORE_SOLVE
Modify before the implicit solve.
Definition:
Tempus_StepperNewmarkImplicitAFormModifierXBase.hpp:106
Generated by
1.8.5