Memosa-FVM  0.2
PlateBCS< X, Diag, OffDiag > Class Template Reference

#include <PlateModel_impl.h>

Collaboration diagram for PlateBCS< X, Diag, OffDiag >:

Public Types

typedef NumTypeTraits< X >
::T_Scalar 
T_Scalar
 
typedef Array< T_ScalarTArray
 
typedef Vector< T_Scalar, 3 > VectorT3
 
typedef CRMatrix< Diag,
OffDiag, X > 
CCMatrix
 
typedef CCMatrix::PairWiseAssembler CCAssembler
 
typedef FluxJacobianMatrix
< Diag, X > 
FMatrix
 
typedef DiagonalMatrix< Diag, X > BBMatrix
 
typedef Array< Diag > DiagArray
 
typedef Array< OffDiag > OffDiagArray
 
typedef Array< X > XArray
 
typedef Array< VectorT3VectorT3Array
 

Public Member Functions

 PlateBCS (const StorageSite &faces, const Mesh &mesh, const GeomFields &geomFields, Field &varField, MultiFieldMatrix &matrix, MultiField &xField, MultiField &rField)
 
applyDirichletBC (int f, const X &bValue) const
 
applyDirichletBC (const X &bValue) const
 
applyDirichletBC (const FloatValEvaluator< X > &bValue) const
 
applyCantileverBC (const int f, const X &specifiedFlux) const
 
applyNeumannBC (const int f, const X &specifiedFlux) const
 
applyNeumannBC (const X &bFlux) const
 
applyZeroDerivativeBC () const
 
applyNeumannBC (const FloatValEvaluator< X > &bFlux) const
 
void applyInterfaceBC (const int f) const
 
void applyInterfaceBC () const
 
void applySymmetryBC () const
 

Protected Attributes

const StorageSite_faces
 
const StorageSite_cells
 
const CRConnectivity_faceCells
 
const Field_varField
 
const MultiField::ArrayIndex _xIndex
 
CCMatrix_dRdX
 
CCAssembler_assembler
 
DiagArray_dRdXDiag
 
XArray_x
 
XArray_r
 
const Field_areaMagField
 
const TArray_faceAreaMag
 
const Field_areaField
 
const VectorT3Array_faceArea
 
const VectorT3Array_faceCoord
 
const VectorT3Array_cellCoord
 

Detailed Description

template<class X, class Diag, class OffDiag>
class PlateBCS< X, Diag, OffDiag >

Definition at line 38 of file PlateModel_impl.h.

Member Typedef Documentation

template<class X, class Diag, class OffDiag>
typedef DiagonalMatrix<Diag,X> PlateBCS< X, Diag, OffDiag >::BBMatrix

Definition at line 51 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef CCMatrix::PairWiseAssembler PlateBCS< X, Diag, OffDiag >::CCAssembler

Definition at line 48 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef CRMatrix<Diag,OffDiag,X> PlateBCS< X, Diag, OffDiag >::CCMatrix

Definition at line 47 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef Array<Diag> PlateBCS< X, Diag, OffDiag >::DiagArray

Definition at line 53 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef FluxJacobianMatrix<Diag,X> PlateBCS< X, Diag, OffDiag >::FMatrix

Definition at line 50 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef Array<OffDiag> PlateBCS< X, Diag, OffDiag >::OffDiagArray

Definition at line 54 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef NumTypeTraits<X>::T_Scalar PlateBCS< X, Diag, OffDiag >::T_Scalar

Definition at line 42 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef Array<T_Scalar> PlateBCS< X, Diag, OffDiag >::TArray

Definition at line 44 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef Vector<T_Scalar,3> PlateBCS< X, Diag, OffDiag >::VectorT3

Definition at line 45 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef Array<VectorT3> PlateBCS< X, Diag, OffDiag >::VectorT3Array

Definition at line 57 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
typedef Array<X> PlateBCS< X, Diag, OffDiag >::XArray

Definition at line 56 of file PlateModel_impl.h.

Constructor & Destructor Documentation

template<class X, class Diag, class OffDiag>
PlateBCS< X, Diag, OffDiag >::PlateBCS ( const StorageSite faces,
const Mesh mesh,
const GeomFields geomFields,
Field varField,
MultiFieldMatrix matrix,
MultiField xField,
MultiField rField 
)
inline

Definition at line 60 of file PlateModel_impl.h.

