xlifepp – Functions – R#

r3svd#

template<typename T>
LowRankMatrix<T> &xlifepp::r3svd(const LargeMatrix<T> &lm, LowRankMatrix<T> &lrm, real_t eps = theTolerance, number_t t = 0, number_t p = 0, number_t q = 0, number_t maxit = 0)#

r3svd of a LargeMatrix

R3SVD compression method of a LargeMatrix to a LowRankMatrix Lr T: type of the result lm: LargeMatrix to be compressed eps: energy threshold t: number of sampling p: number of over sampling q: power number (q=0 gives the standard r3svd) maxit: maximum of iterations if t = 0, the parameters t, p, q, maxit are determined by function regarding the matrix dimensions lrm: output LowRankMatrix.

template<typename M, typename T>
void xlifepp::r3svd(M &A, real_t eps, number_t &rk, std::vector<T> &U, std::vector<T> &D, std::vector<T> &V, number_t t = 0, number_t p = 0, number_t q = 0, number_t maxit = 0)#

improved Random SVD compression method of a matrix of class M from https://arxiv.org/ftp/arxiv/papers/1605/1605.08134.pdf T: type of the result A: matrix of class M, requires the member functions: M::numberOfRows(), M::numberOfCols(), M::squaredNorm() M::multMatrixRow(T* M, T* R, number_t p) i.e M*matRow M::multLeftMatrixRow(T* M, T* R, number_t p) i.e matRow*M eps: energy threshold rk: rank of r3svd on output U, V: vectors storing dense row matrices S: vector storing S t: number of sampling p: number of over sampling q: power number (q=0 gives the standard r3svd) maxit: maximum of iterations if t = 0, the parameters t, p, q, maxit are determined by function regarding the matrix dimensions

template<typename T>
void xlifepp::r3svd(Matrix<T> &A, Matrix<T> &U, Vector<T> &D, Matrix<T> &V, real_t eps = theTolerance, number_t t = 0, number_t ts = 0, number_t q = 0, number_t maxit = 0)#

Improved random SVD with precision truncation T: type of the matrix (real or complex) A: Matrix to be be factorized eps: energy threshold U,D,V: SVD factors A~U*D*V’ (output) t, ts: number of sampling and oversampling q: power number (q=0 gives the standard r3svd) maxit: maximum of restart if t = 0, the parameters t, p, q and maxit are determined by function regarding the matrix dimensions.

template<typename T>
void xlifepp::r3svd(T *A, number_t m, number_t n, real_t eps, number_t &rk, T *U, T *D, T *V, number_t t = 0, number_t p = 0, number_t q = 0, number_t maxit = 0)#

improved Random SVD compression method of a row dense matrix given by pointer from https://arxiv.org/ftp/arxiv/papers/1605/1605.08134.pdf

T: type of the result A: pointer to the first element of the dense matrix to be compressed, stored as row major access (dense row) m, n: number of rows and cols of matrix to be compressed eps: energy threshold rk: rank of r3svd on output U, V: pointer to dense row matrices, has to be allocated before D: pointer to S vector, has to be allocated before t: number of sampling p: number of over sampling q: power number (q=0 gives the standard r3svd) maxit: maximum of iterations if t = 0, the parameters t, p, q, maxit are determined by function regarding the matrix dimensions

note: may be used when A is a pointer to a m x n col dense matrix, by permuting arguments when calling: r3svd(A,n,m,eps,V,D,U, t, p ,q, maxit) produces the R3SVD of A = U*D*V’ where U, V are pointers to row dense matrices!

ranks#

template<typename T, typename N>
void xlifepp::ranks(const std::map<T, N> &M, const std::vector<T> &V, std::vector<N> &R)#

return in R the ranks of V components in U vector, not assuming that U and V are sorted, N index starts from 1 except if V[k] is not found in map then R[k]=0 faster than previous ranks function but requires a map

template<typename T, typename N>
void xlifepp::ranks(const std::vector<T> &U, const std::vector<T> &V, std::vector<N> &R)#

return in R ranks of V components in U vector, not assuming that U and V are sorted index starts from 1 expansive if U and V are large

template<typename itT, typename itN>
void xlifepp::ranks(itT itu_b, itT itu_e, itT itv_b, itT itv_e, itN itr_b)#

return in R ranks of V components in U container, not assuming that U and V are sorted (index starts from 1) expansive if U and V are large itu_b, itu_e: begin and end iterator for container U itv_b, itv_e: begin and end iterator for container V itr_b: begin iterator for container R (R has to be sized to V size before)

itN must support conversion from Number

readEntities#

template<class T_>
void xlifepp::readEntities(T_ &data, size_t numEnt, Mn_Sn &phystag)#

readEntitiesBin#

template<class T_>
void xlifepp::readEntitiesBin(T_ &data, size_t numEnt, Mn_Sn &phystag)#

readfmt2#

template<class T_>
void xlifepp::readfmt2(T_ &data, const string_t &filename, const vector<CrackData> &crackData, number_t &nb_geom_Pts, vector<real_t> &PointCoords, vector<number_t> &nodeNum, bool &planeDomain, bool &curveDomain, number_t &nb_elts, vector<GELT> &gelts, ELTDEFMAP &elMap, dimen_t &elementDimx, const GMSHMAP &gmMap, set<number_t> &domSet, map<number_t, set<number_t>> &crackedDomSet, map<number_t, number_t> &it_inCrackData, map<number_t, string_t> &domNameMap, bool &isMadeOfSimplices_)#

readfmt2Bin#

