Memosa-FVM  0.2
VacancyModel_impl.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #include "Mesh.h"
6 #include <sstream>
7 
8 #include "NumType.h"
9 #include "Array.h"
10 #include "Field.h"
11 #include "CRConnectivity.h"
12 #include "LinearSystem.h"
13 //#include "FieldSet.h"
14 #include "StorageSite.h"
15 #include "MultiFieldMatrix.h"
16 #include "CRMatrix.h"
17 #include "FluxJacobianMatrix.h"
18 #include "DiagonalMatrix.h"
19 #include "GenericBCS.h"
20 #include "Vector.h"
23 #include "AMG.h"
24 #include "Linearizer.h"
25 #include "GradientModel.h"
27 #include "SourceDiscretization.h"
29 
30 template<class T>
31 class VacancyModel<T>::Impl
32 {
33 public:
34  typedef Array<T> TArray;
41 
42  Impl(const GeomFields& geomFields,
43  VacancyFields& vacancyFields,
44  const MeshList& meshes) :
45  _meshes(meshes),
46  _geomFields(geomFields),
47  _vacancyFields(vacancyFields),
48  _concentrationGradientModel(_meshes,_vacancyFields.concentration,
49  _vacancyFields.concentrationGradient,_geomFields),
50  _fluxGradientModel(_meshes,
51  _vacancyFields.concentrationGradientVector,
52  _vacancyFields.plasticStrain,_geomFields),
53  _initialNorm(),
54  _niters(0)
55  {
56  const int numMeshes = _meshes.size();
57  for (int n=0; n<numMeshes; n++)
58  {
59  const Mesh& mesh = *_meshes[n];
60  VacancyVC<T> *vc(new VacancyVC<T>());
61  vc->vcType = "flow";
62  _vcMap[mesh.getID()] = vc;
63 
64  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
65  {
66  const FaceGroup& fg = *fgPtr;
67  VacancyBC<T> *bc(new VacancyBC<T>());
68 
69  _bcMap[fg.id] = bc;
70 
71  if ((fg.groupType == "wall") ||
72  (fg.groupType == "symmetry"))
73  {
74  bc->bcType = "SpecifiedVacaFlux";
75  }
76  else if ((fg.groupType == "velocity-inlet") ||
77  (fg.groupType == "pressure-outlet"))
78  {
79  bc->bcType = "SpecifiedConcentration";
80  }
81  else
82  throw CException("VacancyModel: unknown face group type "
83  + fg.groupType);
84  }
85  }
86  }
87 
88  void init()
89  {
90  const int numMeshes = _meshes.size();
91  for (int n=0; n<numMeshes; n++)
92  {
93  const Mesh& mesh = *_meshes[n];
94 
95  const StorageSite& cells = mesh.getCells();
96  const VacancyVC<T>& vc = *_vcMap[mesh.getID()];
97 
98  //concentration
99  shared_ptr<TArray> tCell(new TArray(cells.getCountLevel1()));
100  *tCell = _options["initialConcentration"];
101  _vacancyFields.concentration.addArray(cells,tCell);
102 
103  if(_options.transient)
104  {
105  _vacancyFields.concentrationN1.addArray(cells, dynamic_pointer_cast<ArrayBase>(tCell->newCopy()));
106  if (_options.timeDiscretizationOrder > 1)
107  _vacancyFields.concentrationN2.addArray(cells, dynamic_pointer_cast<ArrayBase>(tCell->newCopy()));
108  }
109 
110  //diffusioncoefficient
111  shared_ptr<TArray> condCell(new TArray(cells.getCountLevel1()));
112  *condCell = vc["vacancyDiffusioncoefficient"];
113  _vacancyFields.diffusioncoefficient.addArray(cells,condCell);
114 
115  //source
116  shared_ptr<TArray> sCell(new TArray(cells.getCountLevel1()));
117  *sCell = T(0.);
118  _vacancyFields.source.addArray(cells,sCell);
119 
120  //create a zero field
121  shared_ptr<TArray> zeroCell(new TArray(cells.getCountLevel1()));
122  *zeroCell = T(0.0);
123  _vacancyFields.zero.addArray(cells,zeroCell);
124 
125  //create a one field
126  shared_ptr<TArray> oneCell(new TArray(cells.getCountLevel1()));
127  *oneCell = T(1.0);
128  _vacancyFields.one.addArray(cells,oneCell);
129 
130  //create specific vaca field rho*Cp
131  shared_ptr<TArray> cp(new TArray(cells.getCount()));
132  *cp = vc["density"] * vc["specificVaca"];
133  _vacancyFields.specificVaca.addArray(cells, cp);
134 
135  //initial temparature gradient array
136  shared_ptr<TGradArray> gradT(new TGradArray(cells.getCountLevel1()));
137  gradT->zero();
138  _vacancyFields.concentrationGradient.addArray(cells,gradT);
139 
140 
141  shared_ptr<VectorT3Array> vGrad(new VectorT3Array(cells.getCountLevel1()));
142  vGrad->zero();
143  _vacancyFields.concentrationGradientVector.addArray(cells,vGrad);
144 
145 
146 
147  shared_ptr<VGradArray> plasticStrainField(new VGradArray(cells.getCountLevel1()));
148  plasticStrainField->zero();
149  _vacancyFields.plasticStrain.addArray(cells,plasticStrainField);
150 
151 
152  //inital convection flux at faces
153 
154  const StorageSite& allFaces = mesh.getFaces();
155  shared_ptr<TArray> convFlux(new TArray(allFaces.getCount()));
156  convFlux->zero();
157  _vacancyFields.convectionFlux.addArray(allFaces,convFlux);
158 
159  //vaca flux at faces
160  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
161  {
162  const FaceGroup& fg = *fgPtr;
163  const StorageSite& faces = fg.site;
164 
165  shared_ptr<TArray> fluxFace(new TArray(faces.getCount()));
166 
167  fluxFace->zero();
168  _vacancyFields.vacaFlux.addArray(faces,fluxFace);
169 
170  }
171  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
172  {
173  const FaceGroup& fg = *fgPtr;
174  const StorageSite& faces = fg.site;
175 
176  shared_ptr<TArray> fluxFace(new TArray(faces.getCount()));
177 
178  fluxFace->zero();
179  _vacancyFields.vacaFlux.addArray(faces,fluxFace);
180 
181  }
182 
183 
184  }
185  _vacancyFields.diffusioncoefficient.syncLocal();
186  _niters =0;
187  _initialNorm = MFRPtr();
188  }
189 
190  VacancyBCMap& getBCMap() {return _bcMap;}
191  VacancyVCMap& getVCMap() {return _vcMap;}
192 
193  VacancyBC<T>& getBC(const int id) {return *_bcMap[id];}
194 
195  VacancyModelOptions<T>& getOptions() {return _options;}
196 
198  {
199  const int numMeshes = _meshes.size();
200  for (int n=0; n<numMeshes; n++)
201  {
202  const Mesh& mesh = *_meshes[n];
203 
204  const StorageSite& cells = mesh.getCells();
205  MultiField::ArrayIndex tIndex(&_vacancyFields.concentration,&cells);
206 
207  ls.getX().addArray(tIndex,_vacancyFields.concentration.getArrayPtr(cells));
208 
209  const CRConnectivity& cellCells = mesh.getCellCells();
210 
211  shared_ptr<Matrix> m(new CRMatrix<T,T,T>(cellCells));
212 
213  ls.getMatrix().addMatrix(tIndex,tIndex,m);
214 
215  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
216  {
217  const FaceGroup& fg = *fgPtr;
218  const StorageSite& faces = fg.site;
219 
220  MultiField::ArrayIndex fIndex(&_vacancyFields.vacaFlux,&faces);
221  ls.getX().addArray(fIndex,_vacancyFields.vacaFlux.getArrayPtr(faces));
222 
223  const CRConnectivity& faceCells = mesh.getFaceCells(faces);
224 
225  shared_ptr<Matrix> mft(new FluxJacobianMatrix<T,T>(faceCells));
226  ls.getMatrix().addMatrix(fIndex,tIndex,mft);
227 
228  shared_ptr<Matrix> mff(new DiagonalMatrix<T,T>(faces.getCount()));
229  ls.getMatrix().addMatrix(fIndex,fIndex,mff);
230  }
231 
232  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
233  {
234  const FaceGroup& fg = *fgPtr;
235  const StorageSite& faces = fg.site;
236 
237  MultiField::ArrayIndex fIndex(&_vacancyFields.vacaFlux,&faces);
238  ls.getX().addArray(fIndex,_vacancyFields.vacaFlux.getArrayPtr(faces));
239 
240  const CRConnectivity& faceCells = mesh.getFaceCells(faces);
241 
242  shared_ptr<Matrix> mft(new FluxJacobianMatrix<T,T>(faceCells));
243  ls.getMatrix().addMatrix(fIndex,tIndex,mft);
244 
245  shared_ptr<Matrix> mff(new DiagonalMatrix<T,T>(faces.getCount()));
246  ls.getMatrix().addMatrix(fIndex,fIndex,mff);
247  }
248 
249  }
250  }
251 
253  {
254  _concentrationGradientModel.compute();
255 
256 
257  DiscrList discretizations;
258 
259  shared_ptr<Discretization>
261  (_meshes,_geomFields,
262  _vacancyFields.concentration,
263  _vacancyFields.diffusioncoefficient,
264  _vacancyFields.concentrationGradient));
265  discretizations.push_back(dd);
266 
267  shared_ptr<Discretization>
269  (_meshes,_geomFields,
270  _vacancyFields.concentration,
271  _vacancyFields.convectionFlux,
272  _vacancyFields.zero,
273  _vacancyFields.concentrationGradient,
274  _options.useCentralDifference));
275  discretizations.push_back(cd);
276 
277 
278  shared_ptr<Discretization>
280  (_meshes,
281  _geomFields,
282  _vacancyFields.concentration,
283  _vacancyFields.source));
284  discretizations.push_back(sd);
285 
286  if (_options.transient)
287  {
288  shared_ptr<Discretization>
290  (_meshes, _geomFields,
291  _vacancyFields.concentration,
292  _vacancyFields.concentrationN1,
293  _vacancyFields.concentrationN2,
294  _vacancyFields.specificVaca,
295  _options["timeStep"]));
296  discretizations.push_back(td);
297  }
298 
299  shared_ptr<Discretization>
301  (_meshes,_geomFields,_vacancyFields.concentration));
302 
303  discretizations.push_back(ibm);
304 
305 
306  Linearizer linearizer;
307 
308  linearizer.linearize(discretizations,_meshes,ls.getMatrix(),
309  ls.getX(), ls.getB());
310 
311  const int numMeshes = _meshes.size();
312  for (int n=0; n<numMeshes; n++)
313  {
314  const Mesh& mesh = *_meshes[n];
315 
316  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
317  {
318  const FaceGroup& fg = *fgPtr;
319  const StorageSite& faces = fg.site;
320 
321  const VacancyBC<T>& bc = *_bcMap[fg.id];
322 
323 
324  GenericBCS<T,T,T> gbc(faces,mesh,
325  _geomFields,
326  _vacancyFields.concentration,
327  _vacancyFields.vacaFlux,
328  ls.getMatrix(), ls.getX(), ls.getB());
329 
330  if (bc.bcType == "SpecifiedConcentration")
331  {
333  bT(bc.getVal("specifiedConcentration"),faces);
334  if (_vacancyFields.convectionFlux.hasArray(faces))
335  {
336  const TArray& convectingFlux =
337  dynamic_cast<const TArray&>
338  (_vacancyFields.convectionFlux[faces]);
339  const int nFaces = faces.getCount();
340 
341  for(int f=0; f<nFaces; f++)
342  {
343  if (convectingFlux[f] > 0.)
344  {
345  gbc.applyExtrapolationBC(f);
346  }
347  else
348  {
349  gbc.applyDirichletBC(f,bT[f]);
350  }
351  }
352  }
353  else
354  gbc.applyDirichletBC(bT);
355  }
356  else if (bc.bcType == "SpecifiedVacaFlux")
357  {
359  bVacaFlux(bc.getVal("specifiedVacaFlux"),faces);
360 
361  const int nFaces = faces.getCount();
362 
363  for(int f=0; f<nFaces; f++)
364  {
365  gbc.applyNeumannBC(f, bVacaFlux[f]);
366  }
367  }
368  else if (bc.bcType == "Symmetry")
369  {
370  T zeroFlux(NumTypeTraits<T>::getZero());
371  gbc.applyNeumannBC(zeroFlux);
372  }
373  else if (bc.bcType == "Convective")
374  {
375  FloatValEvaluator<T> hCoeff(bc.getVal("convectiveCoefficient"), faces);
376  FloatValEvaluator<T> Xinf(bc.getVal("farFieldConcentration"), faces);
377  const int nFaces = faces.getCount();
378  for(int f=0; f<nFaces; f++)
379  gbc.applyConvectionBC(f, hCoeff[f], Xinf[f]);
380  }
381  else
382  throw CException(bc.bcType + " not implemented for VacancyModel");
383  }
384 
385  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
386  {
387  const FaceGroup& fg = *fgPtr;
388  const StorageSite& faces = fg.site;
389  GenericBCS<T,T,T> gbc(faces,mesh,
390  _geomFields,
391  _vacancyFields.concentration,
392  _vacancyFields.vacaFlux,
393  ls.getMatrix(), ls.getX(), ls.getB());
394 
395  gbc.applyInterfaceBC();
396  }
397  }
398  }
399 
400  T getVacaFluxIntegral(const Mesh& mesh, const int faceGroupId)
401  {
402  T r(0.);
403  bool found = false;
404  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
405  {
406  const FaceGroup& fg = *fgPtr;
407  if (fg.id == faceGroupId)
408  {
409  const StorageSite& faces = fg.site;
410  const int nFaces = faces.getCount();
411  const TArray& vacaFlux =
412  dynamic_cast<const TArray&>(_vacancyFields.vacaFlux[faces]);
413  for(int f=0; f<nFaces; f++)
414  r += vacaFlux[f];
415  found=true;
416  }
417  }
418  if (!found)
419  throw CException("getVacaFluxIntegral: invalid faceGroupID");
420  return r;
421  }
422 
423 
424  void advance(const int niter)
425  {
426  for(int n=0; n<niter; n++)
427  {
428  LinearSystem ls;
429  initLinearization(ls);
430 
431  ls.initAssembly();
432 
433  linearize(ls);
434 
435  ls.initSolve();
436 
437  MFRPtr rNorm(_options.getLinearSolver().solve(ls));
438 
439  if (!_initialNorm) _initialNorm = rNorm;
440 
441  MFRPtr normRatio((*rNorm)/(*_initialNorm));
442 
443  cout << _niters << ": " << *rNorm << endl;
444 
445 
446  _options.getLinearSolver().cleanup();
447 
448  ls.postSolve();
449  ls.updateSolution();
450 
451  _niters++;
452  if (*rNorm < _options.absoluteTolerance ||
453  *normRatio < _options.relativeTolerance)
454  break;
455  }
456  }
457 
458  void printBCs()
459  {
460  foreach(typename VacancyBCMap::value_type& pos, _bcMap)
461  {
462  cout << "Face Group " << pos.first << ":" << endl;
463  cout << " bc type " << pos.second->bcType << endl;
464  foreach(typename VacancyBC<T>::value_type& vp, *pos.second)
465  {
466  cout << " " << vp.first << " " << vp.second.constant << endl;
467  }
468  }
469  }
470 
471 
472  void updateTime()
473  {
474  const int numMeshes = _meshes.size();
475  for (int n=0; n<numMeshes; n++) {
476 
477  const Mesh& mesh = *_meshes[n];
478  const StorageSite& cells = mesh.getCells();
479  const int nCells = cells.getCountLevel1();
480 
481  TArray& concentration =
482  dynamic_cast<TArray&>(_vacancyFields.concentration[cells]);
483  TArray& concentrationN1 =
484  dynamic_cast<TArray&>(_vacancyFields.concentrationN1[cells]);
485 
486  if (_options.timeDiscretizationOrder > 1)
487  {
488  TArray& concentrationN2 =
489  dynamic_cast<TArray&>(_vacancyFields.concentrationN2[cells]);
490  concentrationN2 = concentrationN1;
491  }
492  concentrationN1 = concentration;
493  }
494  }
495 
496 
497 #if !(defined(USING_ATYPE_TANGENT) || defined(USING_ATYPE_PC))
498 
499  void dumpMatrix(const string fileBase)
500  {
501  LinearSystem ls;
502  initLinearization(ls);
503 
504  ls.initAssembly();
505 
506  linearize(ls);
507 
508  ls.initSolve();
509 
510  MultiFieldMatrix& matrix = ls.getMatrix();
511  MultiField& b = ls.getB();
512 for ( unsigned int id = 0; id < _meshes.size(); id++ ){
513  const Mesh& mesh = *_meshes[id];
514  const StorageSite& cells = mesh.getCells();
515 
516  MultiField::ArrayIndex tIndex(&_vacancyFields.concentration,&cells);
517 
518  T_Matrix& tMatrix =
519  dynamic_cast<T_Matrix&>(matrix.getMatrix(tIndex,tIndex));
520 
521  TArray& tDiag = tMatrix.getDiag();
522  TArray& tCoeff = tMatrix.getOffDiag();
523 
524  TArray& rCell = dynamic_cast<TArray&>(b[tIndex]);
525 
526  const CRConnectivity& cr = tMatrix.getConnectivity();
527 
528  const Array<int>& row = cr.getRow();
529  const Array<int>& col = cr.getCol();
530 
531  const int nCells = cells.getSelfCount();
532  int nCoeffs = nCells;
533 
534  for(int i=0; i<nCells; i++)
535  for(int jp=row[i]; jp<row[i+1]; jp++)
536  {
537  const int j = col[jp];
538  if (j<nCells) nCoeffs++;
539  }
540  stringstream ss;
541  ss << id;
542  string matFileName = fileBase + "_mesh" + ss.str() + ".mat";
543 
544 
545  FILE *matFile = fopen(matFileName.c_str(),"wb");
546 
547  fprintf(matFile,"%%%%MatrixMarket matrix coordinate real general\n");
548  fprintf(matFile,"%d %d %d\n", nCells,nCells,nCoeffs);
549 
550  for(int i=0; i<nCells; i++)
551  {
552  fprintf(matFile,"%d %d %lf\n", i+1, i+1, tDiag[i]);
553  for(int jp=row[i]; jp<row[i+1]; jp++)
554  {
555  const int j = col[jp];
556  if (j<nCells)
557  fprintf(matFile,"%d %d %lf\n", i+1, j+1, tCoeff[jp]);
558  }
559  }
560 
561  fclose(matFile);
562 
563  string rhsFileName = fileBase + ".rhs";
564  FILE *rhsFile = fopen(rhsFileName.c_str(),"wb");
565 
566  for(int i=0; i<nCells; i++)
567  fprintf(rhsFile,"%lf\n",-rCell[i]);
568 
569  fclose(rhsFile);
570 
571  }
572 }
573 #endif
574 
576  {
577  typedef CRMatrixTranspose<T,T,T> IMatrix;
578 
579  const TArray& pT =
580  dynamic_cast<const TArray&>(_vacancyFields.concentration[particles]);
581 
582  const int numMeshes = _meshes.size();
583  for (int n=0; n<numMeshes; n++)
584  {
585  const Mesh& mesh = *_meshes[n];
586  if (!mesh.isShell() && mesh.getIBFaces().getCount() > 0){
587  const StorageSite& cells = mesh.getCells();
588  const StorageSite& ibFaces = mesh.getIBFaces();
589 
590  GeomFields::SSPair key1(&ibFaces,&cells);
591  const IMatrix& mIC =
592  dynamic_cast<const IMatrix&>
593  (*_geomFields._interpolationMatrices[key1]);
594 
595  GeomFields::SSPair key2(&ibFaces,&particles);
596  const IMatrix& mIP =
597  dynamic_cast<const IMatrix&>
598  (*_geomFields._interpolationMatrices[key2]);
599 
600  shared_ptr<TArray> ibT(new TArray(ibFaces.getCount()));
601 
602  const TArray& cT =
603  dynamic_cast<const TArray&>(_vacancyFields.concentration[cells]);
604 
605 
606  ibT->zero();
607 
608  mIC.multiplyAndAdd(*ibT,cT);
609  mIP.multiplyAndAdd(*ibT,pT);
610  _vacancyFields.concentration.addArray(ibFaces,ibT);
611  }
612  }
613 
614  }
615 
616 
617 
618 
620  {
621  const int numMeshes = _meshes.size();
622 
623  _concentrationGradientModel.compute();
624 
625  for (int n=0; n<numMeshes; n++)
626  {
627  const Mesh& mesh = *_meshes[n];
628  const StorageSite& cells = mesh.getCells();
629  const int nCells = cells.getCountLevel1();
630  VectorT3Array& cGradVector = dynamic_cast<VectorT3Array&> (_vacancyFields.concentrationGradientVector[cells]);
631  const TGradArray& cGrad = dynamic_cast<const TGradArray&> (_vacancyFields.concentrationGradient[cells]);
632  for (int c=0; c<nCells; c++)
633  {
634  for (int k=0; k<3; k++)
635  cGradVector[c][k] = cGrad[c][k];
636  }
637  }
638 
639  _fluxGradientModel.compute();
640 
641 
642  for (int n=0; n<numMeshes; n++)
643  {
644  const Mesh& mesh = *_meshes[n];
645  const StorageSite& cells = mesh.getCells();
646  const int nCells = cells.getCountLevel1();
647  VGradArray& plasticStrainCell = dynamic_cast<VGradArray&>(_vacancyFields.plasticStrain[cells]);
648  const TArray& diffCoeff = dynamic_cast<const TArray&> (_vacancyFields.diffusioncoefficient[cells]);
649  for(int c=0; c<nCells; c++)
650  {
651  Gradient<VectorT3>& ps = plasticStrainCell[c];
652 
653  const T df(diffCoeff[c]);
654  Gradient<VectorT3> psTemp;
655  for (int i=0;i<3;i++)
656  for(int j=0;j<3;j++)
657  psTemp[i][j] = 0.5 * df * (ps[i][j]+ps[j][i]);
658  ps = psTemp;
659  }
660  }
661  }
662 
663 
664 
665 
666 
667 private:
671 
677 
679  int _niters;
680 };
681 
682 template<class T>
684  VacancyFields& vacancyFields,
685  const MeshList& meshes) :
686  Model(meshes),
687  _impl(new Impl(geomFields,vacancyFields,meshes))
688 {
689  logCtor();
690 }
691 
692 
693 template<class T>
695 {
696  logDtor();
697 }
698 
699 template<class T>
700 void
702 {
703  _impl->init();
704 }
705 
706 template<class T>
707 void
709 {
710  _impl->computePlasticStrainRate();
711 }
712 
713 
714 template<class T>
716 VacancyModel<T>::getBCMap() {return _impl->getBCMap();}
717 
718 template<class T>
720 VacancyModel<T>::getVCMap() {return _impl->getVCMap();}
721 
722 template<class T>
724 VacancyModel<T>::getBC(const int id) {return _impl->getBC(id);}
725 
726 template<class T>
728 VacancyModel<T>::getOptions() {return _impl->getOptions();}
729 
730 
731 template<class T>
732 void
734 {
735  _impl->printBCs();
736 }
737 
738 template<class T>
739 void
740 VacancyModel<T>::advance(const int niter)
741 {
742  _impl->advance(niter);
743 }
744 
745 template<class T>
746 void
748 {
749  _impl->computeIBFaceConcentration(particles);
750 }
751 
752 #if !(defined(USING_ATYPE_TANGENT) || defined(USING_ATYPE_PC))
753 
754 template<class T>
755 void
756 VacancyModel<T>::dumpMatrix(const string fileBase)
757 {
758  _impl->dumpMatrix(fileBase);
759 }
760 #endif
761 
762 template<class T>
763 T
764 VacancyModel<T>::getVacaFluxIntegral(const Mesh& mesh, const int faceGroupId)
765 {
766  return _impl->getVacaFluxIntegral(mesh, faceGroupId);
767 }
768 
769 template<class T>
770 void
772 {
773  _impl->updateTime();
774 }
void linearize(LinearSystem &ls)
void advance(const int niter)
void computeIBFaceConcentration(const StorageSite &particles)
const FaceGroupList & getBoundaryFaceGroups() const
Definition: Mesh.h:187
const Array< int > & getCol() const
virtual void zero()
Definition: Array.h:281
const Array< int > & getRow() const
void initAssembly()
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
shared_ptr< FaceGroup > FaceGroupPtr
Definition: Mesh.h:46
void dumpMatrix(const string fileBase)
int getSelfCount() const
Definition: StorageSite.h:40
const StorageSite & getIBFaces() const
Definition: Mesh.h:111
VacancyModelOptions< T > & getOptions()
T getVacaFluxIntegral(const Mesh &mesh, const int faceGroupId)
void initLinearization(LinearSystem &ls)
virtual void computePlasticStrainRate()
Array< Gradient< T > > TGradArray
void dumpMatrix(const string fileBase)
Definition: Mesh.h:28
T getVacaFluxIntegral(const Mesh &mesh, const int faceGroupId)
Definition: Mesh.h:49
VacancyBC< T > & getBC(const int id)
Array< Diag > & getDiag()
Definition: CRMatrix.h:856
Array< Gradient< VectorT3 > > VGradArray
string bcType
Definition: VacancyBC.h:18
virtual void init()
const GeomFields & _geomFields
#define logCtor()
Definition: RLogInterface.h:26
CRMatrix< T, T, T > T_Matrix
virtual const CRConnectivity & getConnectivity() const
Definition: CRMatrix.h:834
string groupType
Definition: Mesh.h:42
FloatVal< T > getVal(const string varName) const
Definition: FloatVarDict.h:85
Array< Vector< double, 3 > > VectorT3Array
Definition: CellMark.cpp:7
Array< OffDiag > & getOffDiag()
Definition: CRMatrix.h:857
GradientModel< VectorT3 > _fluxGradientModel
const int id
Definition: Mesh.h:41
void updateSolution()
VacancyModel(const GeomFields &geomFields, VacancyFields &vacancyFields, const MeshList &meshes)
pair< const Field *, const StorageSite * > ArrayIndex
Definition: MultiField.h:21
void initSolve()
VacancyBCMap & getBCMap()
void advance(const int niter)
vector< shared_ptr< Discretization > > DiscrList
Array< VectorT3 > VectorT3Array
const StorageSite & getFaces() const
Definition: Mesh.h:108
const MeshList _meshes
Definition: Model.h:29
const CRConnectivity & getCellCells() const
Definition: Mesh.cpp:480
Definition: Model.h:13
VacancyFields & _vacancyFields
const StorageSite & getCells() const
Definition: Mesh.h:109
void applyInterfaceBC(const int f) const
Definition: GenericBCS.h:325
std::map< int, VacancyVC< T > * > VacancyVCMap
Definition: VacancyModel.h:24
#define logDtor()
Definition: RLogInterface.h:33
VacancyBCMap & getBCMap()
int getCountLevel1() const
Definition: StorageSite.h:72
GradientModel< T > _concentrationGradientModel
void computeIBFaceConcentration(const StorageSite &particles)
const CRConnectivity & getFaceCells(const StorageSite &site) const
Definition: Mesh.cpp:388
Impl(const GeomFields &geomFields, VacancyFields &vacancyFields, const MeshList &meshes)
Gradient< T > TGradType
const MeshList _meshes
Definition: Array.h:14
void addMatrix(const Index &rowI, const Index &colI, shared_ptr< Matrix > m)
virtual ~VacancyModel()
bool isShell() const
Definition: Mesh.h:323
VacancyBC< T > & getBC(const int id)
int getCount() const
Definition: StorageSite.h:39
MultiField & getB()
Definition: LinearSystem.h:33
std::map< int, VacancyBC< T > * > VacancyBCMap
Definition: VacancyModel.h:23
VacancyModelOptions< T > _options
shared_ptr< MultiFieldReduction > MFRPtr
void addArray(const ArrayIndex &aIndex, shared_ptr< ArrayBase > a)
Definition: MultiField.cpp:270
const FaceGroupList & getInterfaceGroups() const
Definition: Mesh.h:190
MultiField & getX()
Definition: LinearSystem.h:32
VacancyVCMap & getVCMap()
int getID() const
Definition: Mesh.h:106
VacancyModelOptions< T > & getOptions()
virtual void linearize(DiscrList &discretizations, const MeshList &meshes, MultiFieldMatrix &matrix, MultiField &x, MultiField &b)
Definition: Linearizer.cpp:17
string vcType
Definition: VacancyBC.h:31
pair< const StorageSite *, const StorageSite * > SSPair
Definition: GeomFields.h:48
Vector< T, 3 > VectorT3
MultiFieldMatrix & getMatrix()
Definition: LinearSystem.h:37
vector< Mesh * > MeshList
Definition: Mesh.h:439
StorageSite site
Definition: Mesh.h:40
VacancyVCMap & getVCMap()