28 gsVisitorThermo(
const gsFunctionSet<T> & temperatureField_)
29 : dim(0), lambda(0), mu(0), thermalExpCoef(0), N_D(0), patch(0),
30 temperatureField(temperatureField_), paramTemp(0) {}
32 void initialize(
const gsBasisRefs<T> & basisRefs,
34 const gsOptionList & options,
38 dim = basisRefs.front().dim();
43 paramTemp = options.getSwitch(
"ParamTemp");
44 thermalExpCoef = options.getReal(
"ThExpCoef");
45 T E = options.getReal(
"YoungsModulus");
46 T pr = options.getReal(
"PoissonsRatio");
47 lambda = E * pr / ( ( 1. + pr ) * ( 1. - 2. * pr ) );
48 mu = E / ( 2. * ( 1. + pr ) );
50 globalIndices.resize(dim);
51 blockNumbers.resize(dim);
54 inline void evaluate(
const gsBasisRefs<T> & basisRefs,
55 const gsGeometry<T> & geo,
56 const gsMatrix<T> & quNodes)
71 temperatureField.piece(patch).deriv_into(quNodes,tempGrads);
73 temperatureField.piece(patch).deriv_into(md.values[0],tempGrads);
75 basisRefs.front().active_into(quNodes.col(0),localIndicesDisp);
76 N_D = localIndicesDisp.rows();
78 basisRefs.front().eval_into(quNodes,basisValuesDisp);
81 inline void assemble(gsDomainIterator<T> & element,
82 const gsVector<T> & quWeights)
85 localRhs.setZero(dim*N_D, 1);
87 for (
index_t q = 0; q < quWeights.rows(); ++q)
90 const T weight = thermalExpCoef*(2*mu+dim*lambda)*quWeights[q]*md.measure(q);
95 transformGradients(md,q,tempGrads,physGrad);
96 for (
index_t d = 0; d < dim; ++d)
97 localRhs.middleRows(d*N_D,N_D).noalias() -= weight * physGrad(d,0) * basisValuesDisp.col(q);
100 for (
index_t d = 0; d < dim; ++d)
101 localRhs.middleRows(d*N_D,N_D).noalias() -= weight * tempGrads(d,q) * basisValuesDisp.col(q);
105 inline void localToGlobal(
const int patchIndex,
106 const std::vector<gsMatrix<T> > & eliminatedDofs,
107 gsSparseSystem<T> & system)
110 for (
short_t d = 0; d < dim; ++d)
112 system.mapColIndices(localIndicesDisp, patchIndex, globalIndices[d], d);
113 blockNumbers.at(d) = d;
116 system.pushToRhs(localRhs,globalIndices,blockNumbers);
123 T lambda, mu, thermalExpCoef;
127 gsMatrix<T> localRhs;
129 gsMatrix<index_t> localIndicesDisp;
133 gsMatrix<T> basisValuesDisp;
136 const gsFunctionSet<T> & temperatureField;
141 gsMatrix<T> tempGrads;
144 gsMatrix<T> physGrad;
146 std::vector< gsMatrix<index_t> > globalIndices;
147 gsVector<index_t> blockNumbers;
#define short_t
Definition: gsConfig.h:35
#define index_t
Definition: gsConfig.h:32
static gsQuadRule< T > get(const gsBasis< T > &basis, const gsOptionList &options, short_t fixDir=-1)
Constructs a quadrature rule based on input options.
Definition: gsQuadrature.h:48
Creates a variety of quadrature rules.
The density of the measure pull back.
Definition: gsForwardDeclarations.h:76
Value of the object.
Definition: gsForwardDeclarations.h:72
Gradient transformation matrix.
Definition: gsForwardDeclarations.h:77
This object is a cache for computed values from an evaluator.