void xlifepp::readfmt2Bin(FILE *&data, const string_t &filename, const vector<CrackData> &crackData, number_t &nb_geom_Pts, vector<real_t> &PointCoords, vector<number_t> &nodeNum, bool &planeDomain, bool &curveDomain, number_t &nb_elts, vector<GELT> &gelts, ELTDEFMAP &elMap, dimen_t &elementDimx, const GMSHMAP &gmMap, set<number_t> &domSet, map<number_t, set<number_t>> &crackedDomSet, map<number_t, number_t> &it_inCrackData, map<number_t, string_t> &domNameMap, bool &isMadeOfSimplices_)#
void xlifepp::readfmt2Bin(std::ifstream &data, const string_t &filename, const vector<CrackData> &crackData, number_t &nb_geom_Pts, vector<real_t> &PointCoords, vector<number_t> &nodeNum, bool &planeDomain, bool &curveDomain, number_t &nb_elts, vector<GELT> &gelts, ELTDEFMAP &elMap, dimen_t &elementDimx, const GMSHMAP &gmMap, set<number_t> &domSet, map<number_t, set<number_t>> &crackedDomSet, map<number_t, number_t> &it_inCrackData, map<number_t, string_t> &domNameMap, bool &isMadeOfSimplices_)#

readfmt4#

template<class T_>
void xlifepp::readfmt4(T_ &data, const string_t &filename, const vector<CrackData> &crackData, number_t &nb_geom_Pts, vector<real_t> &PointCoords, vector<number_t> &nodeNum, bool &planeDomain, bool &curveDomain, number_t &nb_elts, vector<GELT> &gelts, ELTDEFMAP &elMap, dimen_t &elementDimx, const GMSHMAP &gmMap, set<number_t> &domSet, map<number_t, set<number_t>> &crackedDomSet, map<number_t, number_t> &it_inCrackData, map<number_t, string_t> &domNameMap, bool &isMadeOfSimplices_)#

readfmt4Bin#

void xlifepp::readfmt4Bin(FILE *&data, const string_t &filename, const vector<CrackData> &crackData, number_t &nb_geom_Pts, vector<real_t> &PointCoords, vector<number_t> &nodeNum, bool &planeDomain, bool &curveDomain, number_t &nb_elts, vector<GELT> &gelts, ELTDEFMAP &elMap, dimen_t &elementDimx, const GMSHMAP &gmMap, set<number_t> &domSet, map<number_t, set<number_t>> &crackedDomSet, map<number_t, number_t> &it_inCrackData, map<number_t, string_t> &domNameMap, bool &isMadeOfSimplices_)#
void xlifepp::readfmt4Bin(std::ifstream &data, const string_t &filename, const vector<CrackData> &crackData, number_t &nb_geom_Pts, vector<real_t> &PointCoords, vector<number_t> &nodeNum, bool &planeDomain, bool &curveDomain, number_t &nb_elts, vector<GELT> &gelts, ELTDEFMAP &elMap, dimen_t &elementDimx, const GMSHMAP &gmMap, set<number_t> &domSet, map<number_t, set<number_t>> &crackedDomSet, map<number_t, number_t> &it_inCrackData, map<number_t, string_t> &domNameMap, bool &isMadeOfSimplices_)#

readInt#

inline void xlifepp::readInt(FILE *data, number_t &Val)#
inline void xlifepp::readInt(std::ifstream &data, number_t &Val)#

readIntBin#

inline void xlifepp::readIntBin(FILE *data, number_t &Val)#
inline void xlifepp::readIntBin(std::ifstream &data, number_t &Val)#

readItem#

void xlifepp::readItem(std::istream&, complex_t&, bool isreal = false)#

read complex item from istream

void xlifepp::readItem(std::istream&, real_t&, bool isreal = true)#

read real item from istream

readPartitionedEntities#

template<class T_>
void xlifepp::readPartitionedEntities(T_ &data, size_t numEnt, Mn_Pnn &parentDT, Mn_Sn &partparttag, Mn_Sn &partphystag)#

readPartitionedEntitiesBin#

template<class T_>
void xlifepp::readPartitionedEntitiesBin(T_ &data, size_t numEnt, Mn_Pnn &parentDT, Mn_Sn &partparttag, Mn_Sn &partphystag)#

readPhysNames#

template<class T_>
void xlifepp::readPhysNames(T_ &data, map<number_t, string_t> &domNameMap)#

readPlyElement#

string_t xlifepp::readPlyElement(PlyElement &e, std::istream &data)#

read element and its properties

readRea#

inline void xlifepp::readRea(FILE *data, real_t &Val)#
inline void xlifepp::readRea(std::ifstream &data, real_t &Val)#

readReaBin#

inline void xlifepp::readReaBin(std::ifstream &data, real_t &Val)#

readStr#

inline bool xlifepp::readStr(FILE *data, string_t &Val)#
inline bool xlifepp::readStr(std::ifstream &data, string_t &Val)#

readStrBin#

inline bool xlifepp::readStrBin(std::ifstream &data, string_t &Val)#

real#

real_t xlifepp::real(const Parameter&)#

cast to real_t

inline SymbolicFunction &xlifepp::real(const SymbolicFunction &f)#
TermMatrix xlifepp::real(const TermMatrix &tm)#

return real part as a real TermMatrix

TermVector xlifepp::real(const TermVector &tv)#

extracts real part

Vector<real_t> xlifepp::real(const Vector<complex_t> &a)#

real part of a complex vector

Vector<real_t> xlifepp::real(const Vector<real_t> &a)#

real part of a real vector

Vector<Vector<real_t>> xlifepp::real(const Vector<Vector<complex_t>> &a)#

abs of a vector of complex vectors

real part of a vector of complex vectors

Vector<Vector<real_t>> xlifepp::real(const Vector<Vector<real_t>> &a)#

abs of a vector of real vectors

real part of a vector of real vectors

real_const_fun#

real_t xlifepp::real_const_fun(const Point &P, Parameters &pa)#

real_matrix_const_fun#

Matrix<real_t> xlifepp::real_matrix_const_fun(const Point &P, Parameters &pa)#

