Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
AssembleFE_def.hpp
1#ifndef ASSEMBLEFE_DEF_hpp
2#define ASSEMBLEFE_DEF_hpp
3
4namespace FEDD {
5
6
7template <class SC, class LO, class GO, class NO>
8AssembleFE<SC,LO,GO,NO>::AssembleFE(int flag, vec2D_dbl_Type nodesRefConfig, ParameterListPtr_Type params,tuple_disk_vec_ptr_Type tuple):
9rhsVec_(0),
10jacobian_(0),
11solution_(0)
12{
13 flag_=flag;
14 nodesRefConfig_ = nodesRefConfig;
15
16 timeStep_ =0. ;
17 newtonStep_ =0 ;
18 globalElementID_=-1; // First not set
19
20
21 params_=params;
22
23 // Reading through parameterlist
24 dim_= params_->sublist("Parameter").get("Dimension",-1);
25
26 timeIncrement_= params_->sublist("Timestepping Parameter").get("dt",0.1);
27
28 diskTuple_= tuple;
29
31
33
58}
59
60
61template <class SC, class LO, class GO, class NO>
63 TEUCHOS_TEST_FOR_EXCEPTION(dim_==-1, std::runtime_error, "Dimension not initialized");
64};
65
66
67template <class SC, class LO, class GO, class NO>
68void AssembleFE<SC,LO,GO,NO>::updateParams( ParameterListPtr_Type params){
69 params_ = params;
70
71};
72
73
74template <class SC, class LO, class GO, class NO>
76 timeIncrement_ = dt;
77 timeStep_ = timeStep_ + dt;
78};
79
80template <class SC, class LO, class GO, class NO>
82 newtonStep_ = newtonStep_+1 ;
83
84};
85
86
87template <class SC, class LO, class GO, class NO>
89 return timeStep_ ;
90
91};
92
93template <class SC, class LO, class GO, class NO>
95 return newtonStep_ ;
96
97};
98
99template <class SC, class LO, class GO, class NO>
100void AssembleFE<SC,LO,GO,NO>::updateSolution( vec_dbl_Type solution){
101
102 //TEUCHOS_TEST_FOR_EXCEPTION(solution_.size() != solution.size(), std::runtime_error, "Dofs of solutions is not the same");
103 this->solution_.reset( new vec_dbl_Type (solution.size(),0.) );
104
105 for(int i=0; i< solution.size();i++)
106 (*solution_)[i] = solution[i];
107
108};
109
110
111
112
113template <class SC, class LO, class GO, class NO>
115 return solution_;
116
118
119
120template <class SC, class LO, class GO, class NO>
122
124};
125
126
127template <class SC, class LO, class GO, class NO>
132
133
134template <class SC, class LO, class GO, class NO>
136 return dim_;
137
138};
140
141template <class SC, class LO, class GO, class NO>
143 return nodesRefConfig_;
145};
146
147
148}
149#endif
int getDim()
TODO: PostProcessing: Teuchos::Array with values and one global Array with Strings and names.
Definition AssembleFE_def.hpp:135
virtual void updateParams(ParameterListPtr_Type params)
Set or update the parameters read from the ParameterList.
Definition AssembleFE_def.hpp:68
void updateSolution(vec_dbl_Type solution)
Update the solution vector.
Definition AssembleFE_def.hpp:100
AssembleFE(int flag, vec2D_dbl_Type nodesRefConfig, ParameterListPtr_Type parameters, tuple_disk_vec_ptr_Type tuple)
Constructor.
Definition AssembleFE_def.hpp:8
vec_dbl_ptr_Type getSolution()
Get the current local solution vector.
Definition AssembleFE_def.hpp:114
void preProcessing()
This function is called in the beginning of each Newton step before actually assmblying anything.
Definition AssembleFE_def.hpp:121
void postProcessing()
This function is called at the end of each Newton step after updating the solution vector.
Definition AssembleFE_def.hpp:128
vec2D_dbl_Type getNodesRefConfig()
Return the coordnates of the finite element nodes.
Definition AssembleFE_def.hpp:142
double getTimeStep()
Get the time state of the object.
Definition AssembleFE_def.hpp:88
virtual void checkParameters()
Check the input parameters from the constructor and the ParameterList for completeness and consistenc...
Definition AssembleFE_def.hpp:62
virtual void advanceInTime(double dt)
This function is called every time the FEDDLib proceeds from one to the next time step....
Definition AssembleFE_def.hpp:75
vec2D_dbl_Type nodesRefConfig_
TODO: Why "Reference Configuration"?
Definition AssembleFE_decl.hpp:255
int getNewtonStep()
Get the time state of the object.
Definition AssembleFE_def.hpp:94
void advanceNewtonStep()
This function is called every time the FEDDLib proceeds from one to the next newton step....
Definition AssembleFE_def.hpp:81
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36