1#ifndef LINELASASSFE_def_hpp
2#define LINELASASSFE_def_hpp
3#include "LinElas_decl.hpp"
7template<
class SC,
class LO,
class GO,
class NO>
8LinElasAssFE<SC,LO,GO,NO>::LinElasAssFE(
const DomainConstPtr_Type &domain, std::string FEType, ParameterListPtr_Type parameterList):
9Problem_Type(parameterList, domain->getComm() )
17 this->addVariable( domain , FEType ,
"d_s" ,domain->getDimension() );
18 this->dim_ = this->getDomain(0)->getDimension();
20 d_rep_ = Teuchos::rcp(
new MultiVector_Type( this->getDomain(0)->getMapVecFieldRepeated() ) );
23template<
class SC,
class LO,
class GO,
class NO>
24LinElasAssFE<SC,LO,GO,NO>::~LinElasAssFE()
29template<
class SC,
class LO,
class GO,
class NO>
30void LinElasAssFE<SC,LO,GO,NO>::info(){
34template<
class SC,
class LO,
class GO,
class NO>
35void LinElasAssFE<SC,LO,GO,NO>::assemble( std::string type )
const
38 std::cout <<
"-- Assembly linear elasticity ... " << std::flush;
40 MatrixPtr_Type K = Teuchos::rcp(
new Matrix_Type( this->getDomain(0)->getMapVecFieldUnique(), this->getDomain(0)->getDimension() * this->getDomain(0)->getApproxEntriesPerRow() ) );
43 MultiVectorConstPtr_Type d = this->solution_->getBlock(0);
45 d_rep_->importFromVector(d,
true);
47 this->system_->addBlock( K, 0, 0 );
49 this->feFactory_->assemblyLinearElasticity(this->dim_, this->getDomain(0)->getFEType(),2, this->dim_, d_rep_, this->system_, this->rhs_, this->parameterList_,
false,
"Jacobian",
true);
55 double density = this->parameterList_->sublist(
"Parameter").get(
"Density",1000.);
56 std::string sourceType = this->parameterList_->sublist(
"Parameter").get(
"Source Type",
"volume");
57 this->assembleSourceTerm( 0. );
58 if(sourceType ==
"volume")
59 this->sourceTerm_->scale(density);
60 this->addToRhs( this->sourceTerm_ );
63 std::cout <<
"done -- " << std::endl;
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5