ThermoFemPhysics
The GeMA Thermo FEM Physics Plugin
Loading...
Searching...
No Matches
gmpThermoInterfaceFlow.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PLUGIN_THERMO_INTERFACEFLOW_H_
25#define _GEMA_PLUGIN_THERMO_INTERFACEFLOW_H_
26
27#include "gmpThermoInterface.h"
28#include <gmTrace.h>
29#include <math.h>
30
31
33template <class T> class GmpThermoInterfaceFlow : public T
34{
35public:
36 GmpThermoInterfaceFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
37 const GmLogCategory& logger)
38 : T(pluginType, simulation, id, description, logger)
39 {}
40
41protected:
43 virtual double axisymmetricFactor(const GmElement* e, const GmMatrix& X, const GmVector& N) const { Q_UNUSED(e); Q_UNUSED(X); Q_UNUSED(N); return 1.0; }
44
45 // Comments on the base class
46 virtual double fillBtMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bt)
47 {
48 S_TRACE();
49 Q_UNUSED(X); Q_UNUSED(N);
50 return shape->shapeCartesianPartialsFromJacobian(ncoord, J, Bt, true);
51 }
52};
53
55
56template <class T> class GmpThermoInterfaceAxFlow : public T
57{
58public:
59 GmpThermoInterfaceAxFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
60 const GmLogCategory& logger)
61 : T(pluginType, simulation, id, description, logger)
62 {}
63
64protected:
66 virtual bool isAxisymmetric() { return true; }
67
68 // Comments on the base class
69 virtual double axisymmetricFactor(const GmElement* e, const GmMatrix& MX, const GmVector& N) const
70 {
71 S_TRACE();
72 assert(e);
73 // number of nodes
74 int n = e->numNodes();
75 int d = GmpFemPhysicsCommon::nodeDim();
76 // number of nodes for tri-nodded interface elements
77 if (e->type() == GM_INT2DL6)
78 {
79 n = n - pow(2, d - 1);
80 }
81 assert(MX.n_rows == n / 2 && MX.n_cols == d);
82
83 double rGauss = 0.0;
84 for (int j = 0; j < n / 2; ++j)
85 rGauss += N(j)*MX(j, 0);
86
87 return 2 * arma::datum::pi * rGauss;
88 }
89
90 // Comments on the base class
91 virtual double fillBtMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bt)
92 {
93 S_TRACE();
94
95 //int n = Bp.n_cols;
96 //double rGauss = 0.0;
97 //for(int j = 0; j < n; ++j)
98 // rGauss += N(j)*X(0, j);
99
100 double detJ = shape->shapeCartesianPartialsFromJacobian(ncoord, J, Bt, true);
101
102 //for(int k = 0; k < n; ++k)
103 // Bp(0, k) = Bp(0, k)/rGauss;
104
105 return detJ;
106 }
107
108};
109
110#endif
virtual int numNodes() const=0
virtual GmCellType type() const=0
virtual double shapeCartesianPartialsFromJacobian(const GmVector &ncoord, const GmMatrix &J, GmMatrix &dN, bool transposed=false) const
Thermal axisymmetric interface.
Definition gmpThermoInterfaceFlow.h:57
virtual bool isAxisymmetric()
Returns TRUE only for axisymmetric models.
Definition gmpThermoInterfaceFlow.h:66
Thermal zero-thickness interface 2D & 3D for Int2dl4, Int2dl6, and Int3dl8.
Definition gmpThermoInterfaceFlow.h:34
virtual double axisymmetricFactor(const GmElement *e, const GmMatrix &X, const GmVector &N) const
Returns the factor that should be applied when using axis symetric elements. 1.0 for other etypes.
Definition gmpThermoInterfaceFlow.h:43
arma::mat GmMatrix
#define S_TRACE()
arma::vec GmVector
Declaration of the GmpThermoInterface classes.