real_vector_const_fun#

Vector<real_t> xlifepp::real_vector_const_fun(const Point &P, Parameters &pa)#

realPart#

inline real_t xlifepp::realPart(const complex_t&)#
Matrix<real_t> xlifepp::realPart(const Matrix<complex_t> &cB)#

real part of a complex matrix

Matrix<real_t> xlifepp::realPart(const Matrix<real_t> &cB)#

real part of a real matrix

inline real_t xlifepp::realPart(const real_t&)#
inline SuTermVector xlifepp::realPart(const SuTermVector &s)#

mathematical function applied to SuTermVector

realTpl#

template<typename T1_iterator, typename R_iterator>
void xlifepp::realTpl(T1_iterator b1, T1_iterator e1, R_iterator Rb)#

returns real part of vector entries: R[i] = real(T1[i])

rebuild#

void xlifepp::rebuild(GeomDomain &dom, const ComparisonFunction<> &cr)#

rebuild one plain domain

rebuild 1 plain domain

void xlifepp::rebuild(GeomDomain &dom, const ComparisonFunction<> &cr, GeomDomain &sdom)#

rebuild one plain domain and one side domain

rebuild 1 plain domain and one side domain

void xlifepp::rebuild(GeomDomain &dom1, const ComparisonFunction<> &cr1, GeomDomain &dom2, const ComparisonFunction<> &cr2)#

rebuild 2 plain domains

void xlifepp::rebuild(GeomDomain &dom1, const ComparisonFunction<> &cr1, GeomDomain &dom2, const ComparisonFunction<> &cr2, GeomDomain &sdom)#

rebuild 2 plain domains and one side domain

rebuild 2 plain domains

rebuild 2 plain domains and one side domain

void xlifepp::rebuild(GeomDomain &dom1, const ComparisonFunction<> &cr1, GeomDomain &dom2, const ComparisonFunction<> &cr2, GeomDomain &sdom1, GeomDomain &sdom2)#

rebuild 2 plain domains and two side domains

void xlifepp::rebuild(std::vector<GeomDomain*> &doms, const std::vector<ComparisonFunction<>> &crs, const std::set<GeomDomain*> &sidedoms)#

rebuild some plain domains using criteria, the rebuilding works as follow:

rebuild some plain domains

  • rebuild each of given domains by using ComparisonFunction and element color

  • update side domains related to given domains (boundary or interface)

ComparaisonFunction’s are objects that handles simple boolean expressions involving boolean operator (e.g. _color == 0) For instance to update two domains dom1, dom2 distinguished by values 0 and 1 rebuild(dom1, _color==0, dom2, _color==1);

doms: list of domain to be rebuilt crs: list of related comparison criteria sidedoms: set of side domains to be rebuilt, if empty rebuild all side domains found rebuild some plain domains

rebuildEliminatedComponents#

void xlifepp::rebuildEliminatedComponents(VectorEntry *x, const std::vector<DofComponent> &cdofs, const Constraints *cons)#

rectangle#

template<typename T>
T xlifepp::rectangle(const std::vector<T> &f, real_t h)#
template<typename T, typename Iterator>
T xlifepp::rectangle(number_t n, real_t h, Iterator itb, T &intg)#

uniform rectangle method from a list of n values uniformaly distributed (step h) n: number of values h: step itb: first position in the list of values intg: value of integral: h sum k=1,n v_k

template<typename T>
T xlifepp::rectangle(T (*f)(real_t), real_t a, real_t b, number_t n)#

uniform rectangle method on [a,b] interval from a function and a number of subdivisions

template<typename T>
T xlifepp::rectangle(T (*f)(real_t, Parameters&), Parameters &pars, real_t a, real_t b, number_t n)#

uniform rectangle method on [a,b] interval from a function with parameters and a number of subdivisions

reducedColumns#

static std::vector<std::vector<std::pair<number_t, complex_t>>> xlifepp::reducedColumns(const Constraints &cs)#

perform pseudo reduction of reduced essential conditions in a matrix.

Essential conditions have the following form : U_E + F*U_R = H for column unknown U V_E + G*V_R = 0 for row test function V (generally related to unknown U) where E are the eliminated unknown/test function indices and R are the reduced unknown/test function indices other indices S correspond to dofs not connected to the essential conditions dofs The pseudo reduction of matrix consists in

  • modifying column A.j for j in R by adding -Fkj*A.k for k in E and replacing column A.k for k in E by a 0 column

  • modifying row Ai. for i in R by adding -Gki*Ak. for k in E and replacing row Ak. for k in E by a 0 row

  • if eliminated v unknowns are dual of eliminated u unknowns (G=F), the VE rows are replaced by the equation (or a part of) a*U_E + a*F*U_R = a*H where a is a given scalar to delay the right hand side modification, the (A.k) columns (k in E) are stored in a new structure

At the end of the process, the eliminated system looks like (C the correction matrix mxE get from reduction of the constaints)

               U_E       U_R     U_S        U        RHS
           ----------------------------   -------   -------
           |          |        |      |   |     |   |     |
      V_E  | (a+b)*Id |  a*F   |   0  |   | U_E |   | a*H |    => (a+b)*U_E + a*F*U_R = a*H (mimics the constraints)
           |          |        |      |   |     |   |     |
           ----------------------------   -------   -------
           |          |        |      |   |     |   |     |
      V_R  |     0    |  A_RR  | A_RS | * | U_R | = | B_R |    = B0_R - C_RE*H -Gt*B0_E  (rhs correction on reduced dof)
           |          |        |      |   |     |   |     |
           ----------------------------   -------   ------
           |          |       |       |   |     |   |     |
      V_S  |     0    |  A_SR | A_SS  |   | U_S |   | B_S |    = B0_S - C_SE*H           (rhs correction on free dofs)
           |          |       |       |   |     |   |     |
           ----------------------------   -------   -------
