4#include "feddlib/core/FE/Domain.hpp"
5#include "feddlib/core/FE/FE.hpp"
18void rhsFunc2D(
double* x,
double* result,
double* parameters)
31void rhsFunc3D(
double* x,
double* result,
double* parameters)
42template<
class SC,
class LO,
class GO,
class NO>
43LinElas<SC,LO,GO,NO>::LinElas(
const DomainConstPtr_Type &domain, std::string FEType, ParameterListPtr_Type parameterList):
44Problem_Type(parameterList, domain->getComm() )
52 this->addVariable( domain , FEType ,
"d_s" ,domain->getDimension() );
53 this->dim_ = this->getDomain(0)->getDimension();
55 d_rep_ = Teuchos::rcp(
new MultiVector_Type( this->getDomain(0)->getMapVecFieldRepeated() ) );
59template<
class SC,
class LO,
class GO,
class NO>
60LinElas<SC,LO,GO,NO>::~LinElas()
65template<
class SC,
class LO,
class GO,
class NO>
66void LinElas<SC,LO,GO,NO>::info(){
70template<
class SC,
class LO,
class GO,
class NO>
71void LinElas<SC,LO,GO,NO>::assemble( std::string type )
const
74 std::cout <<
"-- Assembly linear elasticity ... " << std::flush;
77 double density = this->parameterList_->sublist(
"Parameter").get(
"Density",1000.);
79 double poissonRatio = this->parameterList_->sublist(
"Parameter").get(
"Poisson Ratio",0.4);
80 double mu = this->parameterList_->sublist(
"Parameter").get(
"Mu",2.0e+6);
83 double youngModulus = mu*2.*(1 + poissonRatio);
85 double lambda = (poissonRatio*youngModulus)/((1 + poissonRatio)*(1 - 2*poissonRatio));
88 MatrixPtr_Type K = Teuchos::rcp(
new Matrix_Type( this->getDomain(0)->getMapVecFieldUnique(), this->getDomain(0)->getDimension() * this->getDomain(0)->getApproxEntriesPerRow() ) );
92#ifdef FEDD_HAVE_ACEGENINTERFACE
93 bool useInterface = this->parameterList_->sublist(
"Parameter").get(
"Use AceGen Interface",
true);
94 if(this->getFEType(0) ==
"P2" && useInterface && this->dim_==3){
95 MultiVectorConstPtr_Type d = this->solution_->getBlock(0);
96 d_rep_->importFromVector(d,
true);
98 this->system_->addBlock( K, 0, 0 );
100 this->feFactory_->assemblyLinearElasticity(this->dim_, this->getDomain(0)->getFEType(),2, this->dim_, d_rep_, this->system_, this->rhs_, this->parameterList_,
false,
"Jacobian",
true);
103 this->feFactory_->assemblyLinElasXDim( this->dim_, this->getDomain(0)->getFEType(), K, lambda, mu );
105 this->feFactory_->assemblyLinElasXDim( this->dim_, this->getDomain(0)->getFEType(), K, lambda, mu );
112 this->system_->addBlock( K, 0, 0 );
114 this->assembleSourceTerm( 0. );
116 this->addToRhs( this->sourceTerm_ );
119 std::cout <<
"done -- " << std::endl;
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36