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;
69 int surf =
m_config[
"bnd"].as<
int>();
71 ASSERTL0(surf >= 0,
"Invalid surface "+boost::lexical_cast<string>(surf));
74 m_f->m_bndRegionsToWrite.push_back(surf);
81 m_f->m_exp[0]->GetBndCondExpansions();
85 m_f->m_exp[0]->GetBoundaryToElmtMap(BoundarytoElmtID, BoundarytoTraceID);
87 if (
m_f->m_fielddef.size() == 0)
89 m_f->m_fielddef =
m_f->m_exp[0]->GetFieldDefinitions();
90 m_f->m_fielddef[0]->m_fields.push_back(
"dist");
95 m_f->m_fielddef[0]->m_fields[0] =
"dist";
98 for (i = cnt = 0; i < BndExp.num_elements(); ++i)
102 cnt += BndExp[i]->GetExpSize();
106 for (j = 0; j < BndExp[i]->GetExpSize(); ++j, ++cnt)
108 int elmtNum = BoundarytoElmtID [cnt];
109 int facetNum = BoundarytoTraceID[cnt];
114 m_f->m_exp[0]->GetExp(elmtNum);
117 "Only prisms supported for now!");
119 ASSERTL0(facetNum == 1 || facetNum == 3,
120 "Surface must be on a triangular face of the prism.");
122 int nq = elmt ->GetTotPoints();
123 int nqBnd = bndElmt->GetTotPoints();
129 elmt->GetCoords(x[0], x[1], x[2]);
133 BndExp[i]->UpdatePhys() + BndExp[i]->GetPhys_Offset(j);
139 for (k = 0; k < 3; ++k)
141 elmt->GetFacePhysVals(1, bndElmt, x[k], face1);
142 elmt->GetFacePhysVals(3, bndElmt, x[k], face3);
144 Vmath::Vvtvp(nqBnd, face1, 1, face1, 1, dist, 1, dist, 1);
148 BndExp[i]->FwdTrans(BndExp[i]->GetPhys(), BndExp[i]->UpdateCoeffs());
virtual ~ProcessSurfDistance()
#define ASSERTL0(condition, msg)
pair< ModuleType, string > ModuleKey
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
map< string, ConfigOption > m_config
List of configuration values.
FieldSharedPtr m_f
Field object.
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.
boost::shared_ptr< Expansion > ExpansionSharedPtr
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.