1#ifndef GEOMETRY_def_hpp
2#define GEOMETRY_def_hpp
4#include "feddlib/core/FE/Domain.hpp"
5#include "feddlib/core/FE/FE.hpp"
9void ZeroFErhsFunc2D(
double* x,
double* result,
double* parameters)
18void ZeroFErhsFunc3D(
double* x,
double* result,
double* parameters)
27double HeuristicScaling(
double* x,
double* parameter)
29 if(x[0] < parameter[0])
40template<
class SC,
class LO,
class GO,
class NO>
41Geometry<SC,LO,GO,NO>::Geometry(
const DomainConstPtr_Type &domain, std::string FEType, ParameterListPtr_Type parameterList):
42Problem_Type(parameterList,domain->getComm())
44 this->addVariable( domain , FEType ,
"d_f" , domain->getDimension());
45 this->dim_ = this->getDomain(0)->getDimension();
49template<
class SC,
class LO,
class GO,
class NO>
50Geometry<SC,LO,GO,NO>::~Geometry()
55template<
class SC,
class LO,
class GO,
class NO>
56void Geometry<SC,LO,GO,NO>::info(){
60template<
class SC,
class LO,
class GO,
class NO>
61void Geometry<SC,LO,GO,NO>::assemble( std::string type )
const
64 MatrixPtr_Type H = Teuchos::rcp(
new Matrix_Type( this->getDomain(0)->getMapVecFieldUnique(), this->getDomain(0)->getDimension() * this->getDomain(0)->getApproxEntriesPerRow() ) );
66 if (this->parameterList_->sublist(
"Parameter").get(
"Model",
"Laplace")==
"Laplace"){
68 std::cout <<
"-- Assembly Geometry (scaled Laplace)... " << std::flush;
69 double distanceLaplace = this->parameterList_->sublist(
"Parameter").get(
"Distance Laplace",0.03);
70 double coefficientLaplace = this->parameterList_->sublist(
"Parameter").get(
"Coefficient Laplace",1000.);
72 std::cout <<
"\n Distance Laplace = " << distanceLaplace <<
" coefficient Laplace = " << coefficientLaplace <<
" ... " << std::flush;
74 vec_dbl_Type parameter(2);
75 parameter[0] = distanceLaplace;
76 parameter[1] = coefficientLaplace;
78 this->feFactory_->assemblyLaplaceXDim(this->dim_, this->getDomain(0)->getFEType(), H, HeuristicScaling, &(parameter.at(0)) );
80 else if (this->parameterList_->sublist(
"Parameter").get(
"Model",
"Laplace")==
"Elasticity"){
82 std::cout <<
"-- Assembly Geometry (linear elasticity)... " << std::flush;
83 double poissonRatio = this->parameterList_->sublist(
"Parameter").get(
"Poisson Ratio",0.3);
84 double mu = this->parameterList_->sublist(
"Parameter").get(
"Mu",2.0e+6);
85 double youngModulus = mu*2.*(1 + poissonRatio);
86 double lambda = (poissonRatio*youngModulus)/((1 + poissonRatio)*(1 - 2*poissonRatio));
88 std::cout <<
"\n Poisson ratio = " << poissonRatio <<
" mu = "<<mu <<
" lambda = "<< lambda <<
" E = " << youngModulus <<
"... " << std::flush;
91 this->feFactory_->assemblyLinElasXDim( this->dim_, this->getDomain(0)->getFEType(), H, lambda, mu );
94 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"Unknown model for geometry.");
96 this->system_->addBlock( H, 0, 0 );
98 this->assembleSourceTerm( 0. );
100 this->addToRhs( this->sourceTerm_ );
103 std::cout <<
"done -- " << std::endl;
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36