Memosa-FVM  0.2
PlateModel< T >::Impl Class Reference

#include <PlateModel_impl.h>

Collaboration diagram for PlateModel< T >::Impl:

Public Types

typedef T T_Scalar
 
typedef Array< T > TArray
 
typedef Vector< T, 3 > VectorT3
 
typedef VectorTranspose< T, 3 > VectorT3T
 
typedef Array< VectorT3VectorT3Array
 
typedef Vector< T, 4 > VectorT4
 
typedef Array< VectorT4VectorT4Array
 
typedef SquareTensor< T, 3 > DiagTensorT3
 
typedef CRMatrix< DiagTensorT3,
DiagTensorT3, VectorT3
VVMatrix
 
typedef VVMatrix::DiagArray VVDiagArray
 
typedef Gradient< VectorT3VGradType
 
typedef Array< Gradient
< VectorT3 > > 
VGradArray
 

Public Member Functions

 Impl (const GeomFields &geomFields, PlateFields &plateFields, const MeshList &meshes)
 
void init ()
 
PlateBCMapgetBCMap ()
 
PlateVCMapgetVCMap ()
 
PlateModelOptions< T > & getOptions ()
 
void updateTime ()
 
void initDeformationLinearization (LinearSystem &ls)
 
void linearizeDeformation (LinearSystem &ls)
 
MFRPtr solveDeformation ()
 
void calculatePlateVelocity ()
 
void calculatePlateAcceleration ()
 
void postPlateSolve (LinearSystem &ls)
 
bool advance (const int niter)
 
void printBCs ()
 
void getMoment (const Mesh &mesh)
 
map< string, shared_ptr
< ArrayBase > > & 
getPersistenceData ()
 
void restart ()
 
void dumpMatrix (const string fileBase)
 

Private Attributes

const MeshList _meshes
 
const GeomFields_geomFields
 
PlateFields_plateFields
 
PlateBCMap _bcMap
 
PlateVCMap _vcMap
 
PlateModelOptions< T > _options
 
GradientModel< VectorT3_deformationGradientModel
 
MFRPtr _initialDeformationNorm
 
int _niters
 
map< string, shared_ptr
< ArrayBase > > 
_persistenceData
 

Detailed Description

template<class T>
class PlateModel< T >::Impl

Definition at line 298 of file PlateModel_impl.h.

Member Typedef Documentation

template<class T>
typedef SquareTensor<T,3> PlateModel< T >::Impl::DiagTensorT3

Definition at line 311 of file PlateModel_impl.h.

template<class T>
typedef T PlateModel< T >::Impl::T_Scalar

Definition at line 301 of file PlateModel_impl.h.

template<class T>
typedef Array<T> PlateModel< T >::Impl::TArray

Definition at line 302 of file PlateModel_impl.h.

template<class T>
typedef Vector<T,3> PlateModel< T >::Impl::VectorT3

Definition at line 303 of file PlateModel_impl.h.

template<class T>
typedef Array<VectorT3> PlateModel< T >::Impl::VectorT3Array

Definition at line 306 of file PlateModel_impl.h.

template<class T>
typedef VectorTranspose<T,3> PlateModel< T >::Impl::VectorT3T

Definition at line 304 of file PlateModel_impl.h.

template<class T>
typedef Vector<T,4> PlateModel< T >::Impl::VectorT4

Definition at line 307 of file PlateModel_impl.h.

template<class T>
typedef Array<VectorT4> PlateModel< T >::Impl::VectorT4Array

Definition at line 308 of file PlateModel_impl.h.

template<class T>
typedef Array<Gradient<VectorT3> > PlateModel< T >::Impl::VGradArray

Definition at line 318 of file PlateModel_impl.h.

template<class T>
typedef Gradient<VectorT3> PlateModel< T >::Impl::VGradType

Definition at line 317 of file PlateModel_impl.h.

template<class T>
typedef VVMatrix::DiagArray PlateModel< T >::Impl::VVDiagArray

Definition at line 314 of file PlateModel_impl.h.

Definition at line 313 of file PlateModel_impl.h.

Constructor & Destructor Documentation

template<class T>
PlateModel< T >::Impl::Impl ( const GeomFields geomFields,
PlateFields plateFields,
const MeshList meshes 
)
inline

Definition at line 320 of file PlateModel_impl.h.

References Model::_meshes, PlateBC< T >::bcType, Mesh::getAllFaceGroups(), Mesh::getID(), FaceGroup::groupType, FaceGroup::id, and PlateVC< T >::vcType.

322  :
323  _meshes(meshes),
324  _geomFields(geomFields),
325  _plateFields(plateFields),
329  _niters(0)
330  {
331  const int numMeshes = _meshes.size();
332  for (int n=0; n<numMeshes; n++)
333  {
334  const Mesh& mesh = *_meshes[n];
335 
336  PlateVC<T> *vc(new PlateVC<T>());
337  vc->vcType = "plate";
338  _vcMap[mesh.getID()] = vc;
339  foreach(const FaceGroupPtr fgPtr, mesh.getAllFaceGroups())
340  {
341  const FaceGroup& fg = *fgPtr;
342  if ((_bcMap.find(fg.id) == _bcMap.end())&&(fg.groupType != "interior"))
343  {
344  PlateBC<T> *bc(new PlateBC<T>());
345 
346  _bcMap[fg.id] = bc;
347  if (fg.groupType == "wall")
348  {
349  bc->bcType = "SpecifiedTraction";
350  }
351  else if (fg.groupType == "interface")
352  {
353  bc->bcType = "Interface";
354  }
355  else if (fg.groupType == "symmetry")
356  {
357  bc->bcType = "Symmetry";
358  }
359  else if ((fg.groupType == "velocity-inlet") ||
360  (fg.groupType == "pressure-inlet"))
361  {
362  bc->bcType = "SpecifiedDeformation";
363  }
364  else if (fg.groupType == "pressure-outlet")
365  {
366  bc->bcType = "SpecifiedForce";
367  }
368  else
369  throw CException("PlateModel: unknown face group type "
370  + fg.groupType);
371  }
372  }
373  }
374  }
GradientModel< VectorT3 > _deformationGradientModel
shared_ptr< FaceGroup > FaceGroupPtr
Definition: Mesh.h:46
Definition: Mesh.h:28
const FaceGroupList & getAllFaceGroups() const
Definition: Mesh.h:193
PlateFields & _plateFields
Definition: Mesh.h:49
const MeshList _meshes
string groupType
Definition: Mesh.h:42
const int id
Definition: Mesh.h:41
MFRPtr _initialDeformationNorm
Field deformation
Definition: PlateFields.h:15
Field deformationGradient
Definition: PlateFields.h:27
const GeomFields & _geomFields
int getID() const
Definition: Mesh.h:106

Member Function Documentation

template<class T>
bool PlateModel< T >::Impl::advance ( const int  niter)
inline

Definition at line 1006 of file PlateModel_impl.h.

