Debian Codegraph @

tools/physicalModeling/mesh2faust/vega/libraries/stvk/StVKTetHighMemoryABCD.h

raw symbols SCIP
1 /*************************************************************************
2 * *
3 * Vega FEM Simulation Library Version 3.1 *
4 * *
5 * "StVK" library , Copyright (C) 2007 CMU, 2009 MIT, 2016 USC *
6 * All rights reserved. *
7 * *
8 * Code author: Jernej Barbic *
9 * http://www.jernejbarbic.com/code *
10 * *
11 * Research: Jernej Barbic, Fun Shing Sin, Daniel Schroeder, *
12 * Doug L. James, Jovan Popovic *
13 * *
14 * Funding: National Science Foundation, Link Foundation, *
15 * Singapore-MIT GAMBIT Game Lab, *
16 * Zumberge Research and Innovation Fund at USC *
17 * *
18 * This library is free software; you can redistribute it and/or *
19 * modify it under the terms of the BSD-style license that is *
20 * included with this library in the file LICENSE.txt *
21 * *
22 * This library is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file *
25 * LICENSE.TXT for more details. *
26 * *
27 *************************************************************************/
28
29 #ifndef _STVKTETHIGHMEMORYABCD_H_
30 #define _STVKTETHIGHMEMORYABCD_H_
31
32 #include "StVKElementABCD.h"
33 #include "tetMesh.h"
34
35 /*
36 Class "StVKTetHighMemoryABCD" stores (explicitly) the St.Venant-Kirchhoff
37 A,B,C,D coefficients for a tetrahedron (high-memory version).
38 It enables fast coefficient access, but requires more memory than
39 the "StVKTetABCD" class. The class "StVKTetHighMemoryABCD" is practical
40 up to a few thousand tetrahedra, depending on the size of your memory.
41 In our simulations, we usually used "StVKTetABCD" for all the tet meshes.
42 */
43
44 class StVKTetHighMemoryABCD : public StVKElementABCD
45 {
46 public:
47
48 // computes the ABCD coefficients
49 StVKTetHighMemoryABCD(TetMesh * tetMesh);
50
51 inline virtual Mat3d A(void * elementIterator, int i, int j) { return A_[*(int*)elementIterator][i][j]; }
52 inline virtual double B(void * elementIterator, int i, int j) { return B_[*(int*)elementIterator][i][j]; }
53 inline virtual Vec3d C(void * elementIterator, int i, int j, int k) { return C_[*(int*)elementIterator][i][j][k]; }
54 inline virtual double D(void * elementIterator, int i, int j, int k, int l) { return D_[*(int*)elementIterator][i][j][k][l]; }
55
56 virtual ~StVKTetHighMemoryABCD();
57
58 protected:
59 Mat3d (*A_) [4][4];
60 double (*B_) [4][4];
61 Vec3d (*C_) [4][4][4];
62 double (*D_) [4][4][4][4];
63
64 void StVKSingleTetABCD(Vec3d vertices[4], Mat3d A[4][4], double B[4][4], Vec3d C[4][4][4], double D[4][4][4][4]);
65 };
66
67 #endif
68