G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsCPPInterface.h
Go to the documentation of this file.
1 
17 #pragma once
18 
20 #include <gsCore/gsBoundary.h>
21 #include <gsIO/gsOptionList.h>
22 
23 namespace gismo {
24 
31 template <class T>
32 class gsCPPInterface : public gsFunction<T>
33 {
34 public:
35 
37  typedef memory::shared_ptr< gsCPPInterface > Ptr;
38 
40  typedef memory::unique_ptr< gsCPPInterface > uPtr;
41 
54  const gsMultiBasis<T> & mb,
55  const boundaryInterface & bi,
56  const gsOptionList & opt = defaultOptions() );
57 
58  static uPtr make (const gsMultiPatch<T> & mp,
59  const gsMultiBasis<T> & mb,
60  const boundaryInterface & bi,
61  const gsOptionList & opt = defaultOptions() )
62  { return uPtr(new gsCPPInterface(mp,mb,bi,opt)); }
63 
64 private:
65  const gsGeometry<T>* m_slaveGeom, *m_masterGeom;
67 
70 
72 
74 
75  std::vector<index_t> m_freeDirs;
76  index_t m_fixedParam;
77  index_t m_fixedDir;
78 
79  std::vector< std::vector<T> > m_breakpoints;
80 
81 public:
86  {
87  gsOptionList defaultOpts;
88  defaultOpts.addInt ( "Tied", "Is it a tied contact?", 0);
89  defaultOpts.addReal( "Tolerance", "Tolerance to be used for closest point search.", 1e-5);
90  return defaultOpts;
91  }
92 
93 
94  void updateBdr();
95 
96 
101  virtual void eval_into(const gsMatrix<T> & u, gsMatrix<T> & result) const;
102 
104  virtual short_t domainDim() const { return m_slaveGeom->domainDim(); }
105 
112 
113 
115  const std::vector< std::vector<T> > & breakPoints() const { return m_breakpoints; }
116 
118  virtual std::ostream & print(std::ostream& os) const;
119 
120 private:
122  void constructInterfaceBox();
123 
125  void constructBreaks();
126 }; // End gsCPPInterface
127 
128 
131 template <class T>
132 inline std::ostream & operator<<(std::ostream & os, const gsCPPInterface<T> & cppIf)
133 { return cppIf.print(os); }
134 
135 } // End namespace gismo
136 
137 #ifndef GISMO_BUILD_LIB
138 #include GISMO_HPP_HEADER(gsCPPInterface.hpp)
139 #endif
T m_Tolerance
Tolerance for closest point algorithm.
Definition: gsCPPInterface.h:73
static gsOptionList defaultOptions()
Definition: gsCPPInterface.h:85
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
const std::vector< std::vector< T > > & breakPoints() const
Returns the break points used in makeDomainIterator.
Definition: gsCPPInterface.h:115
memory::shared_ptr< gsGeometry > Ptr
Shared pointer for gsGeometry.
Definition: gsGeometry.h:97
#define short_t
Definition: gsConfig.h:35
Provides structs and classes related to interfaces and boundaries.
Provides a mapping between the corresponding sides of two patches sharing an interface, by means of a closest point projection.
Definition: gsCPPInterface.h:32
gsDomainIterator< T >::uPtr makeDomainIterator() const
Returns a domain iterator.
Definition: gsCPPInterface.hpp:130
Implements an affine function.
#define index_t
Definition: gsConfig.h:32
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
void constructInterfaceBox()
Computes the box which represents the intersection of sides of incoming patches.
virtual std::ostream & print(std::ostream &os) const
Prints the state of the object.
Definition: gsCPPInterface.hpp:143
gsCPPInterface(const gsMultiPatch< T > &mp, const gsMultiBasis< T > &mb, const boundaryInterface &bi, const gsOptionList &opt=defaultOptions())
Constructor.
Definition: gsCPPInterface.hpp:26
const gsBasis< T > * m_slaveBasis
Basis on first patch.
Definition: gsCPPInterface.h:68
boundaryInterface m_boundaryInterface
Corresponding boundary interface.
Definition: gsCPPInterface.h:71
memory::unique_ptr< gsDomainIterator > uPtr
Unique pointer for gsDomainIterator.
Definition: gsDomainIterator.h:73
void addInt(const std::string &label, const std::string &desc, const index_t &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:201
Provides a list of labeled parameters/options that can be set and accessed easily.
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
std::vector< std::vector< T > > m_breakpoints
Union of breakpoints of both bases.
Definition: gsCPPInterface.h:79
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
const gsBasis< T > * m_masterBasis
Basis on second patch.
Definition: gsCPPInterface.h:69
virtual short_t domainDim() const
Returns parameter dimension of the domains.
Definition: gsCPPInterface.h:104
memory::shared_ptr< gsCPPInterface > Ptr
Shared pointer for gsRemapInterface.
Definition: gsCPPInterface.h:37
void addReal(const std::string &label, const std::string &desc, const Real &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:211
gsGeometry< T >::Ptr m_masterBdr
The boundary geometry of second patch – Master.
Definition: gsCPPInterface.h:66
Struct which represents an interface between two patches.
Definition: gsBoundary.h:649
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
void constructBreaks()
Constructs the breakpoints m_breakpoints.
virtual void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the interface map.
Definition: gsCPPInterface.hpp:62
memory::unique_ptr< gsCPPInterface > uPtr
Unique pointer for gsRemapInterface.
Definition: gsCPPInterface.h:40
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
const gsGeometry< T > * m_masterGeom
Geometry of first (Slave) patch and second patch (master)
Definition: gsCPPInterface.h:65