1007  {
1008 
1009  for(int n=0; n<niter; n++)
1010  {
1011  MFRPtr dNorm = solveDeformation();
1012 
1013  if (_niters < 5)
1014  {
1015  _initialDeformationNorm->setMax(*dNorm);
1016  }
1017 
1018  MFRPtr dNormRatio(dNorm->normalize(*_initialDeformationNorm));
1019 
1020  if (_options.printNormalizedResiduals)
1021  cout << _niters << ": " << *dNormRatio << endl;
1022  else
1023  cout << _niters << ": " << *dNorm << endl;
1024 
1025  _niters++;
1026  if (*dNormRatio < _options.deformationTolerance)
1027  return true;
1028  }
1029  return false;
1030  }
MFRPtr solveDeformation()
MFRPtr _initialDeformationNorm
PlateModelOptions< T > _options
shared_ptr< MultiFieldReduction > MFRPtr
template<class T>
void PlateModel< T >::Impl::calculatePlateAcceleration ( )
inline

Definition at line 888 of file PlateModel_impl.h.

References Model::_meshes, Mesh::getCells(), and StorageSite::getCountLevel1().

889  {
890 
891  T_Scalar two(2.0);
892  T_Scalar three(3.0);
893  T_Scalar five(5.0);
894  T_Scalar four(4.0);
895  T_Scalar twelve(12.0);
896  T_Scalar dT = _options["timeStep"];
897 
898  const T_Scalar dT2 = dT*dT;
899 
900  const int numMeshes = _meshes.size();
901  for(int n=0;n<numMeshes;n++)
902  {
903  const Mesh& mesh = *_meshes[n];
904  const StorageSite& cells = mesh.getCells();
905  const int nCells = cells.getCountLevel1();
906 
907  TArray& acceleration =
908  dynamic_cast<TArray&>(_plateFields.acceleration[cells]);
909  const VectorT3Array& w =
910  dynamic_cast<const VectorT3Array&>(_plateFields.deformation[cells]);
911  const VectorT3Array& wN1 =
912  dynamic_cast<const VectorT3Array&>(_plateFields.deformationN1[cells]);
913  const VectorT3Array& wN2 =
914  dynamic_cast<const VectorT3Array&>(_plateFields.deformationN2[cells]);
915  const TArray& density =
916  dynamic_cast<const TArray&> (_plateFields.density[cells]);
917  //constant time step
918  if(!_options.variableTimeStep)
919  {
920  if (_options.timeDiscretizationOrder > 1) //second order
921  {
922  const VectorT3Array& wN3 =
923  dynamic_cast<const VectorT3Array&>(_plateFields.deformationN3[cells]);
924  for(int c=0; c<nCells; c++)
925  {
926  const T_Scalar rhobydT2 = density[c]/dT2;
927  acceleration[c] = rhobydT2*(two*w[c][2] - five*wN1[c][2] + four*wN2[c][2]
928  - wN3[c][2]);
929  }
930  }
931  else // first order
932  {
933  for(int c=0; c<nCells; c++)
934  {
935  const T_Scalar rhobydT2 = density[c]/dT2;
936  acceleration[c] = rhobydT2*(w[c][2]- two*wN1[c][2] + wN2[c][2]);
937  }
938  }
939  }
940  //variable time step
941  else
942  {
943  T_Scalar dTN1 = _options.timeStepN1;
944  T_Scalar dTN2 = _options.timeStepN2;
945  T_Scalar a = (dT + dTN1)/dT;
946  T_Scalar b = (dT + dTN1 + dTN2)/dT;
947  T_Scalar one(1.0);
948  if (_options.timeDiscretizationOrder > 1) //second order
949  {
950  const VectorT3Array& wN3 =
951  dynamic_cast<const VectorT3Array&>(_plateFields.deformationN3[cells]);
952  T_Scalar c1 = (two*a*b*(pow(a,two)-pow(b,two))+two*b*(pow(b,two)-one)-two*a*(pow(a,two)-one))/
953  (a*b*(a-one)*(b-one)*(a-b));
954  T_Scalar c2 = -two*(a+b)/((a-1)*(b-1));
955  T_Scalar c3 = -two*(b+one)/(a*(a-b)*(a-one));
956  T_Scalar c4 = two*(a+one)/(b*(a-b)*(b-one));
957  for(int c=0; c<nCells; c++)
958  {
959  const T_Scalar rhobydT2 = density[c]/dT2;
960  acceleration[c] = rhobydT2*(c1*w[c][2] + c2*wN1[c][2] + c3*wN2[c][2]
961  + c4*wN3[c][2]);
962  }
963  }
964  else
965  {
966  T_Scalar c1 = two/a;
967  T_Scalar c2 = -two/(a-one);
968  T_Scalar c3 = two/(a*(a-one));
969  for(int c=0; c<nCells; c++)
970  {
971  const T_Scalar rhobydT2 = density[c]/dT2;
972  acceleration[c] = rhobydT2*(c1*w[c][2] + c2*wN1[c][2]
973  + c3*wN2[c][2]);
974  }
975  }
976  }
977  }
978  }
Field deformationN3
Definition: PlateFields.h:34
PlateFields & _plateFields
Field deformationN2
Definition: PlateFields.h:33
Definition: Mesh.h:49
const MeshList _meshes
const StorageSite & getCells() const
Definition: Mesh.h:109
Field acceleration
Definition: PlateFields.h:40
int getCountLevel1() const
Definition: StorageSite.h:72
PlateModelOptions< T > _options
Field density
Definition: PlateFields.h:31
Field deformation
Definition: PlateFields.h:15
Field deformationN1
Definition: PlateFields.h:32
template<class T>
void PlateModel< T >::Impl::calculatePlateVelocity ( )
inline

Definition at line 865 of file PlateModel_impl.h.

References Model::_meshes, Mesh::getCells(), and StorageSite::getCountLevel1().

866  {
867  const int numMeshes = _meshes.size();
868  for(int n=0;n<numMeshes;n++)
869  {
870  const Mesh& mesh = *_meshes[n];
871  const StorageSite& cells = mesh.getCells();
872  const int nCells = cells.getCountLevel1();
873  const VectorT3Array& w =
874  dynamic_cast<const VectorT3Array&>(_plateFields.deformation[cells]);
875  const VectorT3Array& wN1 =
876  dynamic_cast<const VectorT3Array&>(_plateFields.deformationN1[cells]);
877  VectorT3Array& velocity =
878  dynamic_cast<VectorT3Array&>(_plateFields.velocity[cells]);
879  const T timeStep = _options["timeStep"];
880  for (int c=0; c<nCells; c++){
881  velocity[c] = (w[c]-wN1[c])/timeStep;
882  }
883 
884  }
885  }
PlateFields & _plateFields
Definition: Mesh.h:49
const MeshList _meshes
Field velocity
Definition: PlateFields.h:41
const StorageSite & getCells() const
Definition: Mesh.h:109
int getCountLevel1() const
Definition: StorageSite.h:72
PlateModelOptions< T > _options
Field deformation
Definition: PlateFields.h:15
Field deformationN1
Definition: PlateFields.h:32
template<class T>
void PlateModel< T >::Impl::dumpMatrix ( const string  fileBase)
inline

