22 template <
class T,
class bhVisitor = gsC1SurfGluingDataVisitor<T> >
23 class gsC1SurfGluingDataAssembler :
public gsAssembler<T>
26 typedef gsAssembler<T> Base;
29 gsC1SurfGluingDataAssembler(gsBasis<T>
const & basis,
31 gsMultiPatch<T>
const & mp,
34 : m_uv(uv), m_mp(mp), m_gamma(gamma), m_isBoundary(isBoundary)
37 m_basis.push_back(basis);
49 inline void apply(bhVisitor & visitor,
51 boxSide side = boundary::none);
53 inline void applyBeta(bhVisitor & visitor,
55 boxSide side = boundary::none);
58 const gsSparseMatrix<T> & matrix_alpha()
const {
return m_system_alpha.matrix(); }
59 const gsMatrix<T> & rhs_alpha()
const {
return m_system_alpha.rhs(); }
61 const gsSparseMatrix<T> & matrix_beta()
const {
return m_system_beta_S.matrix(); }
62 const gsMatrix<T> & rhs_beta()
const {
return m_system_beta_S.rhs(); }
74 std::vector< gsMultiBasis<T> > m_basis;
79 gsSparseSystem<T> m_system_alpha;
80 gsSparseSystem<T> m_system_beta_S;
85 template <
class T,
class bhVisitor>
86 void gsC1SurfGluingDataAssembler<T, bhVisitor>::refresh()
89 gsDofMapper map_alpha(m_basis[0]);
91 gsDofMapper map_beta_S(m_basis[0]);
94 map_beta_S.finalize();
97 m_system_alpha = gsSparseSystem<T>(map_alpha);
98 m_system_beta_S = gsSparseSystem<T>(map_beta_S);
103 template <
class T,
class bhVisitor>
104 void gsC1SurfGluingDataAssembler<T, bhVisitor>::assemble()
109 const index_t nz = gsAssemblerOptions::numColNz(m_basis[0][0],2,1,0.333333);
110 m_system_alpha.reserve(nz, 1);
111 m_system_beta_S.reserve(nz, 1);
116 const gsDofMapper & mapper_alpha = m_system_alpha.colMapper(0);
117 const gsDofMapper & mapper_beta = m_system_beta_S.colMapper(0);
119 m_ddof[0].setZero(mapper_alpha.boundarySize(), 1 );
120 m_ddof[1].setZero(mapper_beta.boundarySize(), 1 );
126 m_system_alpha.matrix().makeCompressed();
127 m_system_beta_S.matrix().makeCompressed();
131 template <
class T,
class bhVisitor>
132 inline void gsC1SurfGluingDataAssembler<T, bhVisitor>::apply(bhVisitor & visitor,
142 const int tid = omp_get_thread_num();
143 const int nt = omp_get_num_threads();
147 gsQuadRule<T> quRule ;
148 gsMatrix<T> quNodes ;
149 gsVector<T> quWeights;
151 gsBasis<T> & basis = m_basis[0].basis(patchIndex);
154 visitor_.initialize(basis,quRule);
159 typename gsBasis<T>::domainIter domIt = basis.makeDomainIterator(boundary::none);
162 for ( domIt->next(tid); domIt->good(); domIt->next(nt) )
164 for (; domIt->good(); domIt->next() )
168 quRule.mapTo( domIt->lowerCorner(), domIt->upperCorner(), quNodes, quWeights );
171 visitor_.evaluate(basis, quNodes, m_uv, m_mp, m_gamma, m_isBoundary);
174 visitor_.assemble(*domIt, quWeights);
177 #pragma omp critical(localToGlobal)
178 visitor_.localToGlobal(patchIndex, m_ddof, m_system_alpha, m_system_beta_S);
Visitor for the Gluing Data.
#define index_t
Definition: gsConfig.h:32
virtual void assemble(const gsMultiPatch< T > &curSolution)
Main non-linear assemble routine with input from current solution.
Definition: gsAssembler.hpp:55
std::vector< gsMatrix< T > > m_ddof
Definition: gsAssembler.h:295
void apply(ElementVisitor &visitor, size_t patchIndex=0, boxSide side=boundary::none)
Generic assembly routine for volume or boundary integrals.
Definition: gsAssembler.h:668