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)
86 localRhs.setZero(dim*N_D, 1);
88 for (
index_t q = 0; q < quWeights.rows(); ++q)
91 const T weight = thermalExpCoef*(2*mu+dim*lambda)*quWeights[q]*md.measure(q);
96 transformGradients(md,q,tempGrads,physGrad);
97 for (
index_t d = 0; d < dim; ++d)
98 localRhs.middleRows(d*N_D,N_D).noalias() -= weight * physGrad(d,0) * basisValuesDisp.col(q);
101 for (
index_t d = 0; d < dim; ++d)
102 localRhs.middleRows(d*N_D,N_D).noalias() -= weight * tempGrads(d,q) * basisValuesDisp.col(q);
106 inline void localToGlobal(
const int patchIndex,
107 const std::vector<gsMatrix<T> > & eliminatedDofs,
108 gsSparseSystem<T> & system)
112 for (
short_t d = 0; d < dim; ++d)
114 system.mapColIndices(localIndicesDisp, patchIndex, globalIndices[d], d);
115 blockNumbers.at(d) = d;
118 system.pushToRhs(localRhs,globalIndices,blockNumbers);
125 T lambda, mu, thermalExpCoef;
129 gsMatrix<T> localRhs;
131 gsMatrix<index_t> localIndicesDisp;
135 gsMatrix<T> basisValuesDisp;
138 const gsFunctionSet<T> & temperatureField;
143 gsMatrix<T> tempGrads;
146 gsMatrix<T> physGrad;
148 std::vector< gsMatrix<index_t> > globalIndices;
149 gsVector<index_t> blockNumbers;
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
This object is a cache for computed values from an evaluator.
Creates a variety of quadrature rules.
The G+Smo namespace, containing all definitions for the library.
@ NEED_VALUE
Value of the object.
Definition gsForwardDeclarations.h:72
@ NEED_GRAD_TRANSFORM
Gradient transformation matrix.
Definition gsForwardDeclarations.h:77
@ NEED_MEASURE
The density of the measure pull back.
Definition gsForwardDeclarations.h:76
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:51