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);
122 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
130 ptB[periodicIndex] = centroidA[periodicIndex];
150 +
"-coord\" takes at most two parameter <tol, relative>";
151 TEUCHOS_TEST_FOR_EXCEPTION(params.size()>2,std::logic_error,errStr);
154 if(params.size()>0) {
155 std::stringstream ss;
158 if(params.size()==2){
159 if (params[1] ==
"3D") {
161 std::cout <<
"WARNING : Keyword " << params[1] <<
" not needed for PlaneMatcher" << std::endl;
164 std::string errStr2 = params[1] +
" is not a valid periodic option (try \"relative\")";
165 TEUCHOS_TEST_FOR_EXCEPTION(params[1]!=
"relative",std::logic_error,errStr2);
180 PlaneMatcher(
int index0,
int index1,
const std::vector<std::string> & params)
188 const Teuchos::Tuple<double,3> & b)
const
199 std::stringstream ss;
230 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
239 ptB[periodicIndex] = centroidA[periodicIndex];
258 +
"-quarter-coord\" takes only one parameter <tol>";
259 TEUCHOS_TEST_FOR_EXCEPTION(params.size()>1,std::logic_error,errStr);
262 if(params.size()==1) {
263 std::stringstream ss;
273 { TEUCHOS_ASSERT(index0a!=index1); TEUCHOS_ASSERT(index0b!=index1);
buildLabels(); }
277 { TEUCHOS_ASSERT(index0a!=index1); TEUCHOS_ASSERT(index0b!=index1);
buildLabels(); }
288 const Teuchos::Tuple<double,3> & b)
const
294 std::stringstream ss;
301 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
344 TEUCHOS_TEST_FOR_EXCEPTION(params.size() > 2,std::logic_error,
"WedgeMatcher can only have one or two option parameters (tolerance and dimension)!");
347 if (params.size() > 0)
348 error_ = std::stod(params[0]);
350 if (params.size() > 1) {
351 if (params[1] ==
"2D")
353 else if (params[1] ==
"3D")
356 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::runtime_error,
"ERROR: WedgeMatcher::parsParams() - the second params must be iether \"2D\" or \"3D\", param=" << params[1] <<
"\n");
363 const Teuchos::Tuple<double,3> & b)
const
368 (std::fabs(a[2]-b[2])<
error_) );
378 std::stringstream ss;
380 ss <<
"wy-coord <tol=" <<
error_ <<
">";
382 ss <<
"wx-coord <tol=" <<
error_ <<
">";
399 void transform(
double * ptB,
const std::vector<double> & centroidA)
const
void parseParams(const std::vector< std::string > ¶ms)
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
CoordMatcher(int index, const std::vector< std::string > ¶ms)
std::string getString() const
void transform(double *ptB, const std::vector< double > ¢roidA) const
CoordMatcher(int index)
index is the coordinate direction that will be compared to find matching nodes.
CoordMatcher(int index, double error)
CoordMatcher(const CoordMatcher &cm)
double getAbsoluteTolerance() const
int getPeriodicDirection() const
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
PlaneMatcher(int index0, int index1)
PlaneMatcher(int index0, int index1, double error)
double getAbsoluteTolerance() const
PlaneMatcher(int index0, int index1, const std::vector< std::string > ¶ms)
void transform(double *ptB, const std::vector< double > ¢roidA) const
PlaneMatcher(const PlaneMatcher &cm)
std::string getString() const
int getPeriodicDirection() const
void parseParams(const std::vector< std::string > ¶ms)
QuarterPlaneMatcher(int index0a, int index0b, int index1)
std::string getString() const
double getAbsoluteTolerance() const
void transform(double *ptB, const std::vector< double > ¢roidA) const
QuarterPlaneMatcher(int index0a, int index0b, int index1, const std::vector< std::string > ¶ms)
QuarterPlaneMatcher(int index0a, int index0b, int index1, double error)
QuarterPlaneMatcher(const QuarterPlaneMatcher &cm)
void parseParams(const std::vector< std::string > ¶ms)
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)
bool operator()(const Teuchos::Tuple< double, 3 > &a, const Teuchos::Tuple< double, 3 > &b) const
WedgeMatcher::MirrorPlane getMirrorPlane() const
bool is_three_d_
Set to true if a 3D problem, set to false if 2D.
WedgeMatcher(const WedgeMatcher &cm)=default
std::string getString() const
void transform(double *ptB, const std::vector< double > ¢roidA) const
WedgeMatcher(MirrorPlane mp, const std::vector< std::string > ¶ms)
double getAbsoluteTolerance() const