17 #include <gsUnstructuredSplines/src/gsC1SurfGluingDataAssembler.h>
25 template<
class T,
class Visitor = gsC1SurfGluingDataVisitor<T>>
26 class gsC1SurfGluingData :
public gsC1SurfGD<T>
37 : gsC1SurfGD<T>(mp, mb)
54 return sol.row(0) * ( ones - points ) + sol.row(1) * points;
61 return sol.row(2) * ( ones - points ) + sol.row(3) * points;
68 return solBeta.row(0) * ( ones - points ) + solBeta.row(1) * points;
75 return solBeta.row(2) * ( ones - points ) + solBeta.row(3) * points;
82 return sol.row(4) * ( ones - points ).cwiseProduct( ones - points)
83 + sol.row(5) * ( ones - points ).cwiseProduct(points) + sol.row(6) * points;
135 dirichletDofs.setZero(mSys.colMapper(0).boundarySize(),1);
141 mSys.matrix().makeCompressed();
146 mSysBeta.reserve(16, 1);
148 dirichletDofsBeta.setZero(mSysBeta.colMapper(0).boundarySize(), 1);
152 applyBeta(visitorBeta);
154 mSysBeta.matrix().makeCompressed();
157 void apply(Visitor visitor)
165 const int tid = omp_get_thread_num();
166 const int nt = omp_get_num_threads();
174 const gsBasis<T> & basis = this->m_mb[0].basis(0).component(1);
177 visitor_.initialize(basis,quRule);
183 for ( domIt->next(tid); domIt->good(); domIt->next(nt) )
185 for (; domIt->good(); domIt->next() )
189 quRule.
mapTo( domIt->lowerCorner(), domIt->upperCorner(), quNodes, quWeights );
192 visitor_.evaluate(quNodes, this->m_mp);
195 visitor_.assemble(*domIt, quWeights);
198 #pragma omp critical(localToGlobal)
199 visitor_.localToGlobal( dirichletDofs, mSys);
204 void applyBeta(Visitor visitorBeta)
211 visitor_Beta(visitorBeta);
212 const int tid = omp_get_thread_num();
213 const int nt = omp_get_num_threads();
215 &visitor_Beta = visitorBeta;
224 visitor_Beta.initialize(basis,quRule);
230 for ( domIt->next(tid); domIt->good(); domIt->next(nt) )
232 for (; domIt->good(); domIt->next() )
236 quRule.
mapTo( domIt->lowerCorner(), domIt->upperCorner(), quNodes, quWeights );
239 visitor_Beta.evaluateBeta(quNodes, this->m_mp, sol);
242 visitor_Beta.assembleBeta(*domIt, quWeights);
245 #pragma omp critical(localToGlobal)
246 visitor_Beta.localToGlobalBeta( dirichletDofsBeta, mSysBeta);
255 typename gsSparseSolver<T>::SimplicialLDLT solver;
257 solver.compute(mSys.matrix());
258 sol = solver.solve(mSys.rhs());
263 typename gsSparseSolver<T>::SimplicialLDLT solver;
265 solver.compute(mSysBeta.matrix());
266 solBeta = solver.solve(mSysBeta.rhs());
282 solBetaTMP(0, 0) = 0;
283 solBetaTMP(1, 0) = 0;
284 solBetaTMP(2, 0) = 0;
285 solBetaTMP(3, 0) = 0;
288 solBeta = solBetaTMP;
Class representing a reference quadrature rule.
Definition: gsQuadRule.h:28
Visitor for the Gluing Data.
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition: gsDofMapper.h:68
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
const gsBasis< T > & basis(const index_t k) const
Helper which casts and returns the k-th piece of this function set as a gsBasis.
Definition: gsFunctionSet.hpp:33
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
virtual void mapTo(const gsVector< T > &lower, const gsVector< T > &upper, gsMatrix< T > &nodes, gsVector< T > &weights) const
Maps quadrature rule (i.e., points and weights) from the reference domain to an element.
Definition: gsQuadRule.h:177
Compute the gluing data for one interface.
virtual domainIter makeDomainIterator() const
Create a domain iterator for the computational mesh of this basis, that points to the first element o...
Definition: gsBasis.hpp:493
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78