Definition at line 1180 of file PlateModel_impl.h.

References Model::_meshes, LinearSystem::getB(), Mesh::getCells(), CRConnectivity::getCol(), CRMatrix< T_Diag, T_OffDiag, X >::getConnectivity(), CRMatrix< T_Diag, T_OffDiag, X >::getDiag(), LinearSystem::getMatrix(), MultiFieldMatrix::getMatrix(), CRMatrix< T_Diag, T_OffDiag, X >::getOffDiag(), CRConnectivity::getRow(), StorageSite::getSelfCount(), LinearSystem::initAssembly(), and LinearSystem::initSolve().

1181  {
1182  LinearSystem ls;
1184  ls.initAssembly();
1186  ls.initSolve();
1187 
1188  MultiFieldMatrix& mfmatrix = ls.getMatrix();
1189  MultiField& b = ls.getB();
1190 
1191  const Mesh& mesh = *_meshes[0];
1192  const StorageSite& cells = mesh.getCells();
1193 
1195 
1196  VVMatrix& matrix =
1197  dynamic_cast<VVMatrix&>(mfmatrix.getMatrix(vIndex,vIndex));
1198 
1199  VVDiagArray& diag = matrix.getDiag();
1200  VVDiagArray& coeff = matrix.getOffDiag();
1201 
1202  VectorT3Array& rCell = dynamic_cast<VectorT3Array&>(b[vIndex]);
1203 
1204  const CRConnectivity& cr = matrix.getConnectivity();
1205 
1206  const Array<int>& row = cr.getRow();
1207  const Array<int>& col = cr.getCol();
1208 
1209  const int nCells = cells.getSelfCount();
1210 
1211  const int dimension = 3;
1212 
1213  const int dim2 = dimension*dimension;
1214 
1215  int nFlatRows = dimension*nCells;
1216 
1217  int nFlatCoeffs = nCells*dim2;
1218 
1219  for(int i=0; i<nCells; i++)
1220  for(int jp=row[i]; jp<row[i+1]; jp++)
1221  {
1222  const int j = col[jp];
1223  if (j<nCells) nFlatCoeffs += dim2;
1224  }
1225 
1226  string matFileName = fileBase + ".mat";
1227  FILE *matFile = fopen(matFileName.c_str(),"wb");
1228 
1229  fprintf(matFile,"%%%%MatrixMarket matrix coordinate real general\n");
1230  fprintf(matFile,"%d %d %d\n", nFlatRows,nFlatRows,nFlatCoeffs);
1231 
1232  for(int i=0; i<nCells; i++)
1233  {
1234  for(int ndr=0; ndr<dimension; ndr++)
1235  for(int ndc=0; ndc<dimension; ndc++)
1236  {
1237  const int nfr = i*dimension + ndr;
1238  const int nfc = i*dimension + ndc;
1239  T ap = diag[i](ndr,ndc);
1240  //if (fabs(ap) < 1.0) ap =0.;
1241  fprintf(matFile,"%d %d %22.15le\n", nfr+1, nfc+1, ap);
1242  }
1243 
1244  for(int jp=row[i]; jp<row[i+1]; jp++)
1245  {
1246  const int j = col[jp];
1247  if (j<nCells)
1248  {
1249  for(int ndr=0; ndr<dimension; ndr++)
1250  for(int ndc=0; ndc<dimension; ndc++)
1251  {
1252  const int nfr = i*dimension + ndr;
1253  const int nfc = j*dimension + ndc;
1254  T anb = coeff[jp](ndr,ndc);
1255  //if (fabs(anb) < 1.0) anb =0.;
1256  fprintf(matFile,"%d %d %22.15le\n", nfr+1, nfc+1, anb);
1257  }
1258  }
1259  }
1260  }
1261 
1262  fclose(matFile);
1263 
1264  string rhsFileName = fileBase + ".rhs";
1265  FILE *rhsFile = fopen(rhsFileName.c_str(),"wb");
1266 
1267  for(int i=0; i<nCells; i++)
1268  for(int nd=0; nd < dimension; nd++)
1269  fprintf(rhsFile,"%22.15le\n",-rCell[i][nd]);
1270 
1271  fclose(rhsFile);
1272  }
const Array< int > & getCol() const
const Array< int > & getRow() const
void initAssembly()
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
int getSelfCount() const
Definition: StorageSite.h:40
void initDeformationLinearization(LinearSystem &ls)
VVMatrix::DiagArray VVDiagArray
PlateFields & _plateFields
Definition: Mesh.h:49
const MeshList _meshes
void linearizeDeformation(LinearSystem &ls)
pair< const Field *, const StorageSite * > ArrayIndex
Definition: MultiField.h:21
void initSolve()
const StorageSite & getCells() const
Definition: Mesh.h:109
Field deformation
Definition: PlateFields.h:15
CRMatrix< DiagTensorT3, DiagTensorT3, VectorT3 > VVMatrix
MultiField & getB()
Definition: LinearSystem.h:33
MultiFieldMatrix & getMatrix()
Definition: LinearSystem.h:37
template<class T>
PlateBCMap& PlateModel< T >::Impl::getBCMap ( )
inline

Definition at line 555 of file PlateModel_impl.h.

555 {return _bcMap;}
template<class T>
void PlateModel< T >::Impl::getMoment ( const Mesh mesh)
inline

Definition at line 1045 of file PlateModel_impl.h.

References Mesh::getCells(), StorageSite::getCountLevel1(), and sqrt().

