37 template<
short_t d,
typename T>
45 throw std::invalid_argument(
"Invalid input to gsBarrierPatch constructor");
56 template<
short_t d,
typename T>
62 throw std::invalid_argument(
"Invalid multi-patch input to gsBarrierPatch constructor");
97 template<
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>
169 template<
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();
192 template<
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();
217 template<
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();
249 template<
short_t d,
typename T>
261 for (
index_t idim = 0; idim != m_mp.targetDim(); ++idim)
273 template<
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";
void init(const gsMultiBasis< T > &bases, index_t nComp=1)
Initialize by a gsMultiBasis.
Definition: gsDofMapper.hpp:20
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
void defaultOptions()
Sets the default options.
Definition: gsBarrierPatch.hpp:163
#define gsDebug
Definition: gsDebug.h:61
void _makeMapperLocalPatches()
Creates a mapper for local patches.
Definition: gsBarrierPatch.hpp:193
#define index_t
Definition: gsConfig.h:32
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition: gsDofMapper.h:68
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
gsDofMapper _makeMapperOnePatch(const gsGeometry< T > &currPatch) const
Creates a mapper for a single patch.
Definition: gsBarrierPatch.hpp:250
void finalize()
Must be called after all boundaries and interfaces have been marked to set up the dof numbering...
Definition: gsDofMapper.cpp:240
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 _makeMapper()
Creates a mapper.
Definition: gsBarrierPatch.hpp:170
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
static gsMultiPatch< T > compute(const gsMultiPatch< T > &mp, const gsDofMapper &mapper, const gsOptionList &options)
construct analysis-suitable parameterization
Definition: gsBarrierCore.hpp:129
#define gsInfo
Definition: gsDebug.h:43
double stop()
Return elapsed time in seconds.
Definition: gsStopwatch.h:83
void setMapper(const gsDofMapper &mapper)
Sets the mapper.
Definition: gsBarrierPatch.h:48
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
A Stopwatch object can be used to measure execution time of code, algorithms, etc.
Definition: gsStopwatch.h:72
void compute()
Computes analysis-suitable parameterizations using different methods.
Definition: gsBarrierPatch.hpp:98
static gsOptionList defaultOptions()
Default options.
Definition: gsBarrierCore.hpp:24
void _makeMapperGlobalPatches()
Creates a mapper for global patches.
Definition: gsBarrierPatch.hpp:218
void logMapperInformation()
Log information about the mapper.
Definition: gsBarrierPatch.hpp:274
short_t targetDim() const
Dimension of the ambient physical space (overriding gsFunction::targetDim())
Definition: gsGeometry.h:286
index_t freeSize() const
Returns the number of free (not eliminated) dofs.
Definition: gsDofMapper.h:436
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
This software facilitates the creation of analysis-suitable parameterizations from given boundary rep...
bool empty() const
Returns true if gsMultiPatch is empty.
Definition: gsMultiPatch.h:202