65  :
66  _faces(faces),
67  _cells(mesh.getCells()),
69  _varField(varField),
71  _dRdX(dynamic_cast<CCMatrix&>(matrix.getMatrix(_xIndex,_xIndex))),
74  _x(dynamic_cast<XArray&>(xField[_xIndex])),
75  _r(dynamic_cast<XArray&>(rField[_xIndex])),
76  _areaMagField(geomFields.areaMag),
77  _faceAreaMag(dynamic_cast<const TArray&>(_areaMagField[_faces])),
78  _areaField(geomFields.area),
79  _faceArea(dynamic_cast<const VectorT3Array&>(_areaField[_faces])),
80  _faceCoord(dynamic_cast<const VectorT3Array&>(geomFields.coordinate[_faces])),
81  _cellCoord(dynamic_cast<const VectorT3Array&>(geomFields.coordinate[_cells]))
82  {}
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
Field coordinate
Definition: GeomFields.h:19
const StorageSite & _cells
const VectorT3Array & _cellCoord
const VectorT3Array & _faceCoord
XArray & _r
Array< Diag > & getDiag()
Definition: CRMatrix.h:856
const TArray & _faceAreaMag
DiagArray & _dRdXDiag
const Field & _areaField
const VectorT3Array & _faceArea
const MultiField::ArrayIndex _xIndex
XArray & _x
CCMatrix & _dRdX
const CRConnectivity & _faceCells
const StorageSite & getCells() const
Definition: Mesh.h:109
const Field & _varField
const CRConnectivity & getFaceCells(const StorageSite &site) const
Definition: Mesh.cpp:388
Field area
Definition: GeomFields.h:23
CCAssembler & _assembler
PairWiseAssembler & getPairWiseAssembler(const CRConnectivity &pairs)
Definition: CRMatrix.h:867
const StorageSite & _faces
Field areaMag
Definition: GeomFields.h:25
const Field & _areaMagField

Member Function Documentation

template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyCantileverBC ( const int  f,
const X &  specifiedFlux 
) const
inline

Definition at line 115 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_cellCoord, PlateBCS< X, Diag, OffDiag >::_dRdX, PlateBCS< X, Diag, OffDiag >::_faceArea, PlateBCS< X, Diag, OffDiag >::_faceCells, PlateBCS< X, Diag, OffDiag >::_faceCoord, PlateBCS< X, Diag, OffDiag >::_r, and CRMatrix< T_Diag, T_OffDiag, X >::setBoundary().

Referenced by PlateModel< T >::Impl::linearizeDeformation().

117  {
118  //const int c0 = _faceCells(f,0);
119  const int c1 = _faceCells(f,1);
120  const X fluxB = -_r[c1];
121 
122  VectorT3 dzeta1 = _faceCoord[f]-_cellCoord[c1];
123 
124  // the current value of flux and its Jacobians
125  X dFlux;
126  dFlux[0]= (-(specifiedFlux[0]*_faceArea[f][0] +
127  specifiedFlux[1]*_faceArea[f][1])*dzeta1[0])
128  - fluxB[0];
129  dFlux[1]= (-(specifiedFlux[0]*_faceArea[f][0] +
130  specifiedFlux[1]*_faceArea[f][1])*dzeta1[1])
131  - fluxB[1];
132  dFlux[2]= (specifiedFlux[0]*_faceArea[f][0] +
133  specifiedFlux[1]*_faceArea[f][1])
134  - fluxB[2];
135 
136  // setup the equation for the boundary value; the coefficients
137  // are already computed so just need to set the rhs
138  _r[c1] = dFlux;
139 
140  // _dRdX.eliminate(c1,_r);
141  // mark this row as a "boundary" row so that we will update it
142  // after the overall system is solved
143  _dRdX.setBoundary(c1);
144  return fluxB;
145  }
const VectorT3Array & _cellCoord
const VectorT3Array & _faceCoord
XArray & _r
const VectorT3Array & _faceArea
CCMatrix & _dRdX
const CRConnectivity & _faceCells
void setBoundary(const int nr)
Definition: CRMatrix.h:1056
template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyDirichletBC ( int  f,
const X &  bValue 
) const
inline

Definition at line 84 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_dRdX, PlateBCS< X, Diag, OffDiag >::_faceCells, PlateBCS< X, Diag, OffDiag >::_r, PlateBCS< X, Diag, OffDiag >::_x, and CRMatrix< T_Diag, T_OffDiag, X >::eliminateDirichlet().

