5 #ifndef _PLATEDEFORMATIONMODEL_H_
6 #define _PLATEDEFORMATIONMODEL_H_
44 const int numMeshes =
_meshes.size();
45 for (
int m=0;m<numMeshes;m++)
52 shared_ptr<CRConnectivity> nodeCellsPtr = cellNodes.
getTranspose();
67 for(
int j=0;j<nNodes;j++)
71 for(
int k=0;k<nodeCells.
getCount(j);k++)
73 const int num = nodeCells(j,k);
74 const VectorT3 ds = cellCentroid[num]-nodeCoordinate[j];
75 dr += cellDisplacement[num]/
mag(ds);
76 weight += one/
mag(ds);
81 nodeDisplacement[j][0] = zero;
82 nodeDisplacement[j][1] = zero;
83 nodeDisplacement[j][2] = dr[2];
90 const int numMeshes =
_meshes.size();
91 for (
int n=0;n<numMeshes;n++)
105 nodeCoordK1 = nodeCoord;
106 for (
int i=0;i<nNodes;i++)
108 nodeCoord[i] = nodeCoord0[i] + nodeDisplacement[i];
117 const int numMeshes =
_meshes.size();
118 for (
int n=0;n<numMeshes;n++)
122 const int nNodes = nodes.
getCount();
133 nodeCoordK1 = nodeCoord;
134 for (
int i=0;i<nNodes;i++)
136 if(displacementOptions[i] == 3)
138 nodeCoord[i] = nodeCoord0[i] + nodeDisplacement[i];
149 const int nBNodes = bMeshNodes.
getCount();
162 for(
int n=0; n<nBNodes/2; n++)
164 bNodeCoord[n][2] = -thickness/2 + nodeCoord[n][2];
165 bMeshCoord[n][2] = -thickness/2 + nodeCoord[n][2];
168 for(
int n=nBNodes/2; n<nBNodes; n++)
170 bNodeCoord[n][2] = thickness/2 + nodeCoord[n-nBNodes/2][2];
171 bMeshCoord[n][2] = thickness/2 + nodeCoord[n-nBNodes/2][2];
177 const double thickness,
178 const double timeStep,
179 Field& velocityField)
187 shared_ptr<VectorT3Array>
190 velocityField.
addArray(bMeshFaces,bVelocity);
199 const int nCells = cells.
getCount();
201 for (
int c=0; c<nLocalCells; c++){
203 const int nCellNodes = cellNodes.
getCount(c);
205 for (
int n=0; n<nCellNodes; n++){
206 const int node = cellNodes(c, n);
207 VectorT3 vn = (w[node]-wN1[node])/timeStep;
212 (*bVelocity)[c] = vf;
213 (*bVelocity)[c+nLocalCells] = vf;
216 for (
int c=nLocalCells; c<nCells; c++){
218 const int nCellNodes = cellNodes.
getCount(c);
220 for (
int n=0; n<nCellNodes; n++){
221 const int node = cellNodes(c, n);
222 VectorT3 vn = (w[node]-wN1[node])/timeStep;
227 (*bVelocity)[c+nLocalCells] = vf;
238 cout<<
"\n The size of commonMap is "<<commonMap.size()<<
"\n";
242 return myNodeIndices;
247 const int numMeshes =
_meshes.size();
248 for (
int n=0;n<numMeshes;n++)
255 dynamic_pointer_cast<ArrayBase>(nodeCoord.
newCopy()));
258 dynamic_pointer_cast<ArrayBase>(nodeCoord.
newCopy()));
260 shared_ptr<VectorT3Array>
262 nodeDisplacement->zero();
265 shared_ptr<VectorT3Array>
267 nodeDisplacementN1->zero();
276 const int numMeshes =
_meshes.size();
277 for (
int n=0; n<numMeshes; n++)
int getCount(const int i) const
Field displacementOptions
const StorageSite & getNodes() const
const CommonMap & getCommonMap() const
T mag(const Vector< T, 3 > &a)
const Array< VecD3 > & getNodeCoordinates() const
map< const StorageSite *, shared_ptr< Array< int > > > CommonMap
const StorageSite & getFaces() const
const StorageSite & getCells() const
void addArray(const StorageSite &, shared_ptr< ArrayBase > a)
shared_ptr< CRConnectivity > getTranspose() const
virtual shared_ptr< IContainer > newCopy() const
const CRConnectivity & getCellNodes() const
vector< Mesh * > MeshList