43 #ifndef __Panzer_STK_PeriodicBC_MatchConditions_hpp__ 44 #define __Panzer_STK_PeriodicBC_MatchConditions_hpp__ 46 #include "Teuchos_Tuple.hpp" 66 std::string errStr =
"CoordMatcher \"" + std::string(1,
labels_[
index_]) +
"-coord\" takes at most two parameters <tol, relative>";
67 TEUCHOS_TEST_FOR_EXCEPTION(params.size()>2,std::logic_error,errStr);
75 std::string errStr2 = params[1] +
" is not a valid periodic option (try \"relative\")";
76 TEUCHOS_TEST_FOR_EXCEPTION(params[1]!=
"relative",std::logic_error,errStr2);
93 const Teuchos::Tuple<double,3> & b)
const 103 std::stringstream ss;
114 TEUCHOS_ASSERT(
index_ != 2);
135 +
"-coord\" takes at most two parameter <tol, relative>";
136 TEUCHOS_TEST_FOR_EXCEPTION(params.size()>2,std::logic_error,errStr);
139 if(params.size()==1) {
140 std::stringstream ss;
143 if(params.size()==2){
144 std::string errStr2 = params[1] +
" is not a valid periodic option (try \"relative\")";
145 TEUCHOS_TEST_FOR_EXCEPTION(params[1]!=
"relative",std::logic_error,errStr2);
159 PlaneMatcher(
int index0,
int index1,
const std::vector<std::string> & params)
167 const Teuchos::Tuple<double,3> & b)
const 178 std::stringstream ss;
221 +
"-quarter-coord\" takes only one parameter <tol>";
222 TEUCHOS_TEST_FOR_EXCEPTION(params.size()>1,std::logic_error,errStr);
225 if(params.size()==1) {
226 std::stringstream ss;
236 { TEUCHOS_ASSERT(index0a!=index1); TEUCHOS_ASSERT(index0b!=index1);
buildLabels(); }
240 { TEUCHOS_ASSERT(index0a!=index1); TEUCHOS_ASSERT(index0b!=index1);
buildLabels(); }
251 const Teuchos::Tuple<double,3> & b)
const 257 std::stringstream ss;
289 TEUCHOS_TEST_FOR_EXCEPTION(params.size() > 2,std::logic_error,
"WedgeMatcher can only have one or two option parameters (tolerance and dimension)!");
292 if (params.size() > 0)
293 error_ = std::stod(params[0]);
295 if (params.size() > 1) {
296 if (params[1] ==
"2D")
298 else if (params[1] ==
"3D")
301 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::runtime_error,
"ERROR: WedgeMatcher::parsParams() - the second params must be iether \"2D\" or \"3D\", param=" << params[1] <<
"\n");
308 const Teuchos::Tuple<double,3> & b)
const 313 (std::fabs(a[2]-b[2])<
error_) );
323 std::stringstream ss;
325 ss <<
"wy-coord <tol=" <<
error_ <<
">";
327 ss <<
"wx-coord <tol=" <<
error_ <<
">";
QuarterPlaneMatcher(int index0a, int index0b, int index1)
bool is_three_d_
Set to true if a 3D problem, set to false if 2D.
std::string getString() const
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
int index0_
index to compare - 0 for wy (mirrored over yz), 1 for wx (mirrored over xz)
CoordMatcher(int index, double error)
std::string getString() const
CoordMatcher(int index, const std::vector< std::string > ¶ms)
PlaneMatcher(int index0, int index1, const std::vector< std::string > ¶ms)
PlaneMatcher(const PlaneMatcher &cm)
CoordMatcher(const CoordMatcher &cm)
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
void parseParams(const std::vector< std::string > ¶ms)
std::string getString() const
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
std::string getString() const
void parseParams(const std::vector< std::string > ¶ms)
QuarterPlaneMatcher(int index0a, int index0b, int index1, double error)
PlaneMatcher(int index0, int index1)
QuarterPlaneMatcher(const QuarterPlaneMatcher &cm)
WedgeMatcher(MirrorPlane mp, const std::vector< std::string > ¶ms)
CoordMatcher(int index)
index is the coordinate direction that will be compared to find matching nodes.
void parseParams(const std::vector< std::string > ¶ms)
int getPeriodicDirection() const
QuarterPlaneMatcher(int index0a, int index0b, int index1, const std::vector< std::string > ¶ms)
WedgeMatcher::MirrorPlane getMirrorPlane() const
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
PlaneMatcher(int index0, int index1, double error)
int getPeriodicDirection() const