If F=G=0 (Dirichlet condition) , R={} and the system reads
               U_E       U_S         U        RHS
           --------------------   -------   -------
           |          |       |   |     |   |     |
      V_E  | (a+b)*Id |   0   |   | U_E |   | a*H |    => (a+b)*U_E = a*H  (constraints)
           |          |       |   |     |   |     |
           -------------------  * ------- = -------
           |          |       |   |     |   |     |
      V_S  |     0    |  A_SS |   | U_S |   | B_S |    = B0_S - C_SE*H    (rhs correction)
           |          |       |   |     |   |     |
           --------------------   -------   -------
           for homogeneous dirichlet condition H=0 and B_S = B0_S!
In some cases (F=G=0 or non dof coupling condition…) the storage is not modified but in other cases (transmission condition for instance) the storage is modified

choosing a=0,b!=0 allows to deal with eigen value problems by shifing the spectra corresponding to eliminated dof

mat : matrix to be eliminated cdofr: row component dofs of matrix cdofc: col component dofs of matrix rhsmat: right hand side matrix pointer

tools for the elimination process, the reduced constraints read U_E + F*U_R = g (see reduceConstraints) the elimination loops travel only the non zero coefficients of F (instead of all the pairs (eliminated, reduced) cdofs)

reducedColumns: non zero coefficients of F by column, fcols[j-1] = list of (i, F(i,j)), i rank of eliminated cdof (1..nbe), j rank of reduced cdof (1..nbr) eliminatedPositions: positions in matrix numbering of eliminated cdofs indexed by their rank (0 if not in matrix) reducedPositions: list of (position in matrix numbering, rank) of reduced cdofs the dual cdof is used when a cdof is not found in the constraints

reducedPositions#

static std::vector<std::pair<number_t, number_t>> xlifepp::reducedPositions(const Constraints &cs, const std::map<DofComponent, number_t> &mrecdofs)#

reduceMatrix#

void xlifepp::reduceMatrix(MatrixEntry *&mat, std::vector<DofComponent> &cdofsr, std::vector<DofComponent> &cdofsc, std::vector<DofComponent> &redcdofsr, std::vector<DofComponent> &redcdofsc, const Constraints *cu, const Constraints *cv)#

full reduction of a pseudo-reduced matrix, assuming scalar matrix entries create a new storage from old one by eliminating row en col index related to eliminated dof note: cdofsr and cdofsc are not modified !!!

full reduction of a pseudo-reduced matrix, assuming scalar matrix entries

mat: the matrix to be reduced cdofsr: row dof numbering of mat cdofsc: col dof numbering of mat redcdofsr: row dof numbering of reduced mat redcdofsc: col dof numbering of reduced mat cu, cv: u and v constraint pointers

reflect2d#

template<class Geom>
Geom xlifepp::reflect2d(const Geom &g, const Parameter &p1)#

apply a reflection 2d on a Geom (1 key) (template external)

template<class Geom>
Geom xlifepp::reflect2d(const Geom &g, const Parameter &p1, const Parameter &p2)#

apply a reflection 2d on a Geom (2 keys) (template external)

template<class Geom>
Geom xlifepp::reflect2d(const Geom &g, const Point &c, real_t dx, real_t dy = 0.)#

apply a reflection 2d on a Geom (template external)

template<class Geom>
Geom xlifepp::reflect2d(const Geom &g, const Point &c = Point(0., 0.), std::vector<real_t> d = std::vector<real_t>(2, 0.))#

apply a reflection 2d on a Geom (template external)

inline Geometry xlifepp::reflect2d(const Geometry &g, const Parameter &p1)#

apply a reflection 2d on a Geometry (1 key) (template external)

inline Geometry xlifepp::reflect2d(const Geometry &g, const Parameter &p1, const Parameter &p2)#

apply a reflection 2d on a Geometry (2 keys) (template external)

inline Geometry xlifepp::reflect2d(const Geometry &g, const Point &c, real_t dx, real_t dy = 0.)#

apply a reflection 2d on a Geometry (template external)

inline Geometry xlifepp::reflect2d(const Geometry &g, const Point &c = Point(0., 0.), std::vector<real_t> d = std::vector<real_t>(2, 0.))#

apply a reflection 2d on a Geometry (template external)

Mesh xlifepp::reflect2d(const Mesh &m, const Parameter &p1)#

apply a reflection2d on a Mesh (1 key)

apply a reflection 2D on a Mesh (1 key) (external)

Mesh xlifepp::reflect2d(const Mesh &m, const Parameter &p1, const Parameter &p2)#

apply a reflection2d on a Mesh (2 keys)

apply a reflection 2D on a Mesh (2 keys) (external)

Mesh xlifepp::reflect2d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a reflection2d on a Mesh (3 keys)

apply a reflection 2D on a Mesh (3 keys) (external)

Mesh xlifepp::reflect2d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3, const Parameter &p4)#

apply a reflection2d on a Mesh (4 keys)

apply a reflection 2D on a Mesh (4 keys) (external)

Mesh xlifepp::reflect2d(const Mesh &m, const Point &c, real_t ux, real_t uy = 0.)#

apply a reflection2d on a Mesh (external)

apply a reflection 2D on a Mesh (external)

Mesh xlifepp::reflect2d(const Mesh &m, const Point &c, std::vector<real_t> u = std::vector<real_t>(2, 0.))#

apply a reflection2d on a Mesh (external)

apply a reflection 2D on a Mesh (external)

inline Point xlifepp::reflect2d(const Point &g, const Parameter &p1)#

apply a reflection 2d on a Point (1 key) (template external)

inline Point xlifepp::reflect2d(const Point &g, const Parameter &p1, const Parameter &p2)#

apply a reflection 2d on a Point (2 keys) (template external)

