1#ifndef AssembleFE_SCI_SMC_MLCK_DEF_hpp
2#define AssembleFE_SCI_SMC_MLCK_DEF_hpp
4#ifdef FEDD_HAVE_ACEGENINTERFACE
5#include <aceinterface.hpp>
13template <
class SC,
class LO,
class GO,
class NO>
14AssembleFE_SCI_SMC_MLCK<SC,LO,GO,NO>::AssembleFE_SCI_SMC_MLCK(
int flag, vec2D_dbl_Type nodesRefConfig, ParameterListPtr_Type params,tuple_disk_vec_ptr_Type tuple):
15AssembleFE<SC,LO,GO,NO>(flag, nodesRefConfig, params, tuple)
51 fA_= this->params_->sublist(
"Parameter Solid").get(
"FA",30.e0);
52 lambdaC50_ = this->params_->sublist(
"Parameter Solid").get(
"LambdaC50",0.12e1);
53 gamma3_= this->params_->sublist(
"Parameter Solid").get(
"Gamma3",0.9e0);
54 lambdaBarCDotMax_= this->params_->sublist(
"Parameter Solid").get(
"LambdaBarCDotMax",0.3387e-1);
55 lambdaBarCDotMin_= this->params_->sublist(
"Parameter Solid").get(
"LambdaBarCDotMin",-0.3387e-1);
56 gamma2_ = this->params_->sublist(
"Parameter Solid").get(
"Gamma2",50.0e0);
57 gamma1_ = this->params_->sublist(
"Parameter Solid").get(
"Gamma1",0.50247e0);
58 eta1_ = this->params_->sublist(
"Parameter Solid").get(
"Eta1",0.18745e0);
59 ca50_ = this->params_->sublist(
"Parameter Solid").get(
"Ca50",0.4e0);
60 k2_ = this->params_->sublist(
"Parameter Solid").get(
"K2",0.2e0);
61 k5_ = this->params_->sublist(
"Parameter Solid").get(
"K5",0.2e0);
62 k3_ = this->params_->sublist(
"Parameter Solid").get(
"K3",0.134e0);
63 k4_ = this->params_->sublist(
"Parameter Solid").get(
"K4",0.166e-2);
64 k7_= this->params_->sublist(
"Parameter Solid").get(
"K7",0.66e-4);
65 kappaC_ = this->params_->sublist(
"Parameter Solid").get(
"KappaC",146.36600000000002e0);
66 beta1_ = this->params_->sublist(
"Parameter Solid").get(
"Beta1",0.10097e-2);
67 muA_ = this->params_->sublist(
"Parameter Solid").get(
"MuA",0.9291e1);
68 alpha_ = this->params_->sublist(
"Parameter Solid").get(
"Alpha",0.2668e2);
69 epsilon1_ = this->params_->sublist(
"Parameter Solid").get(
"Epsilon1", 0.15173775e3);
70 epsilon2_ = this->params_->sublist(
"Parameter Solid").get(
"Epsilon2",0.27566199999999996e1);
71 c1_ = this->params_->sublist(
"Parameter Solid").get(
"C1",11.52507e0);
72 alpha1_ = this->params_->sublist(
"Parameter Solid").get(
"Alpha1",1.27631e0);
73 alpha2_ = this->params_->sublist(
"Parameter Solid").get(
"Alpha2",0.308798e1);
74 p1_ = this->params_->sublist(
"Parameter Solid").get(
"P1",0.3e0);
75 p3_ = this->params_->sublist(
"Parameter Solid").get(
"P3",0.2e0);
76 c50_ = this->params_->sublist(
"Parameter Solid").get(
"C50",0.5e0);
77 d0_ = this->params_->sublist(
"Parameter Diffusion").get(
"D0",6.e-05);
78 m_ = this->params_->sublist(
"Parameter Solid").get(
"m",0.e0);
79 startTime_ = this->params_->sublist(
"Parameter Solid").get(
"ActiveStartTime",1001.e0);
80 rho_ = this->params_->sublist(
"Parameter Solid").get(
"Rho",1.e0);
85 FEType_ = std::get<1>(this->diskTuple_->at(0));
86 dofsSolid_ = std::get<2>(this->diskTuple_->at(0));
87 dofsChem_ = std::get<2>(this->diskTuple_->at(1));
89 numNodesSolid_ = std::get<3>(this->diskTuple_->at(0));
90 numNodesChem_ = std::get<3>(this->diskTuple_->at(1));
92 dofsElement_ = dofsSolid_*numNodesSolid_ + dofsChem_*numNodesChem_;
95 history_ ={1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0};
98 historyUpdated_.resize(48,0.);
100 solutionC_n_.resize(10,0.);
101 solutionC_n1_.resize(10,0.);
103 this->solution_.reset(
new vec_dbl_Type ( dofsElement_,0.) );
119template <
class SC,
class LO,
class GO,
class NO>
122 SmallMatrixPtr_Type elementMatrix = Teuchos::rcp(
new SmallMatrix_Type(dofsElement_,0.));
124 assemble_SCI_SMC_MLCK(elementMatrix);
126 this->jacobian_ = elementMatrix;
129template <
class SC,
class LO,
class GO,
class NO>
137 this->timeStep_ = this->timeStep_ + this->timeIncrement_;
139 this->timeIncrement_ = dt;
141 for(
int i=0; i< 48; i++){
143 history_[i] = historyUpdated_[i];
147 for(
int i=0; i< 10 ; i++)
148 solutionC_n_[i]=(*this->solution_)[i+30];
153template <
class SC,
class LO,
class GO,
class NO>
156 this->rhsVec_.reset(
new vec_dbl_Type ( dofsElement_,0.) );
158#ifdef FEDD_HAVE_ACEGENINTERFACE
163 double positions[30];
166 for(
int i=0;i<10;i++){
167 for(
int j=0;j<3;j++){
175 double displacements[30];
176 for(
int i = 0; i < 30; i++)
178 displacements[i]=(*this->solution_)[i];
182 for(
int i = 0; i < history_.size(); i++)
183 history[i] = history_[i];
186 double concentrations[10];
187 for(
int i = 0; i < 10; i++)
189 concentrations[i]= (*this->solution_)[i+30];
190 solutionC_n1_[i] = (*this->solution_)[i+30];
193 double accelerations[] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
195 double domainData[] = {fA_, lambdaC50_, gamma3_, lambdaBarCDotMax_, lambdaBarCDotMin_,
196 gamma2_ , gamma1_, eta1_, ca50_, k2_, k5_, k3_, k4_, k7_ , kappaC_ ,
197 beta1_ , muA_ , alpha_, epsilon1_,epsilon2_,c1_,alpha1_,alpha2_,
198 p1_,p3_,c50_,d0_,m_,startTime_,rho_};
202 for(
int i=0; i<10 ; i++){
203 rates[i] =(solutionC_n1_[i]-solutionC_n_[i])/deltaT;
208 double subIterationTolerance = 1.e-7;
211 double historyUpdated[] = {1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0};
213 AceGenInterface::DeformationDiffusionSmoothMuscleMLCKOnlyTetrahedra3D10 elem(positions, displacements, concentrations, accelerations, rates, domainData, history, subIterationTolerance, deltaT, time, iCode_);
216 double *residuumRint = elem.getResiduumVectorRint();
218 double *residuumRDyn = elem.getResiduumVectorRdyn();
223 for(
int i=0; i< 30 ; i++){
224 (*this->rhsVec_)[i] = residuumRint[i];
226 double *residuumRc = elem.getResiduumVectorRc();
230 for(
int i=0; i< 10 ; i++){
231 (*this->rhsVec_)[i+30] = residuumRc[i];
262template <
class SC,
class LO,
class GO,
class NO>
263void AssembleFE_SCI_SMC_MLCK<SC,LO,GO,NO>::assemble_SCI_SMC_MLCK(SmallMatrixPtr_Type &elementMatrix){
268#ifdef FEDD_HAVE_ACEGENINTERFACE
270 double deltaT=this->getTimeIncrement();
272 double positions[30];
274 for(
int i=0;i<10;i++){
275 for(
int j=0;j<3;j++){
276 positions[count] = this->getNodesRefConfig()[i][j];
280 double displacements[30];
281 for(
int i = 0; i < 30; i++)
283 displacements[i]= (*this->solution_)[i];
287 for(
int i = 0; i < history_.size(); i++)
288 history[i] = history_[i];
291 double concentrations[10];
292 for(
int i = 0; i < 10; i++)
294 concentrations[i]=(*this->solution_)[i+30];
295 solutionC_n1_[i]=(*this->solution_)[i+30];
298 double accelerations[] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
300 double domainData[] = {fA_, lambdaC50_, gamma3_, lambdaBarCDotMax_, lambdaBarCDotMin_,
301 gamma2_ , gamma1_, eta1_, ca50_, k2_, k5_, k3_, k4_, k7_ , kappaC_ ,
302 beta1_ , muA_ , alpha_, epsilon1_,epsilon2_,c1_,alpha1_,alpha2_,
303 p1_,p3_,c50_,d0_,m_,startTime_,rho_};
306 for(
int i=0; i<10 ; i++){
307 rates[i] =(solutionC_n1_[i]-solutionC_n_[i]) / deltaT;
311 double time = this->getTimeStep()+deltaT;
312 double subIterationTolerance = 1.e-7;
317 AceGenInterface::DeformationDiffusionSmoothMuscleMLCKOnlyTetrahedra3D10 elem(positions, displacements, concentrations, accelerations, rates, domainData, history, subIterationTolerance, deltaT, time, iCode_);
320 double *historyUpdated = elem.getHistoryUpdated();
322 double** stiffnessMatrixKuu = elem.getStiffnessMatrixKuu();
323 double** stiffnessMatrixKuc = elem.getStiffnessMatrixKuc();
324 double** stiffnessMatrixKcu = elem.getStiffnessMatrixKcu();
325 double** stiffnessMatrixKcc = elem.getStiffnessMatrixKcc();
326 double** massMatrixMc = elem.getMassMatrixMc();
329 for(
int i=0; i< 48; i++){
330 historyUpdated_[i] = historyUpdated[i];
333 for(
int i=0; i< 30; i++){
334 for(
int j=0; j<30; j++){
338 (*elementMatrix)[i][j]=stiffnessMatrixKuu[i][j];
341 for(
int i=0; i< 30; i++){
342 for(
int j=0; j<10; j++){
346 (*elementMatrix)[i][j+30]=stiffnessMatrixKuc[i][j];
349 for(
int i=0; i< 10; i++){
350 for(
int j=0; j<30; j++){
354 (*elementMatrix)[i+30][j]=stiffnessMatrixKcu[i][j];
357 for(
int i=0; i< 10; i++){
358 for(
int j=0; j<10; j++){
362 (*elementMatrix)[i+30][j+30] =stiffnessMatrixKcc[i][j] +(1./deltaT)*massMatrixMc[i][j];
void assembleJacobian() override
Assemble the element Jacobian matrix.
Definition AssembleFE_SCI_SMC_MLCK_def.hpp:120
void advanceInTime(double dt) override
This function is called every time the FEDDLib proceeds from one to the next time step....
Definition AssembleFE_SCI_SMC_MLCK_def.hpp:130
void assembleRHS() override
Assemble the element right hand side vector.
Definition AssembleFE_SCI_SMC_MLCK_def.hpp:154
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
double getTimeStep()
Definition AssembleFE_def.hpp:88
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36