38template<
short_t d,
typename T>
44 if (mp.empty() || !mapper.
freeSize()) {
45 throw std::invalid_argument(
"Invalid input to gsBarrierPatch constructor");
56template<
short_t d,
typename T>
62 throw std::invalid_argument(
"Invalid multi-patch input to gsBarrierPatch constructor");
97template<
short_t d,
typename T>
103 m_mp.boundingBox(boundingBox);
106 T maxside = (bbmax-bbmin).maxCoeff();
109 scaleFactor.setConstant(m_boxsize/maxside);
112 for (
auto &patch:m_mp) {
113 patch->translate(-bbmin);
114 patch->scale(scaleFactor);
119 switch (m_freeInterface)
124 for (
size_t iptch = 0; iptch < m_mp.nPatches(); ++iptch)
126 gsInfo <<
"Parameterizing " << iptch
127 <<
"-th patch. Total number of patches is "
128 << m_mp.nPatches() <<
".\n";
130 gsDofMapper currMapper = _makeMapperOnePatch(m_mp.patch(iptch));
135 m_mp.patch(iptch).setCoefs(optCurrPatch.
patch(0).coefs());
147 gsInfo <<
"\nParameterization construction completed. Running time: " << timer.
stop() <<
".\n";
150 for (
auto &isf:scaleFactor) {
154 for (
auto &ptch:m_mp) {
155 ptch->scale(scaleFactor);
156 ptch->translate(bbmin);
162 template<
short_t d,
typename T>
169template<
short_t d,
typename T>
173 m_mapper.init(m_mb, m_mp.targetDim());
176 for (
size_t iptch = 0; iptch != m_mp.nPatches(); iptch++)
179 for (
index_t idim = 0; idim != m_mp.targetDim(); idim++)
181 m_mapper.markBoundary(iptch, idx, idim);
188 logMapperInformation();
192template<
short_t d,
typename T>
198 m_mapper.init(m_mb, m_mp.targetDim());
201 for (gsMultiPatch<>::const_biterator bit = m_mp.bBegin();
202 bit != m_mp.bEnd(); ++bit)
205 for (
index_t idim = 0; idim != m_mp.targetDim(); ++idim)
207 m_mapper.markBoundary(bit->patch, idx, idim);
214 logMapperInformation();
217template<
short_t d,
typename T>
223 m_mapper.init(m_mb, m_mp.targetDim());
226 for (gsBoxTopology::const_iiterator it = m_mb.topology().iBegin();
227 it != m_mb.topology().iEnd(); ++it)
229 m_mb.matchInterface(*it, m_mapper);
233 for (gsMultiPatch<>::const_biterator bit = m_mp.bBegin();
234 bit != m_mp.bEnd(); ++bit)
237 for (
index_t idim = 0; idim != m_mp.targetDim(); ++idim)
239 m_mapper.markBoundary(bit->patch, idx, idim);
246 logMapperInformation();
249template<
short_t d,
typename T>
261 for (
index_t idim = 0; idim != m_mp.targetDim(); ++idim)
273template<
short_t d,
typename T>
275 gsDebug <<
"#Number of free variables: " << m_mapper.
freeSize() <<
"\n";
276 gsDebug <<
"#Number of fixed variables: " << m_mapper.boundarySize() <<
"\n";
277 gsDebug <<
"#Total number of variables: " << m_mapper.size() <<
"\n\n\n";
static gsMultiPatch< T > compute(const gsMultiPatch< T > &mp, const gsDofMapper &mapper, const gsOptionList &options)
construct analysis-suitable parameterization
Definition gsBarrierCore.hpp:131
static gsOptionList defaultOptions()
Default options.
Definition gsBarrierCore.hpp:26
gsDofMapper _makeMapperOnePatch(const gsGeometry< T > &currPatch) const
Creates a mapper for a single patch.
Definition gsBarrierPatch.hpp:250
void _makeMapperLocalPatches()
Creates a mapper for local patches.
Definition gsBarrierPatch.hpp:193
void defaultOptions()
Sets the default options.
Definition gsBarrierPatch.hpp:163
void compute()
Computes analysis-suitable parameterizations using different methods.
Definition gsBarrierPatch.hpp:98
void _makeMapperGlobalPatches()
Creates a mapper for global patches.
Definition gsBarrierPatch.hpp:218
void logMapperInformation()
Log information about the mapper.
Definition gsBarrierPatch.hpp:274
void setMapper(const gsDofMapper &mapper)
Sets the mapper.
Definition gsBarrierPatch.h:48
void _makeMapper()
Creates a mapper.
Definition gsBarrierPatch.hpp:170
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition gsDofMapper.h:69
void markBoundary(index_t k, const gsMatrix< index_t > &boundaryDofs, index_t comp=0)
Mark the local dofs boundaryDofs of patch k as eliminated.
Definition gsDofMapper.cpp:188
void init(const gsMultiBasis< T > &bases, index_t nComp=1)
Initialize by a gsMultiBasis.
Definition gsDofMapper.hpp:20
void finalize()
Must be called after all boundaries and interfaces have been marked to set up the dof numbering.
Definition gsDofMapper.cpp:240
index_t freeSize() const
Returns the number of free (not eliminated) dofs.
Definition gsDofMapper.h:436
A Stopwatch object can be used to measure execution time of code, algorithms, etc.
Definition gsStopwatch.h:73
double stop()
Return elapsed time in seconds.
Definition gsStopwatch.h:83
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
short_t targetDim() const
Dimension of the ambient physical space (overriding gsFunction::targetDim())
Definition gsGeometry.h:286
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
gsGeometry< T > & patch(size_t i) const
Return the i-th patch.
Definition gsMultiPatch.h:292
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
gsBarrierPatch(const gsMultiPatch< T > &mp, const gsDofMapper &mapper)
Constructs the object using a given multi-patch and a degree of freedom mapper.
Definition gsBarrierPatch.hpp:39
This software facilitates the creation of analysis-suitable parameterizations from given boundary rep...
#define index_t
Definition gsConfig.h:32
#define gsDebug
Definition gsDebug.h:61
#define gsInfo
Definition gsDebug.h:43
The G+Smo namespace, containing all definitions for the library.