111 const TiXmlElement *funcNameElmt = pForce->FirstChildElement(
"COEFF");
113 "Requires COEFF tag, specifying function " 114 "name which prescribes absorption layer coefficient.");
115 string funcName = funcNameElmt->GetText();
117 "Function '" + funcName +
"' not defined.");
119 int npts = pFields[0]->GetTotPoints();
127 funcNameElmt = pForce->FirstChildElement(
"BOUNDARYREGIONS");
132 "Unable to process list of BOUNDARYREGIONS in Absorption " 134 std::string(funcNameElmt->GetText()));
137 std::vector<unsigned int> localBRegions;
138 SpatialDomains::BoundaryConditions bcs(
m_session, pFields[0]->GetGraph());
140 SpatialDomains::BoundaryRegionCollection::iterator it1;
142 for (it1 = regions.begin(); it1 != regions.end(); ++it1)
146 localBRegions.push_back(n);
157 std::vector<Array<OneD, const NekDouble> > points;
159 Array<OneD, Array<OneD, NekDouble> > x(3);
160 for (
int i = 0; i < 3; i++)
162 x[i] = Array<OneD, NekDouble>(npts, 0.0);
164 pFields[0]->GetCoords(x[0], x[1], x[2]);
165 for (
int i = 0; i < 3; i++)
167 points.push_back(x[i]);
170 Array<OneD, NekDouble> t(npts, 0.0);
173 Array<OneD, NekDouble> r(npts, 0.0);
174 std::vector<unsigned int>::iterator it;
175 std::vector<BPointPair> inPoints;
176 Array<OneD, Array<OneD, NekDouble> > b(3);
179 int bpts = pFields[0]->GetBndCondExpansions()[*it]->GetNpoints();
180 for (
int i = 0; i < 3; i++)
182 b[i] = Array<OneD, NekDouble>(bpts, 0.0);
184 pFields[0]->GetBndCondExpansions()[*it]->GetCoords(
187 i < pFields[0]->GetBndCondExpansions()[*it]->GetNpoints();
195 m_rtree->insert(inPoints.begin(), inPoints.end());
197 for (
int i = 0; i < npts; ++i)
199 std::vector<BPointPair> result;
200 BPoint sPoint(x[0][i], x[1][i], x[2][i]);
201 m_rtree->query(bgi::nearest(sPoint, 1), std::back_inserter(result));
202 r[i] = bg::distance(sPoint, result[0].first);
206 std::string s_FieldStr;
211 "Variable '" + s_FieldStr +
"' not defined.");
214 m_session->GetFunction(funcName, s_FieldStr);
215 ASSERTL0(ffunc->GetVlist() ==
"x y z t r",
216 "EVARS of " + funcName +
" must be 'r'");
225 std::string s_FieldStr =
m_session->GetVariable(i);
#define ASSERTL0(condition, msg)
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const LibUtilities::SessionReaderSharedPtr &pSession, std::string pName, bool pCache=false)
Get a SessionFunction by name.
bg::model::point< NekDouble, 3, bg::cs::cartesian > BPoint
Array< OneD, Array< OneD, NekDouble > > m_Absorption
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< BRTree > m_rtree
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
std::vector< unsigned int > m_bRegions
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
std::pair< BPoint, unsigned int > BPointPair
std::shared_ptr< Equation > EquationSharedPtr
int m_NumVariable
Number of variables.
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)