47 ModuleKey ProcessSurfDistance::className =
50 ProcessSurfDistance::create,
51 "Computes height of element connected to a surface.");
56 ConfigOption(
false,
"-1",
"Boundary region to calculate height");
57 f->m_writeBndFld =
true;
58 f->m_declareExpansionAsContField =
true;
59 m_f->m_fldToBnd =
false;
70 if (
m_f->m_comm->TreatAsRankZero())
72 cout <<
"ProcessSurfDistance: Calculating distance to surface..."
78 int surf =
m_config[
"bnd"].as<
int>();
79 int expdim =
m_f->m_graph->GetMeshDimension();
81 ASSERTL0(surf >= 0,
"Invalid surface " + boost::lexical_cast<string>(surf));
84 m_f->m_bndRegionsToWrite.push_back(surf);
91 m_f->m_exp[0]->GetBndCondExpansions();
95 m_f->m_exp[0]->GetBoundaryToElmtMap(BoundarytoElmtID, BoundarytoTraceID);
97 if (
m_f->m_fielddef.size() == 0)
99 m_f->m_fielddef =
m_f->m_exp[0]->GetFieldDefinitions();
100 m_f->m_fielddef[0]->m_fields.push_back(
"dist");
105 m_f->m_fielddef[0]->m_fields[0] =
"dist";
108 ASSERTL0(!(
m_f->m_fielddef[0]->m_numHomogeneousDir),
109 "Homogeneous expansions not supported");
111 for (i = cnt = 0; i < BndExp.num_elements(); ++i)
115 cnt += BndExp[i]->GetExpSize();
119 for (j = 0; j < BndExp[i]->GetExpSize(); ++j, ++cnt)
121 int elmtNum = BoundarytoElmtID[cnt];
122 int facetNum = BoundarytoTraceID[cnt];
128 m_f->m_exp[0]->GetExp(elmtNum);
131 switch (elmt->DetShapeType())
135 oppositeNum = (facetNum + 2) % 4;
150 ASSERTL0(
false,
"Surface must be on a triangular "
151 "face of the prism.");
179 ASSERTL0(
false,
"Face out of bound.");
185 ASSERTL0(
false,
"Element not supported");
188 int nq = elmt->GetTotPoints();
189 int nqBnd = bndElmt->GetTotPoints();
195 elmt->GetCoords(x[0], x[1], x[2]);
199 BndExp[i]->UpdatePhys() + BndExp[i]->GetPhys_Offset(j);
205 for (k = 0; k < expdim; ++k)
211 elmt->GetEdgePhysVals(facetNum, bndElmt, x[k], face1);
212 elmt->GetEdgePhysVals(oppositeNum, bndElmt, x[k],
215 if (elmt->GetEorient(facetNum) ==
216 elmt->GetEorient(oppositeNum))
226 elmt->GetForient(facetNum);
227 elmt->GetFacePhysVals(facetNum, bndElmt, x[k], face1,
229 elmt->GetFacePhysVals(oppositeNum, bndElmt, x[k], face2,
234 ASSERTL0(
false,
"Expansion not supported");
237 Vmath::Vvtvp(nqBnd, face1, 1, face1, 1, dist, 1, dist, 1);
242 BndExp[i]->FwdTrans(BndExp[i]->GetPhys(), BndExp[i]->UpdateCoeffs());
map< string, ConfigOption > m_config
List of configuration values.
#define ASSERTL0(condition, msg)
virtual void Process(po::variables_map &vm)
Write mesh to output file.
Represents a command-line configuration option.
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
virtual ~ProcessSurfDistance()
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
pair< ModuleType, string > ModuleKey
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
boost::shared_ptr< Field > FieldSharedPtr
boost::shared_ptr< Expansion > ExpansionSharedPtr
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.
void Zero(int n, T *x, const int incx)
Zero vector.
Abstract base class for processing modules.
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.