Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
LinElasAssFE_def.hpp
1#ifndef LINELASASSFE_def_hpp
2#define LINELASASSFE_def_hpp
3#include "LinElas_decl.hpp"
4namespace FEDD {
5
6
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() )
10{
11 // Bem.: Hier benutzen wir auch direkt den Konstruktor der Klasse Problem, wo z.B. parameterList auf parameterList_ gesetzt wird
12
13 // d_s steht displacement (d) der Struktur (_s). Im Allgemeinen vektorwertig, daher domainDisplacement->GetDimension().
14 // Andernfalls benutzen wir stattdessen 1
15
16 // Siehe Problem_def.hpp fuer die Funktion AddVariable()
17 this->addVariable( domain , FEType , "d_s" ,domain->getDimension() );
18 this->dim_ = this->getDomain(0)->getDimension();
19
20 d_rep_ = Teuchos::rcp( new MultiVector_Type( this->getDomain(0)->getMapVecFieldRepeated() ) );
21}
22
23template<class SC,class LO,class GO,class NO>
24LinElasAssFE<SC,LO,GO,NO>::~LinElasAssFE()
25{
26
27}
28
29template<class SC,class LO,class GO,class NO>
30void LinElasAssFE<SC,LO,GO,NO>::info(){
31 this->infoProblem();
32}
33
34template<class SC,class LO,class GO,class NO>
35void LinElasAssFE<SC,LO,GO,NO>::assemble( std::string type ) const
36{
37 if(this->verbose_)
38 std::cout << "-- Assembly linear elasticity ... " << std::flush;
39 // Initialisiere die Steifigkeitsmatrix. Das letzte Argument gibt die (ungefaehre) Anzahl an Eintraege pro Zeile an
40 MatrixPtr_Type K = Teuchos::rcp(new Matrix_Type( this->getDomain(0)->getMapVecFieldUnique(), this->getDomain(0)->getDimension() * this->getDomain(0)->getApproxEntriesPerRow() ) );
41 // MatrixPtr_Type K = Teuchos::rcp(new Matrix_Type( this->domainPtr_vec_.at(0)->getMapVecFieldUnique(), 10 ) );
42
43 MultiVectorConstPtr_Type d = this->solution_->getBlock(0);
44
45 d_rep_->importFromVector(d, true);
46
47 this->system_->addBlock( K, 0, 0 );
48 // Assembliere die Steifigkeitsmatrix. Die 2 gibt degree an, d.h. die Ordnung der Quadraturformel, die benutzt werden soll.
49 this->feFactory_->assemblyLinearElasticity(this->dim_, this->getDomain(0)->getFEType(),2, this->dim_, d_rep_, this->system_, this->rhs_, this->parameterList_,false, "Jacobian", true);
50
51 // Setup fuer die linke Seite des zu loesdenen GLS. Beachte, dass system_ via system_() im Standardkonstruktor (von der Klasse Problem)
52 // initialisiert worden ist, hier wird dieser also erst richtig initialisiert.
53 // Ein Objekt der Klasse Bmat ist eine Blockmatrix; also ist system_ eine Blockmatrix (Objekt von BMat)
54
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_ );
61
62 if (this->verbose_)
63 std::cout << "done -- " << std::endl;
64}
65
66}
67#endif
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5