25 class gsVisitorElasticityNeumann
29 gsVisitorElasticityNeumann(
const gsPde<T> & pde_,
30 const boundary_condition<T> & s)
31 : neumannFunction_ptr(s.function().get()),
32 patchSide(s.side()) {}
34 void initialize(
const gsBasisRefs<T> & basisRefs,
36 const gsOptionList & options,
40 dim = basisRefs.front().dim();
44 forceScaling = options.getReal(
"ForceScaling");
46 globalIndices.resize(dim);
47 blockNumbers.resize(dim);
50 inline void evaluate(
const gsBasisRefs<T> & basisRefs,
51 const gsGeometry<T> & geo,
52 const gsMatrix<T> & quNodes)
62 neumannFunction_ptr->eval_into(md.values[0], neumannValues);
64 basisRefs.front().active_into(quNodes.col(0),localIndicesDisp);
65 N_D = localIndicesDisp.rows();
67 basisRefs.front().eval_into(quNodes,basisValuesDisp);
70 inline void assemble(gsDomainIterator<T> & element,
71 const gsVector<T> & quWeights)
74 localRhs.setZero(dim*N_D,1);
76 for (
index_t q = 0; q < quWeights.rows(); ++q)
80 outerNormal(md, q, patchSide, unormal);
82 const T weight = quWeights[q] * unormal.norm() * forceScaling;
84 for (
short_t d = 0; d < dim; ++d)
85 localRhs.middleRows(d*N_D,N_D).noalias() += weight * neumannValues(d,q) * basisValuesDisp.col(q);
89 inline void localToGlobal(
const int patchIndex,
90 const std::vector<gsMatrix<T> > & eliminatedDofs,
91 gsSparseSystem<T> & system)
94 for (
short_t d = 0; d < dim; ++d)
96 system.mapColIndices(localIndicesDisp, patchIndex, globalIndices[d], d);
97 blockNumbers.at(d) = d;
100 system.pushToRhs(localRhs,globalIndices,blockNumbers);
106 const gsFunctionSet<T> * neumannFunction_ptr;
112 gsMatrix<T> localRhs;
114 gsMatrix<index_t> localIndicesDisp;
118 gsMatrix<T> basisValuesDisp;
120 gsMatrix<T> neumannValues;
125 std::vector< gsMatrix<index_t> > globalIndices;
126 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
This object is a cache for computed values from an evaluator.