Referenced by PlateBCS< X, Diag, OffDiag >::applyDirichletBC(), and PlateModel< T >::Impl::linearizeDeformation().

85  {
86  const int c1 = _faceCells(f,1);
87 
88  const X fluxB = -_r[c1];
89 
90  const X dXC1 = bValue - _x[c1];
91 
92  _dRdX.eliminateDirichlet(c1,_r,dXC1);
93  _x[c1] = bValue;
95 
96  return fluxB;
97  }
XArray & _r
XArray & _x
CCMatrix & _dRdX
const CRConnectivity & _faceCells
void eliminateDirichlet(const int j, Array< X > &b, const X &delta_j, const bool explicitMode=false)
Definition: CRMatrix.h:1041
template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyDirichletBC ( const X &  bValue) const
inline

Definition at line 99 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_faces, PlateBCS< X, Diag, OffDiag >::applyDirichletBC(), and StorageSite::getCount().

100  {
101  X fluxB(NumTypeTraits<X>::getZero());
102  for(int i=0; i<_faces.getCount(); i++)
103  fluxB += applyDirichletBC(i,bValue);
104  return fluxB;
105  }
int getCount() const
Definition: StorageSite.h:39
X applyDirichletBC(int f, const X &bValue) const
const StorageSite & _faces
template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyDirichletBC ( const FloatValEvaluator< X > &  bValue) const
inline

Definition at line 107 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_faces, PlateBCS< X, Diag, OffDiag >::applyDirichletBC(), and StorageSite::getCount().

108  {
109  X fluxB(NumTypeTraits<X>::getZero());
110  for(int i=0; i<_faces.getCount(); i++)
111  fluxB += applyDirichletBC(i,bValue[i]);
112  return fluxB;
113  }
int getCount() const
Definition: StorageSite.h:39
X applyDirichletBC(int f, const X &bValue) const
const StorageSite & _faces
template<class X, class Diag, class OffDiag>
void PlateBCS< X, Diag, OffDiag >::applyInterfaceBC ( const int  f) const
inline

Definition at line 210 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_assembler, PlateBCS< X, Diag, OffDiag >::_cells, PlateBCS< X, Diag, OffDiag >::_faceCells, PlateBCS< X, Diag, OffDiag >::_r, CRMatrix< T_Diag, T_OffDiag, X >::PairWiseAssembler::getCoeff01(), CRMatrix< T_Diag, T_OffDiag, X >::PairWiseAssembler::getCoeff10(), and StorageSite::getSelfCount().

211  {
212  // do nothing
213  // the boundary cell could be either c0 or c1 at an interface
214  int cb = _faceCells(f,1);
216  if (cb < _cells.getSelfCount())
217  {
218  cb = _faceCells(f,0);
219  sign *= -1.0;
220  }
221 
222 
223  _r[cb] = T_Scalar(0);
224 
225  if (sign>0)
227  else
229 
230  }
int getSelfCount() const
Definition: StorageSite.h:40
const StorageSite & _cells
XArray & _r
NumTypeTraits< X >::T_Scalar T_Scalar
OffDiag & getCoeff10(const int np)
Definition: CRMatrix.h:131
const CRConnectivity & _faceCells
OffDiag & getCoeff01(const int np)
Definition: CRMatrix.h:126
CCAssembler & _assembler
template<class X, class Diag, class OffDiag>
void PlateBCS< X, Diag, OffDiag >::applyInterfaceBC ( ) const
inline

Definition at line 232 of file PlateModel_impl.h.

233  {
234  // do nothing
235  }
template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyNeumannBC ( const int  f,
const X &  specifiedFlux 
) const
inline

Definition at line 147 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_dRdX, PlateBCS< X, Diag, OffDiag >::_faceAreaMag, PlateBCS< X, Diag, OffDiag >::_faceCells, PlateBCS< X, Diag, OffDiag >::_r, and CRMatrix< T_Diag, T_OffDiag, X >::setBoundary().

Referenced by PlateBCS< X, Diag, OffDiag >::applyNeumannBC(), and PlateModel< T >::Impl::linearizeDeformation().

