47 ModuleKey ProcessSurfDistance::className =
50 ProcessSurfDistance::create,
51 "Computes height of element connected to a surface.");
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..."
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;
151 "Surface must be on a triangular 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], face2);
214 if (elmt->GetEorient(facetNum) ==
215 elmt->GetEorient(oppositeNum))
225 elmt->GetForient(facetNum);
226 elmt->GetFacePhysVals(facetNum, bndElmt,
227 x[k], face1, orientation);
228 elmt->GetFacePhysVals(oppositeNum, bndElmt,
229 x[k], face2, orientation);
233 ASSERTL0(
false,
"Expansion not supported");
236 Vmath::Vvtvp(nqBnd, face1, 1, face1, 1, dist, 1, dist, 1);
241 BndExp[i]->FwdTrans(BndExp[i]->GetPhys(), BndExp[i]->UpdateCoeffs());
virtual ~ProcessSurfDistance()
#define ASSERTL0(condition, msg)
pair< ModuleType, string > ModuleKey
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
map< string, ConfigOption > m_config
List of configuration values.
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
FieldSharedPtr m_f
Field object.
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
boost::shared_ptr< Expansion > ExpansionSharedPtr
boost::shared_ptr< Field > FieldSharedPtr
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.
Represents a command-line configuration option.
void Zero(int n, T *x, const int incx)
Zero vector.
ModuleFactory & GetModuleFactory()
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.