11 #ifndef __Panzer_STK_PeriodicBC_MatchConditions_hpp__
12 #define __Panzer_STK_PeriodicBC_MatchConditions_hpp__
14 #include "Teuchos_Tuple.hpp"
19 namespace panzer_stk {
34 std::string errStr =
"CoordMatcher \"" + std::string(1,
labels_[
index_]) +
"-coord\" takes at most two parameters <tol, relative>";
43 std::string errStr2 = params[1] +
" is not a valid periodic option (try \"relative\")";
90 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
98 ptB[periodicIndex] = centroidA[periodicIndex];
118 +
"-coord\" takes at most two parameter <tol, relative>";
122 if(params.size()>0) {
123 std::stringstream ss;
126 if(params.size()==2){
127 if (params[1] ==
"3D") {
129 std::cout <<
"WARNING : Keyword " << params[1] <<
" not needed for PlaneMatcher" << std::endl;
132 std::string errStr2 = params[1] +
" is not a valid periodic option (try \"relative\")";
148 PlaneMatcher(
int index0,
int index1,
const std::vector<std::string> & params)
167 std::stringstream ss;
198 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
207 ptB[periodicIndex] = centroidA[periodicIndex];
226 +
"-quarter-coord\" takes only one parameter <tol>";
230 if(params.size()==1) {
231 std::stringstream ss;
262 std::stringstream ss;
269 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
312 TEUCHOS_TEST_FOR_EXCEPTION(params.size() > 2,std::logic_error,
"WedgeMatcher can only have one or two option parameters (tolerance and dimension)!");
315 if (params.size() > 0)
316 error_ = std::stod(params[0]);
318 if (params.size() > 1) {
319 if (params[1] ==
"2D")
321 else if (params[1] ==
"3D")
324 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::runtime_error,
"ERROR: WedgeMatcher::parsParams() - the second params must be iether \"2D\" or \"3D\", param=" << params[1] <<
"\n");
335 (std::fabs(a[1-index0_]-b[1-index0_])<
error_) &&
336 (std::fabs(a[2]-b[2])<
error_) );
341 (std::fabs(a[1-index0_]-b[1-index0_])<
error_) );
346 std::stringstream ss;
348 ss <<
"wy-coord <tol=" <<
error_ <<
">";
350 ss <<
"wx-coord <tol=" << error_ <<
">";
367 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
void transform(double *ptB, const std::vector< double > ¢roidA) const
QuarterPlaneMatcher(int index0a, int index0b, int index1)
bool is_three_d_
Set to true if a 3D problem, set to false if 2D.
double getAbsoluteTolerance() const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
WedgeMatcher::MirrorPlane getMirrorPlane() const
int index0_
index to compare - 0 for wy (mirrored over yz), 1 for wx (mirrored over xz)
CoordMatcher(int index, double error)
CoordMatcher(int index, const std::vector< std::string > ¶ms)
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
PlaneMatcher(int index0, int index1, const std::vector< std::string > ¶ms)
PlaneMatcher(const PlaneMatcher &cm)
CoordMatcher(const CoordMatcher &cm)
int getPeriodicDirection() const
void transform(double *ptB, const std::vector< double > ¢roidA) const
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
void parseParams(const std::vector< std::string > ¶ms)
double getAbsoluteTolerance() const
std::string getString() const
std::string getString() const
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) 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)
double getAbsoluteTolerance() const
void transform(double *ptB, const std::vector< double > ¢roidA) const
std::string getString() const
QuarterPlaneMatcher(int index0a, int index0b, int index1, const std::vector< std::string > ¶ms)
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
int getPeriodicDirection() const
std::string getString() const
#define TEUCHOS_ASSERT(assertion_test)
PlaneMatcher(int index0, int index1, double error)
double getAbsoluteTolerance() const
void transform(double *ptB, const std::vector< double > ¢roidA) const