149  {
150  //const int c0 = _faceCells(f,0);
151  const int c1 = _faceCells(f,1);
152  const X fluxB = -_r[c1];
153 
154  // the current value of flux and its Jacobians
155  const X dFlux = specifiedFlux*_faceAreaMag[f] - fluxB;
156 
157  // setup the equation for the boundary value; the coefficients
158  // are already computed so just need to set the rhs
159  _r[c1] = dFlux;
160 
161  // _dRdX.eliminate(c1,_r);
162  // mark this row as a "boundary" row so that we will update it
163  // after the overall system is solved
164  _dRdX.setBoundary(c1);
165  return fluxB;
166  }
XArray & _r
const TArray & _faceAreaMag
CCMatrix & _dRdX
const CRConnectivity & _faceCells
void setBoundary(const int nr)
Definition: CRMatrix.h:1056
template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyNeumannBC ( const X &  bFlux) const
inline

Definition at line 169 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_faces, PlateBCS< X, Diag, OffDiag >::applyNeumannBC(), and StorageSite::getCount().

170  {
171  X fluxB(NumTypeTraits<X>::getZero());
172 
173  for(int i=0; i<_faces.getCount(); i++)
174  fluxB += applyNeumannBC(i,bFlux);
175  return fluxB;
176  }
X applyNeumannBC(const int f, const X &specifiedFlux) const
int getCount() const
Definition: StorageSite.h:39
const StorageSite & _faces
template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyNeumannBC ( const FloatValEvaluator< X > &  bFlux) const
inline

Definition at line 202 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_faces, PlateBCS< X, Diag, OffDiag >::applyNeumannBC(), and StorageSite::getCount().

203  {
204  X fluxB(NumTypeTraits<X>::getZero());
205  for(int i=0; i<_faces.getCount(); i++)
206  fluxB += applyNeumannBC(i,bFlux[i]);
207  return fluxB;
208  }
X applyNeumannBC(const int f, const X &specifiedFlux) const
int getCount() const
Definition: StorageSite.h:39
const StorageSite & _faces
template<class X, class Diag, class OffDiag>
void PlateBCS< X, Diag, OffDiag >::applySymmetryBC ( ) const
inline

Definition at line 237 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_assembler, PlateBCS< X, Diag, OffDiag >::_dRdX, PlateBCS< X, Diag, OffDiag >::_faceArea, PlateBCS< X, Diag, OffDiag >::_faceAreaMag, PlateBCS< X, Diag, OffDiag >::_faceCells, PlateBCS< X, Diag, OffDiag >::_faces, PlateBCS< X, Diag, OffDiag >::_r, PlateBCS< X, Diag, OffDiag >::_x, dot(), CRMatrix< T_Diag, T_OffDiag, X >::PairWiseAssembler::getCoeff10(), StorageSite::getCount(), and CRMatrix< T_Diag, T_OffDiag, X >::setDirichlet().

238  {
239  for(int f=0; f<this->_faces.getCount(); f++)
240  {
241  const int c0 = this->_faceCells(f,0);
242  const int c1 = this->_faceCells(f,1);
243 
244 
245  const VectorT3 en = this->_faceArea[f]/this->_faceAreaMag[f];
246  const T_Scalar xC0_dotn = dot(this->_x[c0],en);
247  const X xB = this->_x[c0] - 2.*xC0_dotn * en;
248 
249  Diag dxBdxC0(Diag::getZero());
250  dxBdxC0(0,0) = 1.0 - 2.*en[0]*en[0];
251  dxBdxC0(0,1) = - 2.*en[0]*en[1];
252  dxBdxC0(0,2) = - 2.*en[0]*en[2];
253 
254  dxBdxC0(1,0) = - 2.*en[1]*en[0];
255  dxBdxC0(1,1) = 1.0 - 2.*en[1]*en[1];
256  dxBdxC0(1,2) = - 2.*en[1]*en[2];
257 
258  dxBdxC0(2,0) = - 2.*en[2]*en[0];
259  dxBdxC0(2,1) = - 2.*en[2]*en[1];
260  dxBdxC0(2,2) = 1.0 - 2.*en[2]*en[2];
261 
262 
263  const X xc1mxB = xB-this->_x[c1];
264 
265  // boundary value equation
266  // set all neighbour coeffs to zero first and ap to -1
267  this->_dRdX.setDirichlet(c1);
268 
269  // dependance on c0
270  this->_assembler.getCoeff10(f) = dxBdxC0;
271  this->_r[c1] = xc1mxB;
272 
273  }
274  }
XArray & _r
NumTypeTraits< X >::T_Scalar T_Scalar
OffDiag & getCoeff10(const int np)
Definition: CRMatrix.h:131
const TArray & _faceAreaMag
const VectorT3Array & _faceArea
XArray & _x
CCMatrix & _dRdX
const CRConnectivity & _faceCells
int getCount() const
Definition: StorageSite.h:39
void setDirichlet(const int nr)
Definition: CRMatrix.h:887
CCAssembler & _assembler
const StorageSite & _faces
T dot(const Vector< T, 3 > &a, const Vector< T, 3 > &b)
Definition: Vector.h:253
template<class X, class Diag, class OffDiag>
X PlateBCS< X, Diag, OffDiag >::applyZeroDerivativeBC ( ) const
inline

