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