1#ifndef ELASTICITY_def_hpp
2#define ELASTICITY_def_hpp
3#include "Elasticity_decl.hpp"
14template<
class SC,
class LO,
class GO,
class NO>
15Elasticity<SC,LO,GO,NO>::Elasticity(
const DomainConstPtr_Type &domain, std::string FEType, ParameterListPtr_Type parameterList)
17 if(parameterList->sublist(
"Parameter").get(
"Material model",
"linear")==
"linear")
18 linearProblem_ = Teuchos::rcp(
new LinElas_Type( domain, FEType, parameterList ) );
20 nonLinearProblem_ = Teuchos::rcp(
new NonLinElas_Type( domain, FEType, parameterList ) );
22template<
class SC,
class LO,
class GO,
class NO>
23Elasticity<SC,LO,GO,NO>::~Elasticity(){
24 linearProblem_.reset();
25 nonLinearProblem_.reset();
28template<
class SC,
class LO,
class GO,
class NO>
29void Elasticity<SC,LO,GO,NO>::info(){
31 if(!nonLinearProblem_.is_null())
32 this->infoNonlinProblem();
35template<
class SC,
class LO,
class GO,
class NO>
36void Elasticity<SC,LO,GO,NO>::assemble(){
37 if(!nonLinearProblem_.is_null())
38 nonLinearProblem_->assemble();
40 linearProblem_->assemble();
43template<
class SC,
class LO,
class GO,
class NO>
44void Elasticity<SC,LO,GO,NO>::reAssemble(std::string type)
const {
46 if(!nonLinearProblem_.is_null())
47 nonLinearProblem_->reAssemble( type );
49 if(this->getVerbose())
50 std::cout <<
"-- Nothing to reassemble for linear elasticity --" << std::endl;
55template<
class SC,
class LO,
class GO,
class NO>
56void Elasticity<SC,LO,GO,NO>::reAssembleExtrapolation(){
58 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"Only Newton/NOX implemented for nonlinear material models!");
62template<
class SC,
class LO,
class GO,
class NO>
63void Elasticity<SC,LO,GO,NO>::evalModelImpl(
const Thyra::ModelEvaluatorBase::InArgs<SC> &inArgs,
64 const Thyra::ModelEvaluatorBase::OutArgs<SC> &outArgs
67 if(!nonLinearProblem_.is_null())
68 nonLinearProblem_->evalModelImpl( inArgs, outArgs );
70 if(this->getVerbose())
71 std::cout <<
"-- Nothing to evaluate for linear elasticity --" << std::endl;
76template<
class SC,
class LO,
class GO,
class NO>
77Teuchos::RCP<Thyra::LinearOpBase<SC> > Elasticity<SC,LO,GO,NO>::create_W_op()
const
80 if(!nonLinearProblem_.is_null())
81 return nonLinearProblem_->create_W_op( );
83 if(this->getVerbose())
84 std::cout <<
"-- No create_W_op for linear elasticity --" << std::endl;
85 Teuchos::RCP<Thyra::LinearOpBase<SC> > W_opDummy;
90template<
class SC,
class LO,
class GO,
class NO>
91Teuchos::RCP<Thyra::PreconditionerBase<SC> > Elasticity<SC,LO,GO,NO>::create_W_prec()
const
94 if(!nonLinearProblem_.is_null())
95 return nonLinearProblem_->create_W_prec( );
97 if(this->getVerbose())
98 std::cout <<
"-- No create_W_prec for linear elasticity --" << std::endl;
99 Teuchos::RCP<Thyra::PreconditionerBase<SC> > W_precDummy;
104template<
class SC,
class LO,
class GO,
class NO>
105void Elasticity<SC,LO,GO,NO>::calculateNonLinResidualVec(std::string type)
const{
107 if(!nonLinearProblem_.is_null())
108 return nonLinearProblem_->calculateNonLinResidualVec( type );
110 if(this->getVerbose())
111 std::cout <<
"-- No computation of nonlinear residual for linear elasticity --" << std::endl;
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5