Definition at line 178 of file PlateModel_impl.h.

References PlateBCS< X, Diag, OffDiag >::_assembler, PlateBCS< X, Diag, OffDiag >::_dRdX, PlateBCS< X, Diag, OffDiag >::_dRdXDiag, PlateBCS< X, Diag, OffDiag >::_faceCells, PlateBCS< X, Diag, OffDiag >::_faces, PlateBCS< X, Diag, OffDiag >::_r, PlateBCS< X, Diag, OffDiag >::_x, CRMatrix< T_Diag, T_OffDiag, X >::PairWiseAssembler::getCoeff10(), StorageSite::getCount(), and CRMatrix< T_Diag, T_OffDiag, X >::setBoundary().

179  {
180  X fluxTotal(NumTypeTraits<X>::getZero());
181  for(int f=0; f<_faces.getCount(); f++)
182  {
183  const int c0 = _faceCells(f,0);
184  const int c1 = _faceCells(f,1);
185  const X fluxB = -_r[c1];
186 
187  // setup the equation for the boundary value; we want xb to be equal to xc
188 
189  _r[c1] = _x[c0] - _x[c1];
192 
193 
194  // mark this row as a "boundary" row so that we will update it
195  // after the overall system is solved
196  _dRdX.setBoundary(c1);
197  fluxTotal += fluxB;
198  }
199  return fluxTotal;
200  }
XArray & _r
OffDiag & getCoeff10(const int np)
Definition: CRMatrix.h:131
DiagArray & _dRdXDiag
XArray & _x
CCMatrix & _dRdX
const CRConnectivity & _faceCells
void setBoundary(const int nr)
Definition: CRMatrix.h:1056
int getCount() const
Definition: StorageSite.h:39
CCAssembler & _assembler
const StorageSite & _faces

Member Data Documentation

template<class X, class Diag, class OffDiag>
const Field& PlateBCS< X, Diag, OffDiag >::_areaField
protected

Definition at line 291 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
const Field& PlateBCS< X, Diag, OffDiag >::_areaMagField
protected

Definition at line 289 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
CCAssembler& PlateBCS< X, Diag, OffDiag >::_assembler
protected
template<class X, class Diag, class OffDiag>
const VectorT3Array& PlateBCS< X, Diag, OffDiag >::_cellCoord
protected

Definition at line 294 of file PlateModel_impl.h.

Referenced by PlateBCS< X, Diag, OffDiag >::applyCantileverBC().

template<class X, class Diag, class OffDiag>
const StorageSite& PlateBCS< X, Diag, OffDiag >::_cells
protected

Definition at line 280 of file PlateModel_impl.h.

Referenced by PlateBCS< X, Diag, OffDiag >::applyInterfaceBC().

template<class X, class Diag, class OffDiag>
DiagArray& PlateBCS< X, Diag, OffDiag >::_dRdXDiag
protected
template<class X, class Diag, class OffDiag>
const VectorT3Array& PlateBCS< X, Diag, OffDiag >::_faceArea
protected
template<class X, class Diag, class OffDiag>
const TArray& PlateBCS< X, Diag, OffDiag >::_faceAreaMag
protected
template<class X, class Diag, class OffDiag>
const VectorT3Array& PlateBCS< X, Diag, OffDiag >::_faceCoord
protected

Definition at line 293 of file PlateModel_impl.h.

Referenced by PlateBCS< X, Diag, OffDiag >::applyCantileverBC().

template<class X, class Diag, class OffDiag>
const Field& PlateBCS< X, Diag, OffDiag >::_varField
protected

Definition at line 282 of file PlateModel_impl.h.

template<class X, class Diag, class OffDiag>
XArray& PlateBCS< X, Diag, OffDiag >::_x
protected
template<class X, class Diag, class OffDiag>
const MultiField::ArrayIndex PlateBCS< X, Diag, OffDiag >::_xIndex
protected

Definition at line 283 of file PlateModel_impl.h.


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