1046  {
1047  const StorageSite& cells = mesh.getCells();
1048 
1049  const int nCells = cells.getCountLevel1();
1050 
1051  shared_ptr<VectorT3Array> momentPtr(new VectorT3Array(nCells));
1052  momentPtr->zero();
1053  _plateFields.moment.addArray(cells,momentPtr);
1054  VectorT3Array& moment = *momentPtr;
1055 
1056  _deformationGradientModel.compute();
1057 
1058  const VGradArray& wGrad =
1059  dynamic_cast<const VGradArray&>(_plateFields.deformationGradient[cells]);
1060 
1061  const TArray& ym = dynamic_cast<const TArray&>(_plateFields.ym[cells]);
1062  const TArray& nu = dynamic_cast<const TArray&>(_plateFields.nu[cells]);
1063 
1064  const TArray& thickness = dynamic_cast<const TArray&>(_plateFields.thickness[cells]);
1065 
1066  TArray& VMStress = dynamic_cast<TArray&>(_plateFields.VMStress[cells]);
1067  TArray& VMStressOut = dynamic_cast<TArray&>(_plateFields.VMStressOut[cells]);
1068  VectorT3Array& cellStress =
1069  dynamic_cast<VectorT3Array&>(_plateFields.stress[cells]);
1070  VectorT4Array& devStress =
1071  dynamic_cast<VectorT4Array&>(_plateFields.devStress[cells]);
1072  VectorT4Array& pg =
1073  dynamic_cast<VectorT4Array&>(_plateFields.plasticStrain[cells]);
1074 
1075  VectorT3Array& plasticMoment =
1076  dynamic_cast<VectorT3Array&>(_plateFields.plasticMoment[cells]);
1077 
1078  VectorT3Array& cellStrain =
1079  dynamic_cast<VectorT3Array&>(_plateFields.strain[cells]);
1080 
1081  const T onethird(1.0/3.0);
1082  const T one(1.0);
1083  const T two(2.0);
1084  const T three(3.0);
1085  const T six(6.0);
1086  const T twelve(12.0);
1087  const T zero(0.0);
1088 
1089  for(int n=0; n<nCells; n++)
1090  {
1091  T cellD = ym[n]*pow(thickness[n],three)/(twelve*(one - pow(nu[n],two)));
1092  const VGradType& wg = wGrad[n];
1093  VectorT3 stress;
1094 
1095  moment[n][0] = cellD*(wg[0][0]+nu[n]*wg[1][1]);
1096  moment[n][1] = cellD*(wg[1][1]+nu[n]*wg[0][0]);
1097  moment[n][2] = cellD*((one-nu[n])/two)*(wg[1][0]+wg[0][1]);
1098  if(_options.creep)
1099  moment[n] = moment[n] - plasticMoment[n];
1100 
1101  cellStress[n][0] = six*moment[n][0]/pow(thickness[n],two);
1102  cellStress[n][1] = six*moment[n][1]/pow(thickness[n],two);
1103  cellStress[n][2] = six*moment[n][2]/pow(thickness[n],two);
1104 
1105  cellStrain[n][0] = (thickness[n]/two)*wg[0][0];
1106  cellStrain[n][1] = (thickness[n]/two)*wg[1][1];
1107  cellStrain[n][2] = (thickness[n]/two)*(wg[1][0]+wg[0][1]);
1108 
1109  T cellE = ym[n]/(one - pow(nu[n],two));
1110 
1111  int nn = n*(_options.nz+1);
1112  for(int k=0; k<=_options.nz; k++)
1113  {
1114  T zz(thickness[n]*(T(k)-T(_options.nz)/T(2))/T(_options.nz));
1115  stress[0] = (twelve*zz/pow(thickness[n],three))*cellD*(wg[0][0]+nu[n]*wg[1][1])-
1116  cellE*(pg[nn+k][0]+nu[n]*pg[nn+k][1]);
1117  stress[1] = (twelve*zz/pow(thickness[n],three))*cellD*(wg[1][1]+nu[n]*wg[0][0])-
1118  cellE*(pg[nn+k][1]+nu[n]*pg[nn+k][0]);
1119  stress[2] = (twelve*zz/pow(thickness[n],three))*cellD*((one-nu[n])/two)*(wg[1][0]+wg[0][1])-
1120  cellE*(one-nu[n])*(pg[nn+k][3]);
1121 
1122  T trace = stress[0] + stress[1];
1123  devStress[nn+k][0] = stress[0];
1124  devStress[nn+k][1] = stress[1];
1125  devStress[nn+k][2] = zero;
1126  devStress[nn+k][3] = stress[2];
1127  devStress[nn+k][0] = devStress[nn+k][0] - onethird*trace;
1128  devStress[nn+k][1] = devStress[nn+k][1] - onethird*trace;
1129  devStress[nn+k][2] = devStress[nn+k][2] - onethird*trace;
1130  VMStress[nn+k] = sqrt(pow(stress[0],2.0) + pow(stress[1],2.0) -
1131  stress[0]*stress[1] + three*pow(stress[2],2.0));
1132  //VMStress[nn+k] = sqrt(pow(stress[0],2.0) + three*pow(stress[2],2.0));
1133  }
1134  VMStressOut[n] = VMStress[nn+_options.nz];
1135  }
1136  }
GradientModel< VectorT3 > _deformationGradientModel
Gradient< VectorT3 > VGradType
Array< VectorT3 > VectorT3Array
Field stress
Definition: PlateFields.h:17
Array< Gradient< VectorT3 > > VGradArray
PlateFields & _plateFields
Field thickness
Definition: PlateFields.h:38
Field VMStress
Definition: PlateFields.h:20
Field devStress
Definition: PlateFields.h:19
Field VMStressOut
Definition: PlateFields.h:21
Tangent sqrt(const Tangent &a)
Definition: Tangent.h:317
Field moment
Definition: PlateFields.h:16
Array< VectorT4 > VectorT4Array
const StorageSite & getCells() const
Definition: Mesh.h:109
Field plasticMoment
Definition: PlateFields.h:26
int getCountLevel1() const
Definition: StorageSite.h:72
PlateModelOptions< T > _options
void addArray(const StorageSite &, shared_ptr< ArrayBase > a)
Definition: Field.cpp:72
Field strain
Definition: PlateFields.h:22
Field plasticStrain
Definition: PlateFields.h:23
Field deformationGradient
Definition: PlateFields.h:27
template<class T>
PlateModelOptions<T>& PlateModel< T >::Impl::getOptions ( )
inline

Definition at line 557 of file PlateModel_impl.h.

557 {return _options;}
PlateModelOptions< T > _options
template<class T>
map<string,shared_ptr<ArrayBase> >& PlateModel< T >::Impl::getPersistenceData ( )
inline

Definition at line 1139 of file PlateModel_impl.h.

References Model::_persistenceData, and Array< T >::zero().

1140  {
1141  _persistenceData.clear();
1142 
1143  Array<int>* niterArray = new Array<int>(1);
1144  (*niterArray)[0] = _niters;
1145  _persistenceData["niters"]=shared_ptr<ArrayBase>(niterArray);
1146 
1148  {
1149  _persistenceData["initialDeformationNorm"] =
1151  }
1152  else
1153  {
1154  Array<Vector<T,3> >* xArray = new Array<Vector<T,3> >(1);
1155  xArray->zero();
1156  _persistenceData["initialDeformationNorm"]=shared_ptr<ArrayBase>(xArray);
1157  }
1158  return _persistenceData;
1159  }
virtual void zero()
Definition: Array.h:281
PlateFields & _plateFields
map< string, shared_ptr< ArrayBase > > _persistenceData
MFRPtr _initialDeformationNorm
Field deformation
Definition: PlateFields.h:15
template<class T>
PlateVCMap& PlateModel< T >::Impl::getVCMap ( )
inline

Definition at line 556 of file PlateModel_impl.h.

556 {return _vcMap;}
template<class T>
void PlateModel< T >::Impl::init ( )
inline

Definition at line 376 of file PlateModel_impl.h.

References Model::_meshes, Mesh::getAllFaceGroups(), Mesh::getCells(), StorageSite::getCount(), StorageSite::getCountLevel1(), Mesh::getID(), FaceGroup::groupType, and FaceGroup::site.