inline Point xlifepp::reflect2d(const Point &g, const Point &c, real_t dx, real_t dy = 0.)#

apply a reflection 2d on a Point (template external)

inline Point xlifepp::reflect2d(const Point &g, const Point &c = Point(0., 0.), std::vector<real_t> d = std::vector<real_t>(2, 0.))#

apply a reflection 2d on a Point (template external)

reflect3d#

template<class Geom>
Geom xlifepp::reflect3d(const Geom &g, const Parameter &p1)#

apply a reflection 3d on a Geom (1 key) (template external)

template<class Geom>
Geom xlifepp::reflect3d(const Geom &g, const Parameter &p1, const Parameter &p2)#

apply a reflection 3d on a Geom (2 keys) (template external)

template<class Geom>
Geom xlifepp::reflect3d(const Geom &g, const Point &c, real_t nx, real_t ny, real_t nz = 0.)#

apply a reflection 3d on a Geom (template external)

template<class Geom>
Geom xlifepp::reflect3d(const Geom &g, const Point &c = Point(0., 0., 0.), std::vector<real_t> n = std::vector<real_t>(3, 0.))#

apply a reflection 3d on a Geom (template external)

inline Geometry xlifepp::reflect3d(const Geometry &g, const Parameter &p1)#

apply a reflection 3d on a Geometry (1 key) (template external)

inline Geometry xlifepp::reflect3d(const Geometry &g, const Parameter &p1, const Parameter &p2)#

apply a reflection 3d on a Geometry (2 keys) (template external)

inline Geometry xlifepp::reflect3d(const Geometry &g, const Point &c, real_t nx, real_t ny, real_t nz = 0.)#

apply a reflection 3d on a Geometry (template external)

inline Geometry xlifepp::reflect3d(const Geometry &g, const Point &c = Point(0., 0., 0.), std::vector<real_t> n = std::vector<real_t>(3, 0.))#

apply a reflection 3d on a Geometry (template external)

Mesh xlifepp::reflect3d(const Mesh &m, const Parameter &p1)#

apply a reflection3d on a Mesh (1 key)

apply a reflection 3D on a Mesh (1 key) (external)

Mesh xlifepp::reflect3d(const Mesh &m, const Parameter &p1, const Parameter &p2)#

apply a reflection3d on a Mesh (2 keys)

apply a reflection 3D on a Mesh (2 keys) (external)

Mesh xlifepp::reflect3d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a reflection3d on a Mesh (3 keys)

apply a reflection 3D on a Mesh (3 keys) (external)

Mesh xlifepp::reflect3d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3, const Parameter &p4)#

apply a reflection3d on a Mesh (4 keys)

apply a reflection 3D on a Mesh (4 keys) (external)

Mesh xlifepp::reflect3d(const Mesh &m, const Point &c, real_t ux, real_t uy, real_t uz = 0.)#

apply a reflection3d on a Mesh (external)

apply a reflection 3D on a Mesh (external)

Mesh xlifepp::reflect3d(const Mesh &m, const Point &c, std::vector<real_t> u = std::vector<real_t>(3, 0.))#

apply a reflection3d on a Mesh (external)

apply a reflection 3D on a Mesh (external)

inline Point xlifepp::reflect3d(const Point &g, const Parameter &p1)#

apply a reflection 3d on a Point (1 key) (template external)

inline Point xlifepp::reflect3d(const Point &g, const Parameter &p1, const Parameter &p2)#

apply a reflection 3d on a Point (2 keys) (template external)

inline Point xlifepp::reflect3d(const Point &g, const Point &c, real_t nx, real_t ny, real_t nz = 0.)#

apply a reflection 3d on a Point (template external)

inline Point xlifepp::reflect3d(const Point &g, const Point &c = Point(0., 0., 0.), std::vector<real_t> n = std::vector<real_t>(3, 0.))#

apply a reflection 3d on a Point (template external)

RegularConeSphereTri#

Mesh xlifepp::RegularConeSphereTri(const Point &C, const std::vector<real_t> &d, real_t hc, real_t rc, real_t apl, number_t ns, number_t nb, MeshGenerator mg = _subdiv, const std::vector<string_t> &domname = {"Omega"}, const string_t &edgename = "", const std::vector<string_t> &vertexnames = std::vector<string_t>(), bool namingSection = false)#

create triangular mesh of a regular cone-sphere

release#

template<typename T, template<class> class OP, class CP, template<class> class KP, template<class> class SP, template<class> class CNP>
inline void xlifepp::release(SmartPtr<T, OP, CP, KP, SP, CNP> &sp, typename SP<T>::StoredType &p)#

removeChar#

string_t &xlifepp::removeChar(string_t &s, char c)#

remove all char c from string s

removeElts#

void xlifepp::removeElts(std::set<GeomElement*> &elts, const std::set<number_t> &vSideCrack)#

removeEndParenthesis#

bool xlifepp::removeEndParenthesis(string_t &s)#

removeMap#

void xlifepp::removeMap(const GeomDomain&, const GeomDomain&)#

remove map d1->d2

removePlusMinus#

void xlifepp::removePlusMinus(string_t &s)#

removeSmallValue#

template<typename K>
void xlifepp::removeSmallValue(MatrixEigenDense<K> &mat)#

removeZerosUmfPack#

template<typename T>
void xlifepp::removeZerosUmfPack(std::vector<int_t> &colPointer, std::vector<int_t> &rowIndex, std::vector<T> &values)#

renumber#

std::vector<number_t> xlifepp::renumber(const Space *sp1, const Space *sp2)#

