1#ifndef LinElasFirstOrder_def_hpp
2#define LinElasFirstOrder_def_hpp
3#include "LinElasFirstOrder_decl.hpp"
6template<
class SC,
class LO,
class GO,
class NO>
7LinElasFirstOrder<SC,LO,GO,NO>::LinElasFirstOrder(
const DomainConstPtr_Type &domain, std::string FEType, ParameterListPtr_Type parameterList):
8Problem_Type(parameterList, domain->getComm())
16 this->addVariable( domain , FEType ,
"d_s" ,domain->getDimension() );
17 this->addVariable( domain , FEType ,
"v_s" ,domain->getDimension() );
18 this->dim_ = this->getDomain(0)->getDimension();
21template<
class SC,
class LO,
class GO,
class NO>
22LinElasFirstOrder<SC,LO,GO,NO>::~LinElasFirstOrder()
27template<
class SC,
class LO,
class GO,
class NO>
28void LinElasFirstOrder<SC,LO,GO,NO>::info(){
32template<
class SC,
class LO,
class GO,
class NO>
33void LinElasFirstOrder<SC,LO,GO,NO>::assemble( std::string type )
const
36 std::cout <<
"-- Assembly linear elasticity first order ... " << std::flush;
39 double density = this->parameterList_->sublist(
"Parameter").get(
"Density",1.);
40 double poissonRatio = this->parameterList_->sublist(
"Parameter").get(
"Poisson Ratio",0.4);
41 double mu = this->parameterList_->sublist(
"Parameter").get(
"Mu",2.0e+6);
44 double youngModulus = mu*2.*(1 + poissonRatio);
45 double lambda = (poissonRatio*youngModulus)/((1 + poissonRatio)*(1 - 2*poissonRatio));
48 MatrixPtr_Type K = Teuchos::rcp(
new Matrix_Type( this->getDomain(0)->getMapVecFieldUnique(), this->getDomain(0)->getApproxEntriesPerRow() ) );
52 this->feFactory_->assemblyLinElasXDim( this->dim_, this->getDomain(0)->getFEType(), K, lambda, mu );
57 MatrixPtr_Type I = Teuchos::rcp(
new Matrix_Type( this->getDomain(1)->getMapVecFieldUnique(), 1 ) );
58 this->feFactory_->assemblyIdentity( I );
64 this->system_->addBlock( K, 0, 0 );
65 this->system_->addBlock( I, 1, 1 );
71 this->assembleSourceTerm( 0. );
73 this->rhs_->addBlock( this->sourceTerm_->getBlockNonConst(0), 0 );
76 std::cout <<
"done -- " << std::endl;
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5