39 bool parseIntegers(std::vector<int>& values,
const char* argv);
70 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
bool& val);
77 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
int& val);
85 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
char& val,
86 bool useIntValue =
true);
93 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
101 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
Real& val);
109 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
Vec3& val,
117 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
118 std::vector<int>& val);
127 int getAttribute(
const tinyxml2::XMLElement* xml,
const char* att,
128 std::string& val,
bool toLower =
false);
132 const char*
getValue(
const tinyxml2::XMLNode* xml,
const char* tag);
137 bool parseKnots(
const tinyxml2::XMLNode* xml, std::vector<Real>& xi);
164 int gather(
const std::vector<int>& index,
size_t nr,
165 const std::vector<Real>& in, std::vector<Real>& out,
166 size_t offset_in = 0,
size_t nskip = 0);
175 int gather(
const std::vector<int>& index,
size_t nr,
177 size_t offset_in = 0,
size_t nskip = 0);
188 int gather(
const std::vector<int>& index,
size_t ir,
size_t nr,
189 const std::vector<Real>& in, std::vector<Real>& out,
190 size_t offset_in = 0,
int shift_idx = 0,
size_t nskip = 0);
198 void interleave(
const std::vector<Real>& v1,
const std::vector<Real>& v2,
199 std::vector<Real>& out,
size_t n1 = 1,
size_t n2 = 1);
210 std::string
adjustRight(
size_t width,
const std::string& s,
211 const std::string& suffix =
" : ");
226 int findIndex(
const std::vector<int>& iVec,
int iVal);
231 void merge(std::vector<int>& a1,
const std::vector<int>& a2);
235 void merge(std::vector<Real>& a1,
const std::vector<Real>& a2,
236 const std::vector<int>& k1,
const std::vector<int>& k2);
#define Real
The floating point type to use.
Definition: ImmersedBoundaries.h:18
std::map< int, int > IntMap
Convenience type alias.
Definition: Utilities.h:29
Simple class for representing a point in 3D space.
Definition: Vec3.h:27
Simple template classes for dense rectangular matrices and vectors.
General utility classes and functions.
Definition: SIMoptions.h:22
int gather(const std::vector< int > &index, size_t nr, const std::vector< Real > &in, std::vector< Real > &out, size_t offset_in=0, size_t nskip=0)
Compresses the rows of a 2D array based on given scatter indices.
Definition: Utilities.C:376
std::set< int > getDigits(int value)
Splits an integer into its (unique) digits in ascending order.
Definition: Utilities.C:463
bool parseKnots(std::vector< Real > &xi)
Parses a (possibly graded) sequence of knot values.
Definition: Utilities.C:74
Real round(Real value, int pr)
Rounds off value down to pr significant digits.
Definition: Utilities.C:555
const char * getValue(const tinyxml2::XMLNode *xml, const char *tag)
Returns the value (if any) of the specified XML-node.
Definition: Utilities.C:319
void merge(std::vector< int > &a1, const std::vector< int > &a2)
Merges integer array a2 into array a1.
Definition: Utilities.C:524
void interleave(const std::vector< Real > &v1, const std::vector< Real > &v2, std::vector< Real > &out, size_t n1=1, size_t n2=1)
Merges two arrays of nodal values into one array by interleaving.
Definition: Utilities.C:541
char * readLine(std::istream &is)
Reads one line, ignoring comment lines and leading blanks.
Definition: Utilities.C:152
int findIndex(const std::vector< int > &iVec, int iVal)
Returns the vector index corresponding to the value iVal.
Definition: Utilities.C:517
int getAttribute(const tinyxml2::XMLElement *xml, const char *att, bool &val)
Extracts a boolean attribute value from the specified XML-element.
Definition: Utilities.C:188
bool parseVec(Vec3 &value, const char *argv)
Parses a character string into a point vector.
Definition: Utilities.C:43
IntMap::const_iterator findValue(const IntMap &iMap, int iVal)
Returns a const iterator to the entry with value iVal.
Definition: Utilities.C:504
bool parseIntegers(std::vector< int > &values, const char *argv)
Parses a character string into an integer or an integer range.
Definition: Utilities.C:22
bool renumber(int &num, int &runner, IntMap &old2new)
Transforms the integer value num into a unique range.
Definition: Utilities.C:347
int findKey(const IntMap &iMap, int iVal)
Returns the key corresponding to the value iVal.
Definition: Utilities.C:510
bool ignoreComments(std::istream &is)
Ignores comment lines and blank lines from an input stream.
Definition: Utilities.C:171
int getDirs(int ncmp)
Makes a direction integer for given number of components.
Definition: Utilities.C:474
size_t find_closest(const std::vector< Real > &a, Real v)
Searches for a real value in an ordered array of reals.
Definition: Utilities.C:439
std::string adjustRight(size_t width, const std::string &s, const std::string &suffix=" : ")
Right-justifies the input string to the given total width.
Definition: Utilities.C:453