44 : dirdata_ptr(&dirdata), m_penalty(penalty), side(s)
53 for (
int i = 0; i < basis.dim(); ++i)
54 numQuadNodes[i] = basis.
degree(i) + 1;
55 numQuadNodes[dir] = 1;
74 const index_t numActive = actives.rows();
83 dirdata_ptr->eval_into(md.values[0], dirData);
86 localMat.setZero(numActive, numActive);
87 localRhs.setZero(numActive, dirdata_ptr->targetDim());
94 const unsigned d = element.
dim();
96 const index_t numActive = actives.rows();
98 for (
index_t k = 0; k < quWeights.rows(); ++k)
102 basisData.middleRows(numActive, numActive * d);
104 basisData.bottomRows(numActive * (d * (d + 1)) / 2);
107 outerNormal(md, k, side, unormal);
110 const T weight = quWeights[k] * unormal.norm();
116 transformGradients(md, k, basisGrads, physBasisGrads);
118 transformLaplaceHgrad(md, k, basisGrads, basis2ndDerivs, physBasisLaplace);
122 const T mu = m_penalty / (0 != h ? h : 1);
125 localRhs.noalias() += weight * ((physBasisLaplace.transpose() + mu * physBasisGrads.transpose() * unormal)
126 * dirData.col(k).transpose());
128 localMat.noalias() += weight * (physBasisGrads.transpose() * unormal * physBasisLaplace
129 + (physBasisGrads.transpose() * unormal * physBasisLaplace).transpose()
130 - mu * physBasisGrads.transpose() * physBasisGrads);
143 const index_t numActive = actives.rows();
146 for (
index_t j=0; j!=numActive; ++j)
148 const unsigned jj = actives(j);
149 rhsMatrix.row(jj) -= localRhs.row(j);
150 for (
index_t i=0; i!=numActive; ++i)
152 const unsigned ii = actives(i);
154 sysMatrix( ii, jj ) -= localMat(i,j);
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
Class representing a reference quadrature rule.
Definition: gsQuadRule.h:28
T getCellSize() const
Return the diagonal of the element.
Definition: gsDomainIterator.h:171
virtual void computeMap(gsMapData< T > &InOut) const
Computes map function data.
Definition: gsFunction.hpp:822
gsVisitorNitscheBiharmonic(const gsFunction< T > &dirdata, T penalty, boxSide s)
Constructor.
Definition: gsVisitorNitscheBiharmonic.h:43
virtual void evalAllDers_into(const gsMatrix< T > &u, int n, std::vector< gsMatrix< T > > &result, bool sameElement=false) const
Evaluate the nonzero functions and their derivatives up to order n at points u into result...
Definition: gsFunctionSet.hpp:81
short_t dim() const
Return dimension of the elements.
Definition: gsDomainIterator.h:115
virtual short_t degree(short_t i) const
Degree with respect to the i-th variable. If the basis is a tensor product of (piecewise) polynomial ...
Definition: gsBasis.hpp:650
the gsMapData is a cache of pre-computed function (map) values.
Definition: gsFuncData.h:324
#define index_t
Definition: gsConfig.h:32
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
void localToGlobal(const gsMatrix< index_t > &locals, index_t patchIndex, gsMatrix< index_t > &globals, index_t comp=0) const
Computes the global indices of the input local indices.
Definition: gsDofMapper.cpp:25
void assemble(gsDomainIterator< T > &element, const gsVector< T > &quWeights)
Assemble on element.
Definition: gsVisitorNitscheBiharmonic.h:91
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition: gsDofMapper.h:68
Class which enables iteration over all elements of a parameter domain.
Definition: gsDomainIterator.h:67
Visitor for the weak imposition of the first-type dirichlet boundary condition.
Definition: gsVisitorNitscheBiharmonic.h:34
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
The density of the measure pull back.
Definition: gsForwardDeclarations.h:76
void localToGlobal(const gsDofMapper &mapper, const gsMatrix< T > &eliminatedDofs, const index_t patchIndex, gsSparseMatrix< T > &sysMatrix, gsMatrix< T > &rhsMatrix)
Adds the contributions to the sparse system.
Definition: gsVisitorNitscheBiharmonic.h:135
void evaluate(const gsBasis< T > &basis, const gsGeometry< T > &geo, gsMatrix< T > &quNodes)
Evaluate on element.
Definition: gsVisitorNitscheBiharmonic.h:65
Value of the object.
Definition: gsForwardDeclarations.h:72
void initialize(const gsBasis< T > &basis, gsQuadRule< T > &rule)
Initialize.
Definition: gsVisitorNitscheBiharmonic.h:48
Gradient transformation matrix.
Definition: gsForwardDeclarations.h:77
Class that represents the (tensor) Gauss-Legendre quadrature rule.
Definition: gsGaussRule.h:27
short_t direction() const
Returns the parametric direction orthogonal to this side.
Definition: gsBoundary.h:113
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
virtual void active_into(const gsMatrix< T > &u, gsMatrix< index_t > &result) const
Returns the indices of active basis functions at points u, as a list of indices, in result...
Definition: gsBasis.hpp:293