Memosa-FVM  0.2
Vector.h File Reference
#include "NumType.h"
#include <sstream>
Include dependency graph for Vector.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Vector< T, N >
 
struct  ArrayScalarTraits< Vector< T, N > >
 

Functions

string intAsString (const int i)
 
template<class T , int N>
ostream & operator<< (ostream &os, const Vector< T, N > &v)
 
template<class T >
Vector< T, 3 > cross (const Vector< T, 3 > &a, const Vector< T, 3 > &b)
 
template<class T >
dot (const Vector< T, 3 > &a, const Vector< T, 3 > &b)
 
template<class T >
mag (const Vector< T, 3 > &a)
 
template<class T >
mag2 (const Vector< T, 3 > &a)
 
template<class T , int N>
Vector< T, N > operator+ (const Vector< T, N > &a, const Vector< T, N > &b)
 
template<class T , int N>
Vector< T, N > operator- (const Vector< T, N > &a, const Vector< T, N > &b)
 
template<class T , int N>
Vector< T, N > operator- (const Vector< T, N > &a)
 
template<class T , int N>
Vector< T, N > operator* (const T s, const Vector< T, N > &a)
 
template<class T , int N>
Vector< T, N > operator* (const Vector< T, N > &a, const T s)
 
template<class T , int N>
Vector< T, N > operator* (const Vector< T, N > &a, const Vector< T, N > &b)
 
template<class T , int N>
Vector< T, N > operator/ (const Vector< T, N > &a, const T s)
 
template<class T , int N>
Vector< T, N > operator/ (const Vector< T, N > &a, const Vector< T, N > &b)
 

Function Documentation

template<class T >
Vector<T,3> cross ( const Vector< T, 3 > &  a,
const Vector< T, 3 > &  b 
)

Definition at line 242 of file Vector.h.

Referenced by MeshMetricsCalculator< T >::calculateFaceAreas(), MeshMetricsCalculator< T >::calculateFaceCentroids(), Mesh::COMETfindCommonFaces(), Mesh::findCommonFaces(), and MovingMeshModel< T >::volChange().

243 {
244  Vector<T,3> c;
245  c[0] = a[1]*b[2]-a[2]*b[1];
246  c[1] = a[2]*b[0]-a[0]*b[2];
247  c[2] = a[0]*b[1]-a[1]*b[0];
248  return c;
249 }
template<class T >
T dot ( const Vector< T, 3 > &  a,
const Vector< T, 3 > &  b 
)

Definition at line 253 of file Vector.h.

Referenced by MovingMeshModel< T >::advance(), StructureBCS< X, Diag, OffDiag >::applySymmetryBC(), PlateBCS< X, Diag, OffDiag >::applySymmetryBC(), GenericBCS< Vector< T, N >, DiagonalTensor< T, N >, T >::applySymmetryBC(), GenericBCS< Vector< T, N >, DiagonalTensor< T, N >, DiagonalTensor< T, N > >::applySymmetryBC(), GenericBCS< Vector< T, N >, SquareTensor< T, N >, SquareTensor< T, N > >::applySymmetryBC(), MeshMetricsCalculator< T >::calculateCellCentroids(), MeshMetricsCalculator< T >::calculateCellVolumes(), MeshMetricsCalculator< T >::calculateFaceCentroids(), MeshMetricsCalculator< T >::computeGridInterpolationMatrices(), MeshMetricsCalculator< T >::computeIBInterpolationMatrices(), MeshMetricsCalculator< T >::computeIBInterpolationMatricesCells(), MeshMetricsCalculator< T >::computeSolidInterpolationMatrices(), ElectricModel< T >::Impl::computeSolidSurfaceForce(), correctVelocityInterior(), BatteryElectricDiffusionDiscretization< X, Diag, OffDiag >::discretize(), ElecDiffusionDiscretization< X, Diag, OffDiag >::discretize(), BatteryPCBinaryElectrolyteDiscretization< X, Diag, OffDiag >::discretize(), BatteryBinaryElectrolyteDiscretization< X, Diag, OffDiag >::discretize(), DiffusionDiscretization< X, Diag, OffDiag >::discretize(), BatteryPCDiffusionDiscretization< X, Diag, OffDiag >::discretize(), WallDiscretization< X, Diag, OffDiag >::discretize(), StructureSourceDiscretization< T, Diag, OffDiag >::discretizeFaces(), StructurePlasticDiscretization< T, Diag, OffDiag >::discretizeFaces(), PlateSourceDiscretization< T, Diag, OffDiag >::discretizeFaces(), discretizeMassFluxInterior(), distanceFromPointToLine(), Grid::findNeighborsByCells(), fixedFluxContinuityBC(), fixedPressureContinuityBC(), inCell(), FlowModel< T >::Impl::linearizeContinuity(), mag(), mag2(), VectorTranspose< X, K >::operator*=(), TractionValEvaluator< T >::operator[](), projectionFromPointToLine(), slipJumpMomentumBC(), ElectricModel< T >::Impl::updateConvectionFlux(), updateFacePressureInterior(), FlowModel< T >::Impl::updateFacePressureInterior(), and MovingMeshModel< T >::volChange().

254 {
255  return a[0]*b[0]+a[1]*b[1]+a[2]*b[2];
256 }
string intAsString ( const int  i)
inline
template<class T , int N>
Vector<T,N> operator* ( const T  s,
const Vector< T, N > &  a 
)

Definition at line 295 of file Vector.h.

296 {
297  return Vector<T,N>(a) *= s;
298 }
Definition: Vector.h:19
template<class T , int N>
Vector<T,N> operator* ( const Vector< T, N > &  a,
const T  s 
)

Definition at line 302 of file Vector.h.

303 {
304  return Vector<T,N>(a) *= s;
305 }
Definition: Vector.h:19
template<class T , int N>
Vector<T,N> operator* ( const Vector< T, N > &  a,
const Vector< T, N > &  b 
)

Definition at line 310 of file Vector.h.

311 {
312  return Vector<T,N>(a) *= b;
313 }
Definition: Vector.h:19
template<class T , int N>
Vector<T,N> operator+ ( const Vector< T, N > &  a,
const Vector< T, N > &  b 
)

Definition at line 274 of file Vector.h.

275 {
276  return Vector<T,N>(a) += b;
277 }
Definition: Vector.h:19
template<class T , int N>
Vector<T,N> operator- ( const Vector< T, N > &  a,
const Vector< T, N > &  b 
)

Definition at line 281 of file Vector.h.

282 {
283  return Vector<T,N>(a) -= b;
284 }
Definition: Vector.h:19
template<class T , int N>
Vector<T,N> operator- ( const Vector< T, N > &  a)

Definition at line 288 of file Vector.h.

289 {
290  return -Vector<T,N>(a);
291 }
Definition: Vector.h:19
template<class T , int N>
Vector<T,N> operator/ ( const Vector< T, N > &  a,
const T  s 
)

Definition at line 317 of file Vector.h.

318 {
319  return Vector<T,N>(a) /= s;
320 }
Definition: Vector.h:19
template<class T , int N>
Vector<T,N> operator/ ( const Vector< T, N > &  a,
const Vector< T, N > &  b 
)

Definition at line 325 of file Vector.h.

326 {
327  return Vector<T,N>(a) /= b;
328 }
Definition: Vector.h:19
template<class T , int N>
ostream& operator<< ( ostream &  os,
const Vector< T, N > &  v 
)
inline

Definition at line 233 of file Vector.h.

References Vector< T, N >::printFromC().

235 {
236  v.printFromC(os);
237  return os;
238 }
void printFromC(ostream &os) const
Definition: Vector.h:63