43 #ifndef __Panzer_STK_PeriodicBC_Matcher_hpp__ 44 #define __Panzer_STK_PeriodicBC_Matcher_hpp__ 46 #include "Teuchos_Tuple.hpp" 47 #include "Teuchos_RCP.hpp" 50 #include "PanzerAdaptersSTK_config.hpp" 59 namespace periodic_helpers {
65 template <
typename Matcher>
66 Teuchos::RCP<std::vector<std::pair<std::size_t,std::size_t> > >
68 const STK_Interface & mesh,
69 const Matcher & matcher,
const std::string type_ =
"coord");
71 template <
typename Matcher>
72 Teuchos::RCP<std::vector<std::pair<std::size_t,std::size_t> > >
74 const STK_Interface & mesh,
75 const Matcher & matcher,
76 const std::vector<std::pair<std::size_t,std::size_t> > & current,
const std::string type_ =
"coord");
81 std::pair<Teuchos::RCP<std::vector<std::size_t> >,
82 Teuchos::RCP<std::vector<Teuchos::Tuple<double,3> > > >
84 const std::string & sideName,
const std::string type_ =
"coord");
89 std::pair<Teuchos::RCP<std::vector<std::size_t> >,
90 Teuchos::RCP<std::vector<Teuchos::Tuple<double,3> > > >
92 const std::string & sideName,
const std::string type_ =
"coord");
97 Teuchos::RCP<std::vector<std::size_t> >
99 const std::string & sideName,
const std::string type_ =
"coord");
105 template <
typename Matcher>
106 Teuchos::RCP<std::vector<std::pair<std::size_t,std::size_t> > >
108 const std::vector<Teuchos::Tuple<double,3> > & side_coords,
109 const STK_Interface & mesh,
110 const std::string & sideName,
const Matcher & matcher,
const std::string type_ =
"coord");
121 Teuchos::RCP<std::vector<std::pair<std::size_t,std::size_t> > >
123 const std::vector<std::pair<std::size_t,std::size_t> > & locallyMatchedIds,
124 const STK_Interface & mesh,
bool failure);
151 Teuchos::RCP<std::vector<std::pair<std::size_t,std::size_t> > >
153 const Teuchos::RCP<
const std::vector<std::pair<std::size_t,std::size_t> > > & currentState = Teuchos::null
159 virtual std::string
getString()
const = 0;
164 virtual std::string
getType()
const = 0;
174 const T*
getAs()
const {
return dynamic_cast<const T*
>(
this);}
182 template <
typename Matcher>
185 PeriodicBC_Matcher(
const std::string & left,
const std::string & right,
const Matcher & matcher,
const std::string type =
"coord")
200 Teuchos::RCP<std::vector<std::pair<std::size_t,std::size_t> > >
202 const Teuchos::RCP<
const std::vector<std::pair<std::size_t,std::size_t> > > & currentState = Teuchos::null
205 if(currentState==Teuchos::null)
213 std::stringstream ss;
214 ss <<
"condition: " <<
matcher_.getString() <<
", sides = [ " 215 <<
"\"" <<
left_ <<
"\", " 216 <<
"\"" <<
right_ <<
"\" ]";
248 template <
typename Matcher>
249 Teuchos::RCP<PeriodicBC_MatcherBase>
250 buildPeriodicBC_Matcher(
const std::string & left,
const std::string & right,
const Matcher & matcher,
const std::string type =
"coord")
PeriodicBC_Matcher(const std::string &left, const std::string &right, const Matcher &matcher, const std::string type="coord")
virtual ~PeriodicBC_MatcherBase()
Teuchos::RCP< std::vector< std::size_t > > getLocalSideIds(const STK_Interface &mesh, const std::string &sideName, const std::string type_)
Teuchos::RCP< std::vector< std::pair< std::size_t, std::size_t > > > matchPeriodicSides(const std::string &left, const std::string &right, const STK_Interface &mesh, const Matcher &matcher, const std::string type_="coord")
virtual std::string getString() const =0
std::string getType() const
PeriodicBC_Matcher(const PeriodicBC_Matcher &src)
std::pair< Teuchos::RCP< std::vector< std::size_t > >, Teuchos::RCP< std::vector< Teuchos::Tuple< double, 3 > > > > getLocalSideIdsAndCoords(const STK_Interface &mesh, const std::string &sideName, const std::string type_)
std::string getString() const
Teuchos::RCP< std::vector< std::pair< std::size_t, std::size_t > > > getMatchedPair(const STK_Interface &mesh, const Teuchos::RCP< const std::vector< std::pair< std::size_t, std::size_t > > > ¤tState=Teuchos::null) const
std::string getRightSidesetName() const
Returns the sideset name for the right side.
std::string getLeftSidesetName() const
Returns the sideset name for the left side.
const T * getAs() const
Attempts to cast the underlying matcher to type T. Returns nullptr if cast fails. ...
const Matcher & getMatcher() const
virtual std::string getLeftSidesetName() const =0
Returns the sideset name for the left side.
Teuchos::RCP< PeriodicBC_MatcherBase > buildPeriodicBC_Matcher(const std::string &left, const std::string &right, const Matcher &matcher, const std::string type="coord")
Teuchos::RCP< std::vector< std::pair< std::size_t, std::size_t > > > getGlobalPairing(const std::vector< std::size_t > &locallyRequiredIds, const std::vector< std::pair< std::size_t, std::size_t > > &locallyMatchedIds, const STK_Interface &mesh, bool failure)
virtual std::string getRightSidesetName() const =0
Returns the sideset name for the right side.
virtual std::string getType() const =0
virtual Teuchos::RCP< std::vector< std::pair< std::size_t, std::size_t > > > getMatchedPair(const STK_Interface &mesh, const Teuchos::RCP< const std::vector< std::pair< std::size_t, std::size_t > > > ¤tState=Teuchos::null) const =0
std::pair< Teuchos::RCP< std::vector< std::size_t > >, Teuchos::RCP< std::vector< Teuchos::Tuple< double, 3 > > > > getSideIdsAndCoords(const STK_Interface &mesh, const std::string &sideName, const std::string type_)
Teuchos::RCP< std::vector< std::pair< std::size_t, std::size_t > > > getLocallyMatchedSideIds(const std::vector< std::size_t > &side_ids, const std::vector< Teuchos::Tuple< double, 3 > > &side_coords, const STK_Interface &mesh, const std::string &sideName, const Matcher &matcher, const std::string type_="coord")