377  {
378  const int numMeshes = _meshes.size();
379  for (int n=0; n<numMeshes; n++)
380  {
381  const Mesh& mesh = *_meshes[n];
382 
383  const PlateVC<T>& vc = *_vcMap[mesh.getID()];
384 
385  const StorageSite& cells = mesh.getCells();
386  // const StorageSite& faces = mesh.getFaces();
387 
388  shared_ptr<VectorT3Array> sCell(new VectorT3Array(cells.getCountLevel1()));
389 
390  VectorT3 initialDeformation;
391  initialDeformation[0] = _options["initialXRotation"];
392  initialDeformation[1] = _options["initialYRotation"];
393  initialDeformation[2] = _options["initialZDeformation"];
394  *sCell = initialDeformation;
395 
396  _plateFields.deformation.addArray(cells,sCell);
398 
399  if (_options.transient)
400  {
402  dynamic_pointer_cast<ArrayBase>
403  (_geomFields.volume[cells].newCopy()));
405 
407  dynamic_pointer_cast<ArrayBase>(sCell->newCopy()));
409 
411  dynamic_pointer_cast<ArrayBase>(sCell->newCopy()));
413 
414  if (_options.timeDiscretizationOrder > 1)
416  dynamic_pointer_cast<ArrayBase>(sCell->newCopy()));
418 
419  if(_options.variableTimeStep)
420  {
421  _options.timeStepN1 = _options["timeStep"];
422  _options.timeStepN2 = _options["timeStep"];
423  }
424  }
425 
426  shared_ptr<VectorT3Array> stressField(new VectorT3Array(cells.getCountLevel1()));
427  stressField->zero();
428  _plateFields.stress.addArray(cells,stressField);
430 
431  shared_ptr<VectorT4Array> devStressField(new VectorT4Array((cells.getCountLevel1())*(_options.nz+1)));
432  devStressField->zero();
433  _plateFields.devStress.addArray(cells,devStressField);
435 
436  shared_ptr<TArray> VMStressField(new TArray((cells.getCountLevel1())*(_options.nz+1)));
437  VMStressField->zero();
438  _plateFields.VMStress.addArray(cells,VMStressField);
440 
441  shared_ptr<TArray> VMStressOutField(new TArray(cells.getCountLevel1()));
442  VMStressOutField->zero();
443  _plateFields.VMStressOut.addArray(cells,VMStressOutField);
445 
446  shared_ptr<VectorT3Array> strainField(new VectorT3Array(cells.getCountLevel1()));
447  strainField->zero();
448  _plateFields.strain.addArray(cells,strainField);
450 
451  shared_ptr<VectorT4Array> plasticStrainField(new VectorT4Array((cells.getCountLevel1())*(_options.nz+1)));
452  plasticStrainField->zero();
453  _plateFields.plasticStrain.addArray(cells,plasticStrainField);
455 
456  shared_ptr<VectorT3Array> plasticStrainOutField(new VectorT3Array(cells.getCountLevel1()));
457  plasticStrainOutField->zero();
458  _plateFields.plasticStrainOut.addArray(cells,plasticStrainOutField);
460 
461  shared_ptr<VectorT4Array> plasticStrainN1Field(new VectorT4Array((cells.getCountLevel1())*(_options.nz+1)));
462  plasticStrainN1Field->zero();
463  _plateFields.plasticStrainN1.addArray(cells,plasticStrainN1Field);
465 
466  shared_ptr<VectorT3Array> plasticMomentField(new VectorT3Array(cells.getCountLevel1()));
467  plasticMomentField->zero();
468  _plateFields.plasticMoment.addArray(cells,plasticMomentField);
470 
471  shared_ptr<TArray> rhoCell(new TArray(cells.getCountLevel1()));
472  *rhoCell = vc["density"];
473  _plateFields.density.addArray(cells,rhoCell);
475 
476  shared_ptr<TArray> ymCell(new TArray(cells.getCountLevel1()));
477  *ymCell = vc["ym"];
478  _plateFields.ym.addArray(cells,ymCell);
480 
481  shared_ptr<TArray> nuCell(new TArray(cells.getCountLevel1()));
482  *nuCell = vc["nu"];
483  _plateFields.nu.addArray(cells,nuCell);
485 
486  shared_ptr<TArray> forceCell(new TArray(cells.getCountLevel1()));
487  forceCell->zero();
488  _plateFields.force.addArray(cells,forceCell);
490 
491  shared_ptr<TArray> thicknessCell(new TArray(cells.getCountLevel1()));
492  thicknessCell->zero();
493  _plateFields.thickness.addArray(cells,thicknessCell);
495 
496  shared_ptr<TArray> accelerationCell(new TArray(cells.getCountLevel1()));
497  accelerationCell->zero();
498  _plateFields.acceleration.addArray(cells,accelerationCell);
500 
501  shared_ptr<VectorT3Array> velCell(new VectorT3Array(cells.getCountLevel1()));
502  velCell->zero();
503  _plateFields.velocity.addArray(cells,velCell);
505 
506  //initial temparature gradient array
507  shared_ptr<VGradArray> rCell(new VGradArray(cells.getCountLevel1()));
508  VGradType residualStress;
509  residualStress[0][0] = _options["residualStressXX"];
510  residualStress[0][1] = _options["residualStressXY"];
511  residualStress[0][2] = _options["residualStressXZ"];
512  residualStress[1][0] = _options["residualStressXY"];
513  residualStress[1][1] = _options["residualStressYY"];
514  residualStress[1][2] = _options["residualStressYZ"];
515  residualStress[2][0] = _options["residualStressXZ"];
516  residualStress[2][1] = _options["residualStressYZ"];
517  residualStress[2][2] = _options["residualStressZZ"];
518  *rCell = residualStress;
519  _plateFields.residualStress.addArray(cells,rCell);
521 
522  // compute values of deformation flux
523 
524  // store deformation flux at interfaces
525  /*
526  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
527  {
528  const FaceGroup& fg = *fgPtr;
529  const StorageSite& faces = fg.site;
530  shared_ptr<VectorT3Array> deformationFlux(new VectorT3Array(faces.getCount()));
531  deformationFlux->zero();
532  _plateFields.deformationFlux.addArray(faces,deformationFlux);
533  }
534  */
535 
536  // store deformation flux at boundary faces
537  foreach(const FaceGroupPtr fgPtr, mesh.getAllFaceGroups())
538  {
539  const FaceGroup& fg = *fgPtr;
540  const StorageSite& faces = fg.site;
541  shared_ptr<VectorT3Array> deformationFlux(new VectorT3Array(faces.getCount()));
542  deformationFlux->zero();
543  if (fg.groupType != "interior")
544  {
545  _plateFields.deformationFlux.addArray(faces,deformationFlux);
546  }
547  }
548 
549  }
550 
551  _niters =0;
553  }
Field deformationN3
Definition: PlateFields.h:34
shared_ptr< FaceGroup > FaceGroupPtr
Definition: Mesh.h:46
Gradient< VectorT3 > VGradType
Array< VectorT3 > VectorT3Array
Field stress
Definition: PlateFields.h:17
Definition: Mesh.h:28
Field deformationFlux
Definition: PlateFields.h:28
Array< Gradient< VectorT3 > > VGradArray
const FaceGroupList & getAllFaceGroups() const
Definition: Mesh.h:193
PlateFields & _plateFields
Field thickness
Definition: PlateFields.h:38
Field deformationN2
Definition: PlateFields.h:33
Field VMStress
Definition: PlateFields.h:20
Field devStress
Definition: PlateFields.h:19
Definition: Mesh.h:49
Field VMStressOut
Definition: PlateFields.h:21
const MeshList _meshes
string groupType
Definition: Mesh.h:42
Field plasticStrainN1
Definition: PlateFields.h:25
Field velocity
Definition: PlateFields.h:41
Array< VectorT4 > VectorT4Array
MFRPtr _initialDeformationNorm
const StorageSite & getCells() const
Definition: Mesh.h:109
Field plasticMoment
Definition: PlateFields.h:26
Field volume
Definition: GeomFields.h:26
Field acceleration
Definition: PlateFields.h:40
int getCountLevel1() const
Definition: StorageSite.h:72
PlateModelOptions< T > _options
Field density
Definition: PlateFields.h:31
void addArray(const StorageSite &, shared_ptr< ArrayBase > a)
Definition: Field.cpp:72
Field force
Definition: PlateFields.h:39
Field strain
Definition: PlateFields.h:22
Field plasticStrain
Definition: PlateFields.h:23
Field deformation
Definition: PlateFields.h:15
Field residualStress
Definition: PlateFields.h:18
int getCount() const
Definition: StorageSite.h:39
Field volume0
Definition: PlateFields.h:43
shared_ptr< MultiFieldReduction > MFRPtr
Field plasticStrainOut
Definition: PlateFields.h:24
const GeomFields & _geomFields
void syncLocal()
Definition: Field.cpp:334
int getID() const
Definition: Mesh.h:106
Field deformationN1
Definition: PlateFields.h:32
virtual shared_ptr< IContainer > newCopy() const
Definition: Field.cpp:155
StorageSite site
Definition: Mesh.h:40
template<class T>
void PlateModel< T >::Impl::initDeformationLinearization ( LinearSystem ls)
inline