renumber dofs of a space (sp2) along dof numbering of space (sp1) if the spaces are the same nothing is done: the result is of size 0 if the spaces are not the same: rn is the renumbering vector if sp2 is larger than sp1 : exemple sp1 = 8 4 5 1 4 7 6 sp2 = 3 5 7 4 rn = 0 3 6 5 0 means that 3 does not belong to sp1 3 means that 5 is the third element of sp1 … if sp1 is larger than sp2 : exemple sp1 = 4 3 6 8 sp2 = 1 2 3 4 5 6 7 8 9 rn = 0 0 2 1 0 3 0 8 0 0 means that 1,2,5, … does not belong to sp1 2 means that 3 is the second element of sp1 …

renumber dofs of a space along dof numbering of an another space

return sub-space or trace space on domain of a space, created if not exist

std::vector<number_t> xlifepp::renumber(const std::vector<DofComponent> &cdv1, const std::vector<DofComponent> &cdv2)#

renumber cdofs vector (cdv2) along cdofs vector (cdv1) assuming cdof of cdv1 are unique if cdv1=cdv2 nothing is done: the result is of size 0 if cdv1!=cdv2 : rn is the renumbering vector ex: cdv1 = cd8 cd4 cd5 cd1 cd4 cd7 cd6 cdv2 = cd3 cd5 cd7 cd4 rn = 0 3 6 5 0 means that cd3 does not belong to cdv1 3 means that cd5 is the third cdofs of cdv1 …

renumbering cdofs utility

replaceChar#

string_t &xlifepp::replaceChar(string_t &s, char c1, char c2)#

replace all char c1 by char c2 in string s

replace char c1 by char c2 in string s

replaceString#

string_t &xlifepp::replaceString(string_t &s, const string_t &s1, const string_t &s2)#

replace all string s1 by string s2 in string s

replace string s1 by string s2 in string s

reset#

template<typename T, template<class> class OP, class CP, template<class> class KP, template<class> class SP, template<class> class CNP>
inline void xlifepp::reset(SmartPtr<T, OP, CP, KP, SP, CNP> &sp, typename SP<T>::StoredType p)#

resetThreadData#

void xlifepp::resetThreadData()#

resize#

template<typename T>
void xlifepp::resize(Matrix<T> &v, dimen_t m, dimen_t n)#
template<typename T>
void xlifepp::resize(std::vector<T> &v, dimen_t m, dimen_t n)#
template<typename T>
void xlifepp::resize(T &v, dimen_t m, dimen_t n)#

resizeThreadData#

void xlifepp::resizeThreadData(number_t)#

resize global vectors currentNxs, currentNys, …

reverseTriangleOrientation#

void xlifepp::reverseTriangleOrientation(const std::vector<GeomElement*> &elements)#

rhoExt#

real_t xlifepp::rhoExt(real_t t, real_t a = 0.5)#

rightPath#

string_t xlifepp::rightPath(const string_t &path)#

adapt path to OS format (WIN/LINUX like)

rk4#

template<typename T>
Vector<T> xlifepp::rk4(T &(*f)(real_t, const T&, T&), real_t a, real_t b, real_t dt, const T &y0)#
template<typename T, typename P>
Vector<T> xlifepp::rk4(T &(*f)(real_t, const T&, T&, P&), real_t a, real_t b, real_t dt, const T &y0, P &pars)#

rot#

OperatorOnUnknown &xlifepp::rot(const Unknown &un)#

rot_x#

OperatorOnKernel &xlifepp::rot_x(const Kernel&)#

curl_x(k)

OperatorOnKernel &xlifepp::rot_x(OperatorOnKernel&)#

curl_x(opk)

rot_y#

OperatorOnKernel &xlifepp::rot_y(const Kernel&)#

curl_y(k)

OperatorOnKernel &xlifepp::rot_y(OperatorOnKernel&)#

curl_y(opk)

rotate2d#

template<class Geom>
Geom xlifepp::rotate2d(const Geom &g, const Parameter &p1)#

apply a rotation 2d on a Geom (1 key) (template external)

template<class Geom>
Geom xlifepp::rotate2d(const Geom &g, const Parameter &p1, const Parameter &p2)#

apply a rotation 2d on a Geom (2 keys) (template external)

template<class Geom>
Geom xlifepp::rotate2d(const Geom &g, const Point &c = Point(0., 0.), real_t angle = 0.)#

apply a rotation 2d on a Geom (template external)

inline Geometry xlifepp::rotate2d(const Geometry &g, const Parameter &p1)#

apply a rotation 2d on a Geometry (1 key) (template external)

inline Geometry xlifepp::rotate2d(const Geometry &g, const Parameter &p1, const Parameter &p2)#

apply a rotation 2d on a Geometry (2 keys) (template external)

inline Geometry xlifepp::rotate2d(const Geometry &g, const Point &c = Point(0., 0.), real_t angle = 0.)#

apply a rotation 2d on a Geometry (template external)

Mesh xlifepp::rotate2d(const Mesh &m, const Parameter &p1)#

apply a rotation on a Mesh (1 key)

apply a rotation 2D on a Mesh (1 key) (external)

Mesh xlifepp::rotate2d(const Mesh &m, const Parameter &p1, const Parameter &p2)#

apply a rotation on a Mesh (2 keys)

apply a rotation 2D on a Mesh (2 keys) (external)

Mesh xlifepp::rotate2d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a rotation on a Mesh (3 keys)

apply a rotation 2D on a Mesh (3 keys) (external)

Mesh xlifepp::rotate2d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3, const Parameter &p4)#

apply a rotation on a Mesh (4 keys)

apply a rotation 2D on a Mesh (4 keys) (external)

Mesh xlifepp::rotate2d(const Mesh &m, const Point &c, real_t angle = 0.)#

apply a rotation on a Mesh (external)

apply a rotation 2D on a Mesh (external)

inline Point xlifepp::rotate2d(const Point &g, const Parameter &p1)#

apply a rotation 2d on a Point (1 key) (template external)

