47 "Computes height of element connected to a surface.");
62 "ProcessSurfDistance needs bnd parameter with a single id.");
65 int surf =
m_config[
"bnd"].as<
int>();
66 int expdim =
m_f->m_graph->GetMeshDimension();
68 ASSERTL0(surf >= 0,
"Invalid surface " + boost::lexical_cast<string>(surf));
70 int nfields =
m_f->m_variables.size();
71 m_f->m_variables.push_back(
"dist");
73 if (
m_f->m_exp[0]->GetNumElmts() == 0)
78 int NumHomogeneousDir =
m_f->m_numHomogeneousDir;
82 m_f->m_exp.resize(nfields + 1);
83 exp =
m_f->AppendExpList(NumHomogeneousDir);
85 m_f->m_exp[nfields] = exp;
94 exp->GetBndCondExpansions();
98 exp->GetBoundaryToElmtMap(BoundarytoElmtID, BoundarytoTraceID);
101 "Homogeneous expansions not supported");
103 for (i = cnt = 0; i < BndExp.size(); ++i)
107 cnt += BndExp[i]->GetExpSize();
111 for (j = 0; j < BndExp[i]->GetExpSize(); ++j, ++cnt)
113 int elmtNum = BoundarytoElmtID[cnt];
114 int facetNum = BoundarytoTraceID[cnt];
122 switch (elmt->DetShapeType())
126 oppositeNum = (facetNum + 2) % 4;
141 ASSERTL0(
false,
"Surface must be on a triangular "
142 "face of the prism.");
170 ASSERTL0(
false,
"Face out of bound.");
176 ASSERTL0(
false,
"Element not supported");
179 int nq = elmt->GetTotPoints();
180 int nqBnd = bndElmt->GetTotPoints();
186 elmt->GetCoords(x[0], x[1], x[2]);
190 BndExp[i]->UpdatePhys() + BndExp[i]->GetPhys_Offset(j);
196 for (k = 0; k < expdim; ++k)
202 elmt->GetTracePhysVals(facetNum, bndElmt, x[k], face1);
203 elmt->GetTracePhysVals(oppositeNum, bndElmt, x[k],
206 if (elmt->GetTraceOrient(facetNum) !=
207 elmt->GetTraceOrient(oppositeNum))
217 elmt->GetTraceOrient(facetNum);
218 elmt->GetTracePhysVals(facetNum, bndElmt, x[k], face1,
220 elmt->GetTracePhysVals(oppositeNum, bndElmt, x[k],
225 ASSERTL0(
false,
"Expansion not supported");
228 Vmath::Vvtvp(nqBnd, face1, 1, face1, 1, dist, 1, dist, 1);
233 BndExp[i]->FwdTransLocalElmt(BndExp[i]->GetPhys(),
234 BndExp[i]->UpdateCoeffs());
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
static ModuleKey className
~ProcessSurfDistance() override
void v_Process(po::variables_map &vm) override
Write mesh to output file.
ProcessSurfDistance(FieldSharedPtr f)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void Zero(int n, T *x, const int incx)
Zero vector.
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.