Definition at line 598 of file PlateModel_impl.h.

References Model::_meshes, MultiField::addArray(), MultiFieldMatrix::addMatrix(), Mesh::getCellCells2(), Mesh::getCells(), LinearSystem::getMatrix(), and LinearSystem::getX().

599  {
600  const int numMeshes = _meshes.size();
601  for (int n=0; n<numMeshes; n++)
602  {
603  const Mesh& mesh = *_meshes[n];
604 
605  const StorageSite& cells = mesh.getCells();
607 
608  ls.getX().addArray(wIndex,_plateFields.deformation.getArrayPtr(cells));
609 
610  const CRConnectivity& cellCells2 = mesh.getCellCells2();
611 
612  shared_ptr<Matrix> m(new CRMatrix<DiagTensorT3,DiagTensorT3,VectorT3>(cellCells2));
613 
614  ls.getMatrix().addMatrix(wIndex,wIndex,m);
615 
616  }
617  }
PlateFields & _plateFields
Definition: Mesh.h:49
const MeshList _meshes
pair< const Field *, const StorageSite * > ArrayIndex
Definition: MultiField.h:21
const StorageSite & getCells() const
Definition: Mesh.h:109
void addMatrix(const Index &rowI, const Index &colI, shared_ptr< Matrix > m)
const CRConnectivity & getCellCells2() const
Definition: Mesh.cpp:495
Field deformation
Definition: PlateFields.h:15
void addArray(const ArrayIndex &aIndex, shared_ptr< ArrayBase > a)
Definition: MultiField.cpp:270
MultiField & getX()
Definition: LinearSystem.h:32
shared_ptr< ArrayBase > getArrayPtr(const StorageSite &)
Definition: Field.cpp:63
MultiFieldMatrix & getMatrix()
Definition: LinearSystem.h:37
template<class T>
void PlateModel< T >::Impl::linearizeDeformation ( LinearSystem ls)
inline

Definition at line 619 of file PlateModel_impl.h.

References Model::_meshes, PlateBCS< X, Diag, OffDiag >::applyCantileverBC(), PlateBCS< X, Diag, OffDiag >::applyDirichletBC(), PlateBCS< X, Diag, OffDiag >::applyNeumannBC(), PlateBC< T >::bcType, Mesh::getAllFaceGroups(), LinearSystem::getB(), Mesh::getCells(), StorageSite::getCount(), LinearSystem::getMatrix(), MultiFieldMatrix::getMatrix(), PlateModel< T >::getMoment(), FloatVarDict< T >::getVal(), LinearSystem::getX(), FaceGroup::groupType, FaceGroup::id, Linearizer::linearize(), CRMatrix< T_Diag, T_OffDiag, X >::setDirichlet(), and FaceGroup::site.