inline Point xlifepp::rotate2d(const Point &g, const Parameter &p1, const Parameter &p2)#

apply a rotation 2d on a Point (2 keys) (template external)

inline Point xlifepp::rotate2d(const Point &g, const Point &c = Point(0., 0.), real_t angle = 0.)#

apply a rotation 2d on a Point (template external)

rotate3d#

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, const Parameter &p1)#

apply a rotation 3d on a Geom (1 key) (template external)

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, const Parameter &p1, const Parameter &p2)#

apply a rotation 3d on a Geom (2 keys) (template external)

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a rotation 3d on a Geom (3 keys) (template external)

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, const Point &c, real_t dx, real_t dy, real_t angle)#

apply a rotation 3d on a Geom (template external)

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, const Point &c, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation 3d on a Geom (template external)

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, const Point &c = Point(0., 0., 0.), std::vector<real_t> d = std::vector<real_t>(3, 0.), real_t angle = 0.)#

apply a rotation 3d on a Geom (template external)

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, real_t dx, real_t dy, real_t angle)#

apply a rotation 3d on a Geom (template external)

template<class Geom>
Geom xlifepp::rotate3d(const Geom &g, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation 3d on a Geom (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, const Parameter &p1)#

apply a rotation 3d on a Geometry (1 key) (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, const Parameter &p1, const Parameter &p2)#

apply a rotation 3d on a Geometry (2 keys) (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a rotation 3d on a Geometry (3 keys) (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, const Point &c, real_t dx, real_t dy, real_t angle)#

apply a rotation 3d on a Geometry (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, const Point &c, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation 3d on a Geometry (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, const Point &c = Point(0., 0., 0.), std::vector<real_t> d = std::vector<real_t>(3, 0.), real_t angle = 0.)#

apply a rotation 3d on a Geometry (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, real_t dx, real_t dy, real_t angle)#

apply a rotation 3d on a Geometry (template external)

inline Geometry xlifepp::rotate3d(const Geometry &g, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation 3d on a Geometry (template external)

Mesh xlifepp::rotate3d(const Mesh &m, const Parameter &p1)#

apply a rotation on a Mesh (1 key)

apply a rotation 3D on a Mesh (4 keys) (external)

Mesh xlifepp::rotate3d(const Mesh &m, const Parameter &p1, const Parameter &p2)#

apply a rotation on a Mesh (2 keys)

apply a rotation 3D on a Mesh (4 keys) (external)

Mesh xlifepp::rotate3d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a rotation on a Mesh (3 keys)

apply a rotation 3D on a Mesh (4 keys) (external)

Mesh xlifepp::rotate3d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3, const Parameter &p4)#

apply a rotation on a Mesh (4 keys)

apply a rotation 3D on a Mesh (4 keys) (external)

Mesh xlifepp::rotate3d(const Mesh &m, const Parameter &p1, const Parameter &p2, const Parameter &p3, const Parameter &p4, const Parameter &p5)#

apply a rotation on a Mesh (5 keys)

apply a rotation 3D on a Mesh (4 keys) (external)

Mesh xlifepp::rotate3d(const Mesh &m, const Point &c, real_t ux, real_t uy, real_t angle)#

apply a rotation on a Mesh (external)

apply a rotation 3D on a Mesh (external)

Mesh xlifepp::rotate3d(const Mesh &m, const Point &c, real_t ux, real_t uy, real_t uz, real_t angle)#

apply a rotation on a Mesh (external)

apply a rotation 3D on a Mesh (external)

Mesh xlifepp::rotate3d(const Mesh &m, const Point &c, std::vector<real_t> u = std::vector<real_t>(3, 0.), real_t angle = 0.)#

apply a rotation on a Mesh (external)

apply a rotation 3D on a Mesh (external)

Mesh xlifepp::rotate3d(const Mesh &m, real_t ux, real_t uy, real_t angle)#

apply a rotation on a Mesh (external)

apply a rotation 3D on a Mesh (external)

Mesh xlifepp::rotate3d(const Mesh &m, real_t ux, real_t uy, real_t uz, real_t angle)#

apply a rotation on a Mesh (external)

apply a rotation 3D on a Mesh (external)

inline Point xlifepp::rotate3d(const Point &g, const Parameter &p1)#

apply a rotation 3d on a Point (1 key) (template external)

inline Point xlifepp::rotate3d(const Point &g, const Parameter &p1, const Parameter &p2)#

apply a rotation 3d on a Point (2 keys) (template external)

inline Point xlifepp::rotate3d(const Point &g, const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a rotation 3d on a Point (3 keys) (template external)

inline Point xlifepp::rotate3d(const Point &g, const Point &c, real_t dx, real_t dy, real_t angle)#

apply a rotation 3d on a Point (template external)

inline Point xlifepp::rotate3d(const Point &g, const Point &c, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation 3d on a Point (template external)

inline Point xlifepp::rotate3d(const Point &g, const Point &c = Point(0., 0., 0.), std::vector<real_t> d = std::vector<real_t>(3, 0.), real_t angle = 0.)#

apply a rotation 3d on a Point (template external)

inline Point xlifepp::rotate3d(const Point &g, real_t dx, real_t dy, real_t angle)#

apply a rotation 3d on a Point (template external)

inline Point xlifepp::rotate3d(const Point &g, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation 3d on a Point (template external)

rotG#

OperatorOnUnknown &xlifepp::rotG(const Unknown &un, const complex_t &ax, const complex_t &ay, const complex_t &az, const complex_t &at)#

rotS#

OperatorOnUnknown &xlifepp::rotS(const Unknown &un)#

round#

inline complex_t xlifepp::round(const complex_t &z, real_t prec)#
inline real_t xlifepp::round(const real_t &x, real_t prec)#
template<typename T>
std::list<T> xlifepp::round(const std::list<T> &l, real_t prec)#
template<typename K, typename T>
std::map<K, T> xlifepp::round(const std::map<K, T> &m, real_t prec)#
template<typename T>
std::vector<T> xlifepp::round(const std::vector<T> &v, real_t prec)#
template<typename T>
const T &xlifepp::round(const T &t, real_t prec)#
template<typename T>
int_t xlifepp::round(const T &v)#

round to nearest integer

template<typename T>
Vector<T> xlifepp::round(const Vector<T> &v, real_t prec)#
template<typename Iterator>
void xlifepp::round(Iterator itb, Iterator ite, Iterator rt, real_t prec)#

roundToZero#

inline complex_t xlifepp::roundToZero(const complex_t &v, real_t asZero = std::sqrt(theEpsilon))#
inline real_t xlifepp::roundToZero(const real_t &v, real_t asZero = std::sqrt(theEpsilon))#

round to zero for scalars

template<typename T>
std::vector<T> xlifepp::roundToZero(const std::vector<T> &v, real_t asZero = std::sqrt(theEpsilon))#

round to zero for vectors

TermMatrix xlifepp::roundToZero(const TermMatrix &tm, real_t aszero = 10 * theEpsilon)#

return the 0 rounded TermMatrix)

return the 0 rounded TermMatrix

template<typename T>
Vector<T> xlifepp::roundToZero(const Vector<T> &v, real_t asZero = std::sqrt(theEpsilon))#

rsvd#

template<typename T>
LowRankMatrix<T> &xlifepp::rsvd(const LargeMatrix<T> &lm, LowRankMatrix<T> &lrm, number_t r = 0, real_t eps = theTolerance)#

rsvd of a LargeMatrix

RSVD compression method of a LargeMatrix to a LowRankMatrix Lr T: type of the result lm: LargeMatrix to be compressed r: prescribed rank of truncature, if 0 not used, the real rank at output eps: prescribed precision, if rk > 0 not used r=0 and eps=0 gives the full svd lrm: LowRankMatrix.

template<typename M, typename T>
void xlifepp::rsvd(M &A, number_t r, std::vector<T> &U, std::vector<T> &D, std::vector<T> &V)#

Random SVD compression method of a matrix of class M T: type of the result A: matrix of class M, requires the member functions: M::numberOfRows(), M::numberOfCols() M::multMatrixRow(T* M, T* R, number_t p) i.e M*matRow M::multLeftMatrixRow(T* M, T* R, number_t p) i.e matRow*M r: prescribed rank >0 of truncature U, V: vectors storing dense row matrices S: vector storing S.

template<typename M, typename T>
void xlifepp::rsvd(M &A, real_t eps, number_t &rk, std::vector<T> &U, std::vector<T> &D, std::vector<T> &V)#

Random SVD compression method of a matrix of class M from the paper: Stephanie Chaillat, George Biros.

FaIMS: A fast algorithm for the inverse medium problem with multiple frequencies and multiple sources for the scalar Helmholtz equation. Journal of Computational Physics, Elsevier, 2012, 231 (12), pp.4403-4421. T: type of the result A: matrix of class M, requires the member functions: M::numberOfRows(), M::numberOfCols() M::multMatrixRow(T* M, T* R, number_t p) i.e M*matRow M::multLeftMatrixRow(T* M, T* R, number_t p) i.e matRow*M eps: desired precision for the SVD matrix rk: rank of rsvd on output U, V: vectors storing dense row matrices S: vector storing S

template<typename T>
void xlifepp::rsvd(Matrix<T> &A, Matrix<T> &U, Vector<T> &D, Matrix<T> &V, number_t r = 0, real_t eps = theTolerance)#

Random SVD with either rank or precision truncation T: type of the matrix (real or complex) A: Matrix to be be factorized U,D,V: SVD factors A~U*D*V’ (output) r: prescribed rank eps: energy threshold if r > 0, the SVD is restricted to the first r singular values else it is restricted to the first singular values smaller than eps.

template<typename T>
void xlifepp::rsvd(T *A, number_t m, number_t n, number_t r, T *U, T *D, T *V)#

Random SVD compression method of a row dense matrix given by pointer T: type of the result A: pointer to the first element of the dense matrix to be compressed, stored as row major access (dense row) m, n: number of rows and cols of matrix to be compressed r: prescribed rank >0 of truncature U, V: pointer to dense row matrices, has to be allocated before S: pointer to S vector, has to be allocated before.

note: may be used when A is a pointer to a m x n col dense matrix, by permuting arguments when calling: rsvd(A,n,m,rk,V,D,U) produces the RSVD of A = U*D*V’ where U, V are pointers to row dense matrices!

template<typename T>
void xlifepp::rsvd(T *A, number_t m, number_t n, real_t eps, number_t &rk, T *U, T *D, T *V)#

Random SVD compression method of a row dense matrix given by pointer from the paper: Stephanie Chaillat, George Biros.

FaIMS: A fast algorithm for the inverse medium problem with multiple frequencies and multiple sources for the scalar Helmholtz equation. Journal of Computational Physics, Elsevier, 2012, 231 (12), pp.4403-4421. T: type of the result A: pointer to the first element of the dense matrix to be compressed, stored as row major access (dense row) m, n: number of rows and cols of matrix to be compressed eps: desired precision for the SVD matrix rk: rank of rsvd on output U, V: pointer to dense row matrices, has to be allocated before S: pointer to S vector, has to be allocated before

note: may be used when A is a pointer to a m x n col dense matrix, by permuting arguments when calling: rsvd(A,n,m,eps,V,D,U) produces the RSVD of A = U*D*V’ where U, V are pointers to row dense matrices!

ruledSurfaceFrom#

inline Geometry xlifepp::ruledSurfaceFrom(const Geometry &c, string_t domName = "")#

definition of a geometry 2D from an union of boundaries 1D