1#ifndef ASSEMBLEFE_SCI_NH_DEF_hpp
2#define ASSEMBLEFE_SCI_NH_DEF_hpp
4#ifdef FEDD_HAVE_ACEGENINTERFACE
5#include <aceinterface.hpp>
14 template <
class SC,
class LO,
class GO,
class NO>
15 AssembleFE_SCI_NH<SC, LO, GO, NO>::AssembleFE_SCI_NH(
int flag, vec2D_dbl_Type nodesRefConfig, ParameterListPtr_Type params, tuple_disk_vec_ptr_Type tuple) :
AssembleFE<SC, LO, GO, NO>(flag, nodesRefConfig, params, tuple)
18 E0_ = this->params_->sublist(
"Parameter Solid").get(
"E", 379.95e-6);
19 E1_ = this->params_->sublist(
"Parameter Solid").get(
"E1", 300.0e-6);
20 poissonRatio_ = this->params_->sublist(
"Parameter Solid").get(
"Poisson Ratio", 0.49e-0);
21 c1_ = this->params_->sublist(
"Parameter Solid").get(
"c1", 0.25e-0);
22 D0_ = this->params_->sublist(
"Parameter Diffusion").get(
"D0", 6.0e-5);
23 m_ = this->params_->sublist(
"Parameter Diffusion").get(
"m", 0.0);
24 dofOrdering_ = this->params_->sublist(
"Parameter").get(
"Ordering", 2);
26 FEType_ = std::get<1>(this->diskTuple_->at(0));
27 dofsSolid_ = std::get<2>(this->diskTuple_->at(0));
28 dofsChem_ = std::get<2>(this->diskTuple_->at(1));
30 numNodesSolid_ = std::get<3>(this->diskTuple_->at(0));
31 numNodesChem_ = std::get<3>(this->diskTuple_->at(1));
33 dofsElement_ = dofsSolid_ * numNodesSolid_ + dofsChem_ * numNodesChem_;
35 solution_n_.resize(60, 0.);
36 solution_n1_.resize(60, 0.);
52 template <
class SC,
class LO,
class GO,
class NO>
56 SmallMatrixPtr_Type elementMatrix = Teuchos::rcp(
new SmallMatrix_Type(dofsElement_, 0.));
58 assembleDeformationDiffusionNeoHook(elementMatrix);
60 this->jacobian_ = elementMatrix;
63 template <
class SC,
class LO,
class GO,
class NO>
73 this->timeStep_ = this->timeStep_ + this->timeIncrement_;
75 this->timeIncrement_ = dt;
77 for (
int i = 0; i < 40; i++)
80 solution_n_[i] = (*this->solution_)[i];
82 solution_n_[i] = (*this->solution_)[i];
86 template <
class SC,
class LO,
class GO,
class NO>
90 this->rhsVec_.reset(
new vec_dbl_Type(dofsElement_, 0.));
91#ifdef FEDD_HAVE_ACEGENINTERFACE
93 std::vector<double> positions(30);
95 for (
int i = 0; i < 10; i++)
97 for (
int j = 0; j < 3; j++)
104 std::vector<double> displacements(30);
105 for (
int i = 0; i < 30; i++){
106 displacements[i] = (*this->solution_)[i];
108 std::vector<double> concentrations(10);
109 for (
int i = 0; i < 10; i++)
110 concentrations[i] = (*this->solution_)[i + 30];
112 std::vector<double> concentrationsLastConverged(10);
113 for (
int i = 0; i < 10; i++)
114 concentrationsLastConverged[i] = (solution_n_)[i + 30];
116 std::vector<double> domainData(6);
117 domainData[0] = this->E0_;
118 domainData[1] = this->E1_;
119 domainData[2] = this->poissonRatio_;
120 domainData[3] = this->c1_;
121 domainData[4] = this->D0_;
122 domainData[5] = this->m_;
126 int integrationCode = 19;
128 AceGenInterface::DeformationDiffusionNeoHookTetrahedra3D10 neoHookeElement(&positions[0], &displacements[0], &concentrations[0], &concentrationsLastConverged[0], &domainData[0], timeIncrement, integrationCode);
129 neoHookeElement.computeTangentResidual();
131 double *residuum = neoHookeElement.getResiduum();
133 for (
int i = 0; i < 40; i++)
134 (*this->rhsVec_)[i] = residuum[i];
142 template <
class SC,
class LO,
class GO,
class NO>
143 void AssembleFE_SCI_NH<SC, LO, GO, NO>::assembleDeformationDiffusionNeoHook(SmallMatrixPtr_Type &elementMatrix)
146 std::vector<double> positions(30);
147#ifdef FEDD_HAVE_ACEGENINTERFACE
150 for (
int i = 0; i < 10; i++)
152 for (
int j = 0; j < 3; j++)
154 positions[count] = this->getNodesRefConfig()[i][j];
159 std::vector<double> displacements(30);
160 for (
int i = 0; i < 30; i++)
161 displacements[i] = (*this->solution_)[i];
163 std::vector<double> concentrations(10);
164 for (
int i = 0; i < 10; i++)
165 concentrations[i] = (*this->solution_)[i + 30];
167 std::vector<double> concentrationsLastConverged(10);
168 for (
int i = 0; i < 10; i++)
169 concentrationsLastConverged[i] = (solution_n_)[i + 30];
171 std::vector<double> domainData(6);
172 domainData[0] = this->E0_;
173 domainData[1] = this->E1_;
174 domainData[2] = this->poissonRatio_;
175 domainData[3] = this->c1_;
176 domainData[4] = this->D0_;
177 domainData[5] = this->m_;
179 double timeIncrement = this->getTimeIncrement();
181 int integrationCode = 19;
183 AceGenInterface::DeformationDiffusionNeoHookTetrahedra3D10 neoHookeElement(&positions[0], &displacements[0], &concentrations[0], &concentrationsLastConverged[0], &domainData[0], timeIncrement, integrationCode);
184 neoHookeElement.computeTangentResidual();
186 double **stiffnessMatrix = neoHookeElement.getStiffnessMatrix();
189 for (UN i = 0; i < this->dofsElement_; i++)
191 for (UN j = 0; j < this->dofsElement_; j++)
193 (*elementMatrix)[i][j] = stiffnessMatrix[i][j];
void assembleRHS() override
Assemble the element right hand side vector.
Definition AssembleFE_SCI_NH_def.hpp:87
void advanceInTime(double dt) override
This function is called every time the FEDDLib proceeds from one to the next time step....
Definition AssembleFE_SCI_NH_def.hpp:64
void assembleJacobian() override
Assemble the element Jacobian matrix.
Definition AssembleFE_SCI_NH_def.hpp:53
This abstract class defining the interface for any type of element assembly rountines in the FEDDLib.
Definition AssembleFE_decl.hpp:61
double getTimeIncrement()
Definition AssembleFE_decl.hpp:203
vec2D_dbl_Type getNodesRefConfig()
Definition AssembleFE_def.hpp:142
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36