620  {
621  _deformationGradientModel.compute();
622  DiscrList discretizations;
623 
624  const Mesh& mesh = *_meshes[0];
625  if(!_options.constForce)
626  getMoment(mesh);
627  shared_ptr<Discretization>
637  _options.scf,
644  _options.A,
645  _options.B,
646  _options.m,
647  _options.n,
648  _options.Sy0,
649  _options.nz,
650  _options["timeStep"],
651  _options.creepModel,
652  _options.creep));
653 
654  // shared_ptr<Discretization>
655  // bfd(new SourceDiscretization<VectorT3>
656  // (_meshes,_geomFields,
657  // _structureFields.deformation,
658  // _structureFields.bodyForce));
659 
660  discretizations.push_back(sd);
661  //discretizations.push_back(bfd);
662 
663  if (_options.transient)
664  {
665  shared_ptr<Discretization>
677  _options.variableTimeStep,
678  _options["timeStep"],
679  _options.timeStepN1,
680  _options.timeStepN2));
681 
682  discretizations.push_back(td);
683  }
684 
685  /*
686  shared_ptr<Discretization>
687  ibm(new GenericIBDiscretization<VectorT3,DiagTensorT3,T>
688  (_meshes,_geomFields,_plateFields.deformation));
689 
690  discretizations.push_back(ibm);
691  */
692  Linearizer linearizer;
693 
694  linearizer.linearize(discretizations,_meshes,ls.getMatrix(),
695  ls.getX(), ls.getB());
696  bool allNeumann = true;
697  const int numMeshes = _meshes.size();
698  for (int n=0; n<numMeshes; n++)
699  {
700  const Mesh& mesh = *_meshes[n];
701 
702  foreach(const FaceGroupPtr fgPtr, mesh.getAllFaceGroups())
703  {
704  const FaceGroup& fg = *fgPtr;
705  if (fg.groupType != "interior")
706  {
707  const StorageSite& faces = fg.site;
708  const int nFaces = faces.getCount();
709  const TArray& faceAreaMag =
710  dynamic_cast<const TArray&>(_geomFields.areaMag[faces]);
711  const PlateBC<T>& bc = *_bcMap[fg.id];
712 
713 
715  _geomFields,
717  ls.getMatrix(), ls.getX(), ls.getB());
718 
721  if (bc.bcType == "Clamped")
722  {
724  bDeformation(bc.getVal("specifiedXRotation"),
725  bc.getVal("specifiedYRotation"),
726  bc.getVal("specifiedZDeformation"),
727  faces);
728  fluxB = gbc.applyDirichletBC(bDeformation);
729 
730  allNeumann = false;
731  }
732  else if (bc.bcType == "Symmetry")
733  {
734  gbc.applySymmetryBC();
735  allNeumann = false;
736  }
737  else if (bc.bcType == "ZeroDerivative")
738  {
739  gbc.applyZeroDerivativeBC();
740  }
741  else if (bc.bcType == "SpecifiedTraction")
742  {
743  for(int f=0; f<nFaces; f++)
744  {
745 
746  fluxB += gbc.applyNeumannBC(f,zeroFlux);
747 
748  }
749  }
750  else if (bc.bcType == "SpecifiedForce")
751  {
753  bForce(bc.getVal("specifiedXForce"),
754  bc.getVal("specifiedYForce"),
755  bc.getVal("specifiedZForce"),
756  faces);
757  for(int f=0; f<nFaces; f++)
758  {
759 
760  fluxB += gbc.applyNeumannBC(f,bForce[f]/faceAreaMag[f]);
761 
762  }
763  }
764  else if (bc.bcType == "SpecifiedShear")
765  {
767  bShear(bc.getVal("specifiedXShear"),
768  bc.getVal("specifiedYShear"),
769  bc.getVal("specifiedZShear"),
770  faces);
771  for(int f=0; f<nFaces; f++)
772  {
773 
774  fluxB += gbc.applyCantileverBC(f,bShear[f]);
775 
776  }
777  }
778  else if (bc.bcType != "Interface")
779  throw CException(bc.bcType + " not implemented for StructureModel");
780  //cout << "force sum for " << fg.id << " = " << fluxB << endl;
781  }
782  }
783  /*
784  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
785  {
786  const FaceGroup& fg = *fgPtr;
787  const StorageSite& faces = fg.site;
788  GenericBCS<VectorT3,DiagTensorT3,DiagTensorT3> gbc(faces,mesh,
789  _geomFields,
790  _structureFields.deformation,
791  _structureFields.deformationFlux,
792  ls.getMatrix(), ls.getX(), ls.getB());
793 
794  gbc.applyInterfaceBC();
795  }
796  */
797  }
798 
799 
800 #ifdef FVM_PARALLEL
801  int count = 1;
802  int allNeumannInt = int( allNeumann);
803  MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &allNeumannInt, count, MPI::INT, MPI::PROD);
804  allNeumann = bool(allNeumannInt);
805 #endif
806 
807 
808 
809  if(allNeumann && !_options.transient)
810  {
811  const Mesh& mesh = *_meshes[0];
812  const StorageSite& cells = mesh.getCells();
813  MultiField& b = ls.getB();
814  MultiFieldMatrix& matrix = ls.getMatrix();
816  VectorT3Array& rCell = dynamic_cast<VectorT3Array&>(b[wIndex]);
817  VectorT3Array& w = dynamic_cast<VectorT3Array&>
818  (_plateFields.deformation[cells]);
819  VVMatrix& vvMatrix =
820  dynamic_cast<VVMatrix&>(matrix.getMatrix(wIndex,wIndex));
821  rCell[0] = T(0);
822  w[0] = T(0);
823  vvMatrix.setDirichlet(0);
824  }
825 
826 #if 0
827  shared_ptr<Discretization>
829  (_meshes,_structureFields.deformation,
830  _options["deformationURF"]));
831 
832  DiscrList discretizations2;
833  discretizations2.push_back(ud);
834 
835  linearizer.linearize(discretizations2,_meshes,ls.getMatrix(),
836  ls.getX(), ls.getB());
837 #endif
838 
839  }
Field deformationN3
Definition: PlateFields.h:34
GradientModel< VectorT3 > _deformationGradientModel
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
shared_ptr< FaceGroup > FaceGroupPtr
Definition: Mesh.h:46
Definition: Mesh.h:28
const FaceGroupList & getAllFaceGroups() const
Definition: Mesh.h:193
PlateFields & _plateFields
Field thickness
Definition: PlateFields.h:38
Field deformationN2
Definition: PlateFields.h:33
Field VMStress
Definition: PlateFields.h:20
Field devStress
Definition: PlateFields.h:19
Definition: Mesh.h:49
void getMoment(const Mesh &mesh)
const MeshList _meshes
string groupType
Definition: Mesh.h:42
FloatVal< T > getVal(const string varName) const
Definition: FloatVarDict.h:85
Field plasticStrainN1
Definition: PlateFields.h:25
SquareTensor< T, 3 > DiagTensorT3
const int id
Definition: Mesh.h:41
pair< const Field *, const StorageSite * > ArrayIndex
Definition: MultiField.h:21
vector< shared_ptr< Discretization > > DiscrList
const StorageSite & getCells() const
Definition: Mesh.h:109
Field plasticMoment
Definition: PlateFields.h:26
Field acceleration
Definition: PlateFields.h:40
PlateModelOptions< T > _options
Field density
Definition: PlateFields.h:31
Field force
Definition: PlateFields.h:39
Field plasticStrain
Definition: PlateFields.h:23
Field deformation
Definition: PlateFields.h:15
Field residualStress
Definition: PlateFields.h:18
int getCount() const
Definition: StorageSite.h:39
CRMatrix< DiagTensorT3, DiagTensorT3, VectorT3 > VVMatrix
MultiField & getB()
Definition: LinearSystem.h:33
string bcType
Definition: PlateBC.h:22
Field volume0
Definition: PlateFields.h:43
MultiField & getX()
Definition: LinearSystem.h:32
Field deformationGradient
Definition: PlateFields.h:27
Field plasticStrainOut
Definition: PlateFields.h:24
Field areaMag
Definition: GeomFields.h:25
const GeomFields & _geomFields
Field deformationN1
Definition: PlateFields.h:32
virtual void linearize(DiscrList &discretizations, const MeshList &meshes, MultiFieldMatrix &matrix, MultiField &x, MultiField &b)
Definition: Linearizer.cpp:17
MultiFieldMatrix & getMatrix()
Definition: LinearSystem.h:37
StorageSite site
Definition: Mesh.h:40
template<class T>
void PlateModel< T >::Impl::postPlateSolve ( LinearSystem ls)
inline

Definition at line 980 of file PlateModel_impl.h.

References Model::_meshes, Mesh::getCells(), StorageSite::getCountLevel1(), and LinearSystem::getDelta().

981  {
982  MultiField& sField = ls.getDelta();
983 
984  const int numMeshes = _meshes.size();
985  for(int n=0;n<numMeshes;n++)
986  {
987  const Mesh& mesh = *_meshes[n];
988 
989  const StorageSite& cells = mesh.getCells();
990 
992  VectorT3Array& w = dynamic_cast<VectorT3Array&>
993  (_plateFields.deformation[cells]);
994  const VectorT3Array& ww = dynamic_cast<const VectorT3Array&>
995  (sField[sIndex]);
996  //const T deformationURF(_options["deformationURF"]);
997 
998  const int nCells = cells.getCountLevel1();
999  for(int c=0;c<nCells;c++)
1000  {
1001  w[c] += ww[c];
1002  }
1003  }
1004  }
PlateFields & _plateFields
Definition: Mesh.h:49
const MeshList _meshes
MultiField & getDelta()
Definition: LinearSystem.h:34
pair< const Field *, const StorageSite * > ArrayIndex
Definition: MultiField.h:21
const StorageSite & getCells() const
Definition: Mesh.h:109
int getCountLevel1() const
Definition: StorageSite.h:72
Field deformation
Definition: PlateFields.h:15
template<class T>
void PlateModel< T >::Impl::printBCs ( )
inline

Definition at line 1032 of file PlateModel_impl.h.

1033  {
1034  foreach(typename PlateBCMap::value_type& pos, _bcMap)
1035  {
1036  cout << "Face Group " << pos.first << ":" << endl;
1037  cout << " bc type " << pos.second->bcType << endl;
1038  foreach(typename PlateBC<T>::value_type& vp, *pos.second)
1039  {
1040  cout << " " << vp.first << " " << vp.second.constant << endl;
1041  }
1042  }
1043  }
template<class T>
void PlateModel< T >::Impl::restart ( )
inline

Definition at line 1161 of file PlateModel_impl.h.

References Model::_persistenceData.

1162  {
1163  if (_persistenceData.find("niters") != _persistenceData.end())
1164  {
1165  shared_ptr<ArrayBase> rp = _persistenceData["niters"];
1166  ArrayBase& r = *rp;
1167  Array<int>& niterArray = dynamic_cast<Array<int>& >(r);
1168  _niters = niterArray[0];
1169  }
1170  if (_persistenceData.find("initialDeformationNorm") != _persistenceData.end())
1171  {
1172  shared_ptr<ArrayBase> r = _persistenceData["initialDeformationNorm"];
1175  }
1176  }
PlateFields & _plateFields
map< string, shared_ptr< ArrayBase > > _persistenceData
MFRPtr _initialDeformationNorm
Field deformation
Definition: PlateFields.h:15
shared_ptr< MultiFieldReduction > MFRPtr
template<class T>
MFRPtr PlateModel< T >::Impl::solveDeformation ( )
inline

Definition at line 842 of file PlateModel_impl.h.

References LinearSystem::initAssembly(), LinearSystem::initSolve(), LinearSystem::postSolve(), and LinearSystem::updateSolution().

843  {
844  LinearSystem ls;
846  ls.initAssembly();
848  ls.initSolve();
849 
850  //AMG solver(ls);
851  MFRPtr rNorm = _options.getDeformationLinearSolver().solve(ls);
853 
854  _options.getDeformationLinearSolver().cleanup();
855  ls.postSolve();
856  ls.updateSolution();
857  //postPlateSolve(ls);
858  if (_options.transient){
861  }
862  return rNorm;
863  }
void initAssembly()
void initDeformationLinearization(LinearSystem &ls)
void linearizeDeformation(LinearSystem &ls)
void updateSolution()
void initSolve()
MFRPtr _initialDeformationNorm
PlateModelOptions< T > _options
void calculatePlateAcceleration()
void calculatePlateVelocity()
shared_ptr< MultiFieldReduction > MFRPtr
template<class T>
void PlateModel< T >::Impl::updateTime ( )
inline

Definition at line 559 of file PlateModel_impl.h.

References Model::_meshes, and Mesh::getCells().

560  {
561  const int numMeshes = _meshes.size();
562  for (int n=0; n<numMeshes; n++)
563  {
564  const Mesh& mesh = *_meshes[n];
565 
566  const StorageSite& cells = mesh.getCells();
567  VectorT3Array& w =
568  dynamic_cast<VectorT3Array&>(_plateFields.deformation[cells]);
569  VectorT3Array& wN1 =
570  dynamic_cast<VectorT3Array&>(_plateFields.deformationN1[cells]);
571  VectorT3Array& wN2 =
572  dynamic_cast<VectorT3Array&>(_plateFields.deformationN2[cells]);
573  if (_options.timeDiscretizationOrder > 1)
574  {
575  VectorT3Array& wN3 =
576  dynamic_cast<VectorT3Array&>(_plateFields.deformationN3[cells]);
577  wN3 = wN2;
578  }
579  wN2 = wN1;
580  wN1 = w;
581  if(_options.variableTimeStep)
582  {
583  if (_options.timeDiscretizationOrder > 1)
584  {
585  _options.timeStepN2 = _options.timeStepN1;
586  }
587  _options.timeStepN1 = _options["timeStep"];
588  }
589  VectorT4Array& pS =
590  dynamic_cast<VectorT4Array&>(_plateFields.plasticStrain[cells]);
591  VectorT4Array& pSN1 =
592  dynamic_cast<VectorT4Array&>(_plateFields.plasticStrainN1[cells]);
593  pSN1 = pS;
594  }
595  }
Field deformationN3
Definition: PlateFields.h:34
PlateFields & _plateFields
Field deformationN2
Definition: PlateFields.h:33
Definition: Mesh.h:49
const MeshList _meshes
Field plasticStrainN1
Definition: PlateFields.h:25
Array< VectorT4 > VectorT4Array
const StorageSite & getCells() const
Definition: Mesh.h:109
PlateModelOptions< T > _options
Field plasticStrain
Definition: PlateFields.h:23
Field deformation
Definition: PlateFields.h:15
Field deformationN1
Definition: PlateFields.h:32

Member Data Documentation

template<class T>
PlateBCMap PlateModel< T >::Impl::_bcMap
private

Definition at line 1281 of file PlateModel_impl.h.

template<class T>
GradientModel<VectorT3> PlateModel< T >::Impl::_deformationGradientModel
private

Definition at line 1285 of file PlateModel_impl.h.

template<class T>
const GeomFields& PlateModel< T >::Impl::_geomFields
private

Definition at line 1278 of file PlateModel_impl.h.

template<class T>
MFRPtr PlateModel< T >::Impl::_initialDeformationNorm
private

Definition at line 1287 of file PlateModel_impl.h.

template<class T>
const MeshList PlateModel< T >::Impl::_meshes
private

Definition at line 1277 of file PlateModel_impl.h.

template<class T>
int PlateModel< T >::Impl::_niters
private

Definition at line 1288 of file PlateModel_impl.h.

template<class T>
PlateModelOptions<T> PlateModel< T >::Impl::_options
private

Definition at line 1284 of file PlateModel_impl.h.

template<class T>
map<string,shared_ptr<ArrayBase> > PlateModel< T >::Impl::_persistenceData
private

Definition at line 1290 of file PlateModel_impl.h.

template<class T>
PlateFields& PlateModel< T >::Impl::_plateFields
private

Definition at line 1279 of file PlateModel_impl.h.

template<class T>
PlateVCMap PlateModel< T >::Impl::_vcMap
private

Definition at line 1282 of file PlateModel_impl.h.


The documentation for this class was generated from the following file: