openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Namespaces | Classes | Enumerations | Functions
SF Namespace Reference

Namespaces

 detail
 

Classes

struct  abstract_linear_solver
 
class  abstract_matrix
 
class  abstract_partitioner
 Abstract base class for a mesh partitioner. More...
 
class  abstract_vector
 
class  commgraph
 The class holds the communication graph for a MPI_Exchange() call. More...
 
class  dmat
 Dense matrix class. More...
 
class  element_view
 Comfort class. Provides getter functions to access the mesh member variables more comfortably. More...
 
class  index_mapping
 Index mapping class. This is a bijective mapping. More...
 
class  kdtree_partitioner
 
class  matrix_integrator
 Abstract matrix integration base class. More...
 
class  meshdata
 The mesh storage class. It contains both element and vertex data. More...
 
struct  mixed_triple
 
struct  mixed_tuple
 
class  non_overlapping_layout
 The parallel layout of non overlapping indices. More...
 
class  numbering
 The abstract numbering class. More...
 
class  overlapping_layout
 The overlapping_layout class contains the algorithms related to managing overlapping parallel index sets, such as the indexing of the nodes, faces or edges of a distributed mesh. More...
 
class  parallel_layout
 The base class for parallel layouts. More...
 
class  petsc_numbering
 Functor class generating a numbering optimized for PETSc. More...
 
struct  Point
 Point and vector struct. More...
 
struct  quadruple
 
class  scatter_registry
 The scatterer registry class. More...
 
class  scattering
 Container for a PETSc VecScatter. More...
 
class  sparse_multiply_transpose
 Functor for the sparse matrix multiply-transpose operation. More...
 
class  submesh_numbering
 Functor class applying a submesh renumbering. More...
 
struct  triple
 
struct  tuple
 
class  vector
 A vector storing arbitrary data. More...
 
class  vector_integrator
 Abstract vector integration base class. More...
 

Enumerations

enum  elem_t {
  Tetra = 0, Hexa, Octa, Pyramid,
  Prism, Quad, Tri, Line
}
 element type enum More...
 
enum  SF_nbr {
  NBR_REF, NBR_SUBMESH, NBR_PETSC, NBR_ELEM_REF,
  NBR_ELEM_SUBMESH
}
 Enumeration encoding the different supported numberings. More...
 

Functions

template<class S >
dmat< S > operator* (const dmat< S > &a, const dmat< S > &b)
 
template<class S >
S * operator* (const dmat< S > &a, const S *v)
 
template<class S >
dmat< S > operator* (const dmat< S > &a, const S v)
 
template<class S >
dmat< S > operator* (const S v, const dmat< S > &a)
 
template<class S >
dmat< S > operator/ (const dmat< S > &a, const S v)
 
template<class S >
dmat< S > operator+ (const dmat< S > &a, const dmat< S > &b)
 
template<class S >
dmat< S > operator- (const dmat< S > &a, const dmat< S > &b)
 
template<class S >
dmat< S > transpose (const dmat< S > &a)
 
template<class S >
double double_cont (const dmat< S > &A, const dmat< S > &B)
 mat-mat double contraction A:B More...
 
template<class S >
void invert_3x3 (S *ele, S &det)
 
template<class S >
void invert_3x3 (dmat< S > &m, S &det)
 
template<class S >
dmat< S > invert_3x3 (const dmat< S > &m)
 
template<class S >
det_3x3 (const dmat< S > &m)
 
template<class S >
dmat< S > invert_2x2 (const dmat< S > &m)
 
template<class S >
void invert_2x2 (S *ele, S &det)
 
template<class S >
void invert_2x2 (dmat< S > &m, S &det)
 
template<class S , class V >
void array_to_tensors (const vector< S > &arr, vector< dmat< V > > &m)
 
template<class S , class V >
void tensors_to_array (const vector< dmat< S > > &m, vector< V > &arr)
 
template<class T , class S >
bool is_init (const abstract_vector< T, S > *v)
 
template<typename V , typename W >
clamp (const V val, const W start, const W end)
 Clamp a value into an interval [start, end]. More...
 
template<class V >
Point arr_to_point (V *arr)
 
template<class V >
void point_to_arr (Point &p, V *arr)
 
Point cross (const Point &a, const Point &b)
 cross product More...
 
double inner_prod (const Point &a, const Point &b)
 
void outer_prod (const Point &a, const Point &b, const double s, double *buff, const bool add=false)
 
void outer_prod (const Point &a, const Point &b, double *buff)
 
double mag (const Point &vect)
 vector magnitude More...
 
Point normalize (const Point &vect)
 
Point operator- (const Point &a, const Point &b)
 
Point operator+ (const Point &a, const Point &b)
 
Point operator* (const Point &a, const double &s)
 
Point project (const Point &a, const Point &b)
 project b onto a More...
 
Point orthogonalize (const Point &a, const Point &b)
 
double distance (const Point &a, const Point &b)
 
elem_t getElemTypeID (char *eletype)
 Generate element type enum from string. More...
 
template<class S , class POINT >
void array_to_points (const vector< S > &arr, vector< POINT > &pts)
 
template<class T , class S >
void nodal_connectivity_graph (const meshdata< T, S > &mesh, vector< T > &n2n_cnt, vector< T > &n2n_con)
 Compute the node-to-node connectivity. More...
 
template<class T , class S >
int max_nodal_edgecount (const meshdata< T, S > &mesh)
 Compute the maximum number of node-to-node edges for a mesh. More...
 
template<class T , class S >
void get_alg_mask (const meshdata< T, S > &mesh, vector< bool > &alg_mask)
 
template<class T >
bool operator< (const struct tuple< T > &lhs, const struct tuple< T > &rhs)
 
template<class T , class S >
bool operator< (const struct mixed_tuple< T, S > &lhs, const struct mixed_tuple< T, S > &rhs)
 
template<class T >
bool operator< (const struct triple< T > &lhs, const struct triple< T > &rhs)
 
template<class T >
bool operator< (const struct quadruple< T > &lhs, const struct quadruple< T > &rhs)
 
short num_dof (elem_t type, short order)
 Get number of d.o.f. for an element type and an Ansatz function order. More...
 
void general_integration_points (const elem_t type, const short order, Point *ip, double *w, int &nint)
 Compute the integration point locations and weights. More...
 
void reference_shape (const elem_t type, const Point ip, dmat< double > &rshape)
 Compute shape function and its derivatives on a reference element. More...
 
void jacobian_matrix (const dmat< double > &rshape, const int npts, const Point *pts, double *J)
 Compute Jacobian matrix from the real element to the reference element. More...
 
void invert_jacobian_matrix (const elem_t type, double *J, double &detJ)
 
void shape_deriv (const double *iJ, const dmat< double > &rshape, const int ndof, dmat< double > &shape)
 Compute shape derivatives for an element, based on the shape derivatives of the associated reference element. More...
 
template<class T , class V >
void canonic_indices (const T *nidx, const T *nbr, const T esize, const short dpn, V *cidx)
 Compute canonical indices from nodal indices and dpn. More...
 
template<class T , class S >
void assemble_matrix (abstract_matrix< T, S > &mat, meshdata< mesh_int_t, mesh_real_t > &domain, matrix_integrator< mesh_int_t, mesh_real_t > &integrator)
 Generalized matrix assembly. More...
 
template<class T , class S >
void assemble_lumped_matrix (abstract_matrix< T, S > &mat, meshdata< mesh_int_t, mesh_real_t > &domain, matrix_integrator< mesh_int_t, mesh_real_t > &integrator)
 
template<class T , class S >
void assemble_vector (abstract_vector< T, S > &vec, meshdata< mesh_int_t, mesh_real_t > &domain, vector_integrator< mesh_int_t, mesh_real_t > &integrator)
 Generalized vector assembly. More...
 
template<class T , class S >
void extract_element_data (const element_view< mesh_int_t, mesh_real_t > &view, abstract_vector< T, S > &vec, SF_real *buffer)
 
template<class T , class S >
void set_element_data (const element_view< mesh_int_t, mesh_real_t > &view, SF_real *buffer, abstract_vector< T, S > &vec)
 
template<class T , class S >
void get_transformed_pts (const element_view< T, S > &view, Point *loc_pts, Point &trsf_fibre)
 
template<typename T >
byte_swap (T in)
 swap the bytes of int, float, doubles, etc.. More...
 
bool fileExists (std::string filename)
 Function which checks if a given file exists. More...
 
size_t file_size (FILE *fd)
 return file size from a file descriptor More...
 
void treat_file_open_error (const char *file, const char *caller, const int errnum, const bool do_exit, int rank)
 treat a file open error by displaying the errnum string interpretation and the caller More...
 
template<class T >
void multiply_connectivities (const vector< T > &a_cnt, const vector< T > &a_con, const vector< T > &b_cnt, const vector< T > &b_con, vector< T > &c_cnt, vector< T > &c_con)
 
template<class T >
void transpose_connectivity (const vector< T > &a_cnt, const vector< T > &a_con, vector< T > &b_cnt, vector< T > &b_con)
 Transpose CRS matrix graph A into B. More...
 
size_t read_num_pts (std::string basename)
 Function returns the number of points in a CARP points file. More...
 
void read_headers (FILE *ele_fd, FILE *fib_fd, bool read_binary, size_t &numelem, bool &twoFib)
 Read the header from the element and fiber files. More...
 
void write_elem_headers (FILE *&ele_fd, FILE *&fib_fd, bool binary, size_t numelem, bool twoFib)
 Write the header of the element and fiber files. More...
 
void write_pts_header (FILE *&pts_fd, bool binary, size_t numpts)
 Write the header of the points file. More...
 
template<class T , class S >
void read_elem_block (FILE *&fd, bool read_binary, size_t bstart, size_t bsize, meshdata< T, S > &mesh)
 Read a block of size bsize from an CARP element file. More...
 
template<class T , class S >
void write_elem_block (FILE *fd, bool write_binary, const meshdata< T, S > &mesh)
 Write the local element block to a file. More...
 
template<class T , class S >
void read_fib_block (FILE *&fd, bool read_binary, bool twoFib, size_t bsize, meshdata< T, S > &mesh)
 Read a chunk of fibers from a file descriptor. More...
 
template<class T , class S >
void write_fib_block (FILE *&fd, bool write_binary, const meshdata< T, S > &mesh)
 Write the local chunk of fibers to a file. More...
 
template<class T , class S >
void read_elements (meshdata< T, S > &mesh, std::string basename)
 Read the element data (elements and fibers) of a CARP mesh. More...
 
template<class T , class S >
void write_elements (const meshdata< T, S > &mesh, bool binary, std::string basename)
 Read the element data (elements and fibers) of a CARP mesh. More...
 
template<class T , class S >
void write_surface (const meshdata< T, S > &surfmesh, std::string surffile)
 
template<class S >
void read_pts_block (FILE *&fd, bool read_binary, size_t bsize, vector< S > &xyz)
 Read a chunk of points from a file descriptor. More...
 
template<class S >
void write_pts_block (FILE *&fd, bool write_binary, const vector< S > &xyz)
 Write a chunk of points to a file. More...
 
template<class T , class S >
void read_points (const std::string basename, const MPI_Comm comm, vector< S > &pts, vector< T > &ptsidx)
 Read the points and insert them into a list of meshes. More...
 
template<class T , class S >
void insert_points (const vector< S > &pts, const vector< T > &ptsidx, std::list< meshdata< T, S > *> &meshlist)
 Insert the points from the read-in buffers into a list of distributed meshes. More...
 
template<class T , class S >
void writeVTKmesh_binary (const meshdata< T, S > &mesh, std::string file)
 Write a mesh in binary vtk format. More...
 
template<class T , class S >
void permute_mesh (const meshdata< T, S > &inmesh, meshdata< T, S > &outmesh, const vector< T > &perm)
 Permute the element data of a mesh based on a given permutation. More...
 
template<class T , class S >
void redistribute_elements (meshdata< T, S > &mesh, meshdata< T, S > &sendbuff, vector< T > &part)
 Redistribute the element data of a parallel mesh among the ranks based on a partitioning. More...
 
template<class T , class S >
void redistribute_elements (meshdata< T, S > &mesh, vector< T > &part)
 Redistribute the element data of a parallel mesh among the ranks based on a partitioning. More...
 
template<class T , class S >
void redistribute_mesh (meshdata< T, S > &mesh, vector< T > &part)
 Redistribute both element and vertex data of a mesh. More...
 
template<class T , class S >
void write_mesh_parallel (const meshdata< T, S > &mesh, bool binary, std::string basename)
 Write a parallel mesh to harddisk without gathering it on one rank. More...
 
template<class T , class S >
void gather_mesh (const meshdata< T, S > &locmesh, meshdata< T, S > &globmesh)
 Gather a mesh on rank 0. More...
 
template<class T , class S >
void print_DD_info (const meshdata< T, S > &mesh)
 Print some basic information on the domain decomposition of a mesh. More...
 
template<class T , class S >
void extract_mesh (const vector< bool > &keep, const meshdata< T, S > &mesh, meshdata< T, S > &submesh)
 Extract a submesh from a given mesh. More...
 
template<class T , class S >
void rebalance_mesh (meshdata< T, S > &mesh)
 Rebalance the parallel distribution of a mesh, if a local size is 0. More...
 
template<class T , class S >
void extract_myocardium (const meshdata< T, S > &mesh, meshdata< T, S > &submesh)
 Extract the myocardium submesh. More...
 
template<class T , class S >
void extract_tagbased (const meshdata< T, S > &mesh, meshdata< T, S > &submesh)
 Extract a submesh based on element tags. More...
 
template<class T , class S >
void print_mesh_graph (meshdata< T, S > &mesh)
 One-by-one each process prints the graph of a given mesh. More...
 
template<class T , class S >
void inter_domain_mapping (const meshdata< T, S > &mesh_a, const meshdata< T, S > &mesh_b, const SF_nbr snbr, index_mapping< T > &a_to_b)
 Submesh index mapping between different domains/meshes. More...
 
template<class T >
void insert_surf_tri (T n1, T n2, T n3, size_t eidx, triple< T > &surf, tri_sele< T > &sele, hashmap::unordered_map< triple< T >, tri_sele< T > > &surfmap)
 
template<class T >
void insert_surf_quad (T n1, T n2, T n3, T n4, size_t eidx, vector< T > &buff, quadruple< T > &surf, quad_sele< T > &sele, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &surfmap)
 
template<class T >
void insert_surf_tet (const T *nod, const size_t eidx, hashmap::unordered_map< triple< T >, tri_sele< T > > &surfmap)
 
template<class T >
void insert_surf_pyr (const T *nod, const size_t eidx, vector< T > &buff, hashmap::unordered_map< triple< T >, tri_sele< T > > &surfmap, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &qsurfmap)
 
template<class T >
void insert_surf_pri (const T *nod, const size_t eidx, vector< T > &buff, hashmap::unordered_map< triple< T >, tri_sele< T > > &surfmap, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &qsurfmap)
 
template<class T >
void insert_surf_hex (const T *nod, const size_t eidx, vector< T > &buff, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &surfmap)
 
template<class T , class S >
void search_for_surface (const meshdata< T, S > &mesh, const SF_nbr numbering, const hashmap::unordered_map< triple< T >, tri_sele< T > > &search_tri, const hashmap::unordered_map< quadruple< T >, quad_sele< T > > &search_quad, hashmap::unordered_map< triple< T >, tri_sele< T > > &found_tri, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &found_quad)
 
template<class T , class S >
void compute_surface (const meshdata< T, S > &mesh, const SF_nbr numbering, const hashmap::unordered_set< T > &tags, hashmap::unordered_map< triple< T >, tri_sele< T > > &tri_surf, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &quad_surf)
 
template<class T , class S >
void compute_surface (const meshdata< T, S > &mesh, const SF_nbr numbering, hashmap::unordered_map< triple< T >, tri_sele< T > > &tri_surf, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &quad_surf)
 
template<class V >
void get_hashmap_duplicates (const vector< V > &data, const MPI_Comm comm, vector< bool > &is_dup)
 
template<class K , class V >
void remove_duplicates (hashmap::unordered_map< K, V > &map, const MPI_Comm comm)
 remove parallel duplicates from a hashmap::unordered_map More...
 
template<class K >
void remove_duplicates (hashmap::unordered_set< K > &set, const MPI_Comm comm)
 remove parallel duplicates from a hashmap::unordered_set More...
 
template<class T >
void remove_parallel_duplicates (hashmap::unordered_map< triple< T >, tri_sele< T >> &tri_surf, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &quad_surf, MPI_Comm comm)
 
template<class T , class S >
void convert_surface_mesh (hashmap::unordered_map< triple< T >, tri_sele< T >> &tri_surf, hashmap::unordered_map< quadruple< T >, quad_sele< T > > &quad_surf, meshdata< T, S > &surfmesh, vector< T > &elem_orig)
 
template<class T , class S >
void convert_mesh_surface (const meshdata< T, S > &surfmesh, hashmap::unordered_map< triple< T >, tri_sele< T >> &tri_surf, hashmap::unordered_map< quadruple< T >, quad_sele< T >> &quad_surf)
 
template<class T , class S >
void compute_surface_mesh (const meshdata< T, S > &mesh, const SF_nbr numbering, const hashmap::unordered_set< T > &tags, meshdata< T, S > &surfmesh)
 Compute the surface of a given mesh. More...
 
template<class T , class S >
void compute_surface_mesh (const meshdata< T, S > &mesh, const SF_nbr numbering, meshdata< T, S > &surfmesh)
 Compute the surface of a given mesh. More...
 
template<class T , class S >
void read_surface_mesh (const meshdata< T, S > &mesh, meshdata< T, S > &surface, std::string filename)
 
template<class T >
void restrict_to_set (vector< T > &v, const hashmap::unordered_set< T > &set)
 
template<class T >
void restrict_to_set (vector< T > &v, const vector< T > &vset)
 
template<class T , class S >
void MPI_Exchange (commgraph< T > &grph, vector< S > &send, vector< S > &recv, MPI_Comm comm)
 Exchange data in parallel over MPI. More...
 
template<class T >
parallel_fallback_value (const vector< T > &vec, MPI_Comm comm)
 Get a fallback value for operations on parallel vectors if the local vector is of 0 size. More...
 
template<class T >
global_min (const vector< T > &vec, MPI_Comm comm)
 Compute the global minimum of a distributed vector. More...
 
template<class T >
global_max (const vector< T > &vec, MPI_Comm comm)
 Compute the global maximum of a distributed vector. More...
 
template<class T >
global_max (const T val, MPI_Comm comm)
 Compute the global maximum of a distributed vector. More...
 
template<class T >
void layout_from_count (const T count, vector< T > &layout, MPI_Comm comm)
 
template<class T >
index_in_layout (const T idx, const vector< T > &layout)
 
template<class T >
void make_global (const vector< T > &vec, vector< T > &out, MPI_Comm comm)
 make a parallel vector global More...
 
template<class T >
void make_global (vector< T > &vec, MPI_Comm comm)
 
template<class T >
void reindex_cuthill_mckee (const vector< T > &n2n_cnt, const vector< T > &n2n_dsp, const vector< T > &n2n_con, const bool reverse, hashmap::unordered_map< T, T > &old2new)
 
template<class T >
void parallel_distribution (const vector< T > &gtarget, const vector< T > &cnt, const vector< T > &dsp, const vector< T > &ranks, const int myrank, vector< T > &owner, vector< T > &counts)
 The distribution distributes entities between all ranks. More...
 
template<class T >
void refine_distribution (const vector< T > &gtarget, const vector< T > &cnt, const vector< T > &dsp, const vector< T > &ranks, const int myrank, vector< T > &owner, vector< T > &counts)
 Further refine a distribution generated by parallel_distribution(). More...
 
template<class T >
void parallel_distribution_minrank (const vector< T > &gtarget, const vector< T > &cnt, const vector< T > &dsp, const vector< T > &ranks, vector< T > &owner, vector< T > &counts)
 
template<class T , class S >
local_nodal_to_local_petsc (const meshdata< T, S > &mesh, int rank, T local_nodal)
 
template<class T , class S >
local_petsc_to_local_nodal (const meshdata< T, S > &mesh, int rank, T local_petsc)
 
template<class T , class S >
void local_petsc_to_nodal_mapping (const meshdata< T, S > &mesh, index_mapping< T > &petsc_to_nodal)
 
template<class T >
void sort_parallel (MPI_Comm comm, const vector< T > &idx, vector< T > &out_idx)
 Sort index values parallel ascending across the ranks. More...
 
template<class T , class V >
void sort_parallel (MPI_Comm comm, const vector< T > &idx, const vector< V > &val, vector< T > &out_idx, vector< V > &out_val)
 Sort index-value tuples parallel ascending across the ranks. More...
 
template<class T , class V >
void sort_parallel (MPI_Comm comm, const vector< T > &idx, const vector< T > &cnt, const vector< V > &val, vector< T > &out_idx, vector< T > &out_cnt, vector< V > &out_val)
 
template<class V >
size_t root_write (FILE *fd, const vector< V > &vec, MPI_Comm comm)
 Write vector data binary to disk. More...
 
template<class V >
size_t root_write (FILE *fd, V *vec, const size_t vec_size, MPI_Comm comm)
 root_write wrapper that takes array pointers instead of vectors. More...
 
template<class V >
size_t root_read (FILE *fd, vector< V > &vec, MPI_Comm comm)
 Read binary data into a vector. More...
 
template<class V >
size_t root_read_ascii (FILE *fd, vector< V > &vec, MPI_Comm comm, bool int_data)
 Read binary data into a vector. More...
 
size_t root_count_ascii_lines (std::string file, MPI_Comm comm)
 count the lines in a ascii file More...
 
template<class V >
size_t root_read (FILE *fd, V *vec, const size_t vec_size, MPI_Comm comm)
 root_read wrapper that takes array pointers instead of vectors. More...
 
template<class V >
size_t root_read_ascii (FILE *fd, V *vec, const size_t vec_size, MPI_Comm comm, bool int_type)
 root_read_ascii wrapper that takes array pointers instead of vectors. More...
 
template<class T , class V >
size_t root_write_ordered (FILE *fd, const vector< T > &idx, const vector< V > &vec, MPI_Comm comm)
 Write index value pairs to disk in ordered permutation. More...
 
template<class T , class V >
size_t root_write_ordered (FILE *fd, const vector< T > &idx, const vector< T > &cnt, const vector< V > &vec, MPI_Comm comm)
 Write index value pairs to disk in ordered permutation. More...
 
template<class T , class V >
size_t root_write_ordered (FILE *fd, T *idx, V *vec, const size_t vec_size, MPI_Comm comm)
 root_write_ordered wrapper that takes array pointers instead of vectors. More...
 
template<class T , class V >
size_t root_write_ordered (FILE *fd, T *idx, T *cnt, V *vec, const size_t idx_size, const size_t vec_size, MPI_Comm comm)
 root_write_ordered wrapper that takes array pointers instead of vectors. More...
 
template<class T >
void print_vector (MPI_Comm comm, const vector< T > &vec, const short dpn, FILE *fd)
 
template<class T , class S >
void write_data_ascii (const MPI_Comm comm, const vector< T > &idx, const vector< S > &data, std::string file, short dpn=1)
 
template<class T >
void _binary_sort (T *_P, T *_Q, T s)
 
template<class T , class S >
void _binary_sort_copy (T *_P, T *_Q, S *_U, S *_V, T s)
 
template<class T , class S , class R >
void _binary_sort_copy_copy (T *_P, T *_Q, S *_A, S *_B, R *_U, R *_V, T s)
 
template<class T >
void _binary_sort_sort (T *_P, T *_Q, T *_A, T *_B, T s, T t)
 
template<class T , class S >
void _binary_sort_sort_copy (T *_P, T *_Q, T *_A, T *_B, S *_U, S *_V, T s, T t)
 
template<class T >
_binary_log (const T *P, const T *Q)
 
template<class T >
void binary_sort (vector< T > &_V)
 
template<class T , class S >
void binary_sort_copy (vector< T > &_V, vector< S > &_W)
 
template<class T , class S , class R >
void binary_sort_copy_copy (vector< T > &_V, vector< S > &_W, vector< R > &_A)
 
template<class T >
void binary_sort_sort (vector< T > &_V, vector< T > &_W)
 
template<class T , class S >
void binary_sort_sort_copy (vector< T > &_V, vector< T > &_W, vector< S > &_A)
 
template<class T >
void unique_resize (vector< T > &_P)
 
template<class T >
void unique_resize (vector< T > &_P, vector< T > &_U)
 
template<class T , class S >
void unique_accumulate (vector< T > &_P, vector< S > &_A)
 
template<class T , class S >
void unique_accumulate (vector< T > &_P, vector< T > &_U, vector< S > &_A)
 
template<class T >
void global_to_local_sorted (const vector< T > &glob, vector< T > &data, bool sortedData, bool doWarn)
 
template<class T >
void global_to_local (const vector< T > &glob, vector< T > &data, bool sortedData, bool doWarn)
 
template<class T >
void global_to_local (const hashmap::unordered_map< T, T > &g2l, vector< T > &data, bool doWarn)
 
template<class T >
void dsp_from_cnt (const vector< T > &cnt, vector< T > &dsp)
 Compute displacements from counts. More...
 
template<class T >
void cnt_from_dsp (const vector< T > &dsp, vector< T > &cnt)
 Compute counts from displacements. More...
 
template<class T , class S >
void count (const vector< T > &data, vector< S > &cnt)
 Count number of occurrences of indices. More...
 
template<class T >
sum (const vector< T > &vec)
 Compute sum of a vector's entries. More...
 
template<class T >
void interval (vector< T > &vec, size_t start, size_t end)
 Create an integer interval between start and end. More...
 
template<class T >
void divide (const size_t gsize, const size_t num_parts, vector< T > &loc_sizes)
 divide gsize into num_parts local parts with even distribution of the remainder More...
 
template<class S , class V >
void vec_assign (S *lhs, const V *rhs, size_t size)
 Assign the values in rhs to lhs. The data-type of rhs is cast to the type of lhs. More...
 
template<class T >
bool isEmpty (vector< T > &v)
 Return whether an vector is empty (all values are 0). More...
 
template<class T , class S >
void init_vector (SF::abstract_vector< T, S > **vec)
 
template<class T , class S >
void init_vector (SF::abstract_vector< T, S > **vec, int igsize, int ilsize, int idpn=1, typename abstract_vector< T, S >::ltype ilayout=abstract_vector< T, S >::unset)
 
template<class T , class S >
void init_vector (SF::abstract_vector< T, S > **vec, const SF::meshdata< mesh_int_t, mesh_real_t > &mesh, int i, typename SF::abstract_vector< T, S >::ltype ltype)
 
template<class T , class S >
void init_vector (SF::abstract_vector< T, S > **vec, SF::abstract_vector< T, S > *in)
 
template<class T , class S >
void init_matrix (SF::abstract_matrix< T, S > **mat)
 
template<class T , class S >
void init_solver (SF::abstract_linear_solver< T, S > **sol)
 

Enumeration Type Documentation

◆ elem_t

enum SF::elem_t

element type enum

Enumerator
Tetra 
Hexa 
Octa 
Pyramid 
Prism 
Quad 
Tri 
Line 

Definition at line 52 of file SF_container.h.

◆ SF_nbr

enum SF::SF_nbr

Enumeration encoding the different supported numberings.

Enumerator
NBR_REF 

The nodal numbering of the reference mesh (the one stored on HD).

NBR_SUBMESH 

Submesh nodal numbering: The globally ascending sorted reference indices are reindexed.

NBR_PETSC 

PETSc numbering of nodes.

NBR_ELEM_REF 

The element numbering of the reference mesh (the one stored on HD).

NBR_ELEM_SUBMESH 

Submesh element numbering: The globally ascending sorted reference indices are reindexed.

Definition at line 188 of file SF_container.h.

Function Documentation

◆ _binary_log()

template<class T >
T SF::_binary_log ( const T *  P,
const T *  Q 
)
inline

Private procedure, see binary_sort.

Definition at line 262 of file SF_sort.h.

Here is the caller graph for this function:

◆ _binary_sort()

template<class T >
void SF::_binary_sort ( T *  _P,
T *  _Q,
s 
)
inline

Private procedure, see binary_sort.

Definition at line 40 of file SF_sort.h.

Here is the caller graph for this function:

◆ _binary_sort_copy()

template<class T , class S >
void SF::_binary_sort_copy ( T *  _P,
T *  _Q,
S *  _U,
S *  _V,
s 
)
inline

Private procedure, see binary_sort_copy.

Definition at line 73 of file SF_sort.h.

Here is the caller graph for this function:

◆ _binary_sort_copy_copy()

template<class T , class S , class R >
void SF::_binary_sort_copy_copy ( T *  _P,
T *  _Q,
S *  _A,
S *  _B,
R *  _U,
R *  _V,
s 
)
inline

Private procedure, see binary_sort_copy_copy.

Definition at line 114 of file SF_sort.h.

Here is the caller graph for this function:

◆ _binary_sort_sort()

template<class T >
void SF::_binary_sort_sort ( T *  _P,
T *  _Q,
T *  _A,
T *  _B,
s,
t 
)
inline

Private procedure, see binary_sort_sort.

Definition at line 163 of file SF_sort.h.

Here is the caller graph for this function:

◆ _binary_sort_sort_copy()

template<class T , class S >
void SF::_binary_sort_sort_copy ( T *  _P,
T *  _Q,
T *  _A,
T *  _B,
S *  _U,
S *  _V,
s,
t 
)
inline

Private procedure, see binary_sort_sort_copy.

Definition at line 208 of file SF_sort.h.

Here is the caller graph for this function:

◆ arr_to_point()

template<class V >
Point SF::arr_to_point ( V *  arr)
inline

Definition at line 72 of file SF_container.h.

◆ array_to_points()

template<class S , class POINT >
void SF::array_to_points ( const vector< S > &  arr,
vector< POINT > &  pts 
)
inline

Definition at line 180 of file SF_container.h.

◆ array_to_tensors()

template<class S , class V >
void SF::array_to_tensors ( const vector< S > &  arr,
vector< dmat< V > > &  m 
)

Definition at line 547 of file dense_mat.hpp.

◆ assemble_lumped_matrix()

template<class T , class S >
void SF::assemble_lumped_matrix ( abstract_matrix< T, S > &  mat,
meshdata< mesh_int_t, mesh_real_t > &  domain,
matrix_integrator< mesh_int_t, mesh_real_t > &  integrator 
)
inline

Definition at line 1056 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ assemble_matrix()

template<class T , class S >
void SF::assemble_matrix ( abstract_matrix< T, S > &  mat,
meshdata< mesh_int_t, mesh_real_t > &  domain,
matrix_integrator< mesh_int_t, mesh_real_t > &  integrator 
)
inline

Generalized matrix assembly.

All the assembly details – both the computation as well as the parameters handling – are encapsulated in the used integrator.

Parameters
matmatrix to add values into
domainThe domain we compute the integral on
integratorThe integral computation functor

Definition at line 1009 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ assemble_vector()

template<class T , class S >
void SF::assemble_vector ( abstract_vector< T, S > &  vec,
meshdata< mesh_int_t, mesh_real_t > &  domain,
vector_integrator< mesh_int_t, mesh_real_t > &  integrator 
)
inline

Generalized vector assembly.

All the assembly details – both the computation as well as the parameters handling – are encapsulated in the used integrator.

Parameters
vecvector to add values into
domainThe domain we compute the integral on
integratorThe integral computation functor
prgProgress display class

Definition at line 1119 of file SF_fem_utils.h.

◆ binary_sort()

template<class T >
void SF::binary_sort ( vector< T > &  _V)
inline

The binary_sort procedure sorts a vector of nonnegative integers in place in ascending order.

Parameters
_VInput: Vector of nonnegative integers to sort. Output: Sorted vector in ascending order.

Definition at line 284 of file SF_sort.h.

Here is the caller graph for this function:

◆ binary_sort_copy()

template<class T , class S >
void SF::binary_sort_copy ( vector< T > &  _V,
vector< S > &  _W 
)
inline

The binary_sort_copy procedure partially sorts pairs in place in ascending order only looking at the first argument.

Parameters
_VInput: Vector of nonnegative integers to sort, first argument. Output: Partially sorted vector in ascending order, first argument.
_WInput: Vector of arbitrary type to sort, second argument. Output: Partially sorted vector in ascending order, second argument.

Definition at line 296 of file SF_sort.h.

Here is the caller graph for this function:

◆ binary_sort_copy_copy()

template<class T , class S , class R >
void SF::binary_sort_copy_copy ( vector< T > &  _V,
vector< S > &  _W,
vector< R > &  _A 
)
inline

The binary_sort_copy_copy procedure partially sorts triples in place in ascending order only looking at the first argument.

Parameters
_VInput: Vector of nonnegative integers to sort, first argument. Output: Partially sorted vector in ascending order, first argument.
_WInput: Vector of arbitrary type to sort, second argument. Output: Partially sorted vector in ascending order, second argument.
_AInput: Vector of arbitrary type to sort, third argument. Output: Partially sorted vector in ascending order, second argument.

Definition at line 309 of file SF_sort.h.

◆ binary_sort_sort()

template<class T >
void SF::binary_sort_sort ( vector< T > &  _V,
vector< T > &  _W 
)
inline

The binary_sort_sort procedure sorts pairs of nonnegative integers in place in lexicographic order looking at both arguments.

Parameters
_VInput: Vector of nonnegative integers to sort, first argument. Output: Sorted vector in ascending order, first argument.
_WInput: Vector of nonnegative integers to sort, second argument. Output: Sorted vector in ascending order, second argument.

Definition at line 321 of file SF_sort.h.

Here is the caller graph for this function:

◆ binary_sort_sort_copy()

template<class T , class S >
void SF::binary_sort_sort_copy ( vector< T > &  _V,
vector< T > &  _W,
vector< S > &  _A 
)
inline

The binary_sort_sort_copy procedure partially sorts triples in place in lexicographic order only looking at the first and second argument.

Parameters
_VInput: Vector of nonnegative integers to sort, first argument. Output: Partially sorted vector in ascending order, first argument.
_WInput: Vector of nonnegative integers to sort, second argument. Output: Partially sorted vector in ascending order, second argument.
_AInput: Vector of arbitrary type to sort, third argument. Output: Partially sorted vector in ascending order, third argument.

Definition at line 335 of file SF_sort.h.

◆ byte_swap()

template<typename T >
T SF::byte_swap ( in)

swap the bytes of int, float, doubles, etc..

Definition at line 22 of file SF_io_base.h.

◆ canonic_indices()

template<class T , class V >
void SF::canonic_indices ( const T *  nidx,
const T *  nbr,
const T  esize,
const short  dpn,
V *  cidx 
)
inline

Compute canonical indices from nodal indices and dpn.

Parameters
nidxNodal indices in local indexing.
nbrNumbering to use.
esizeElement size.
dpnDegrees of freedom per node.
cidxCanonical indices.

Definition at line 987 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ clamp()

template<typename V , typename W >
V SF::clamp ( const V  val,
const W  start,
const W  end 
)

Clamp a value into an interval [start, end].

Template Parameters
VValue type
WInterval boundary type
Parameters
valThe value we clamp
startThe interval start value
endThe interval end value
Returns
The clamped value

Definition at line 63 of file SF_base.h.

◆ cnt_from_dsp()

template<class T >
void SF::cnt_from_dsp ( const vector< T > &  dsp,
vector< T > &  cnt 
)
inline

Compute counts from displacements.

Definition at line 319 of file SF_vector.h.

Here is the caller graph for this function:

◆ compute_surface() [1/2]

template<class T , class S >
void SF::compute_surface ( const meshdata< T, S > &  mesh,
const SF_nbr  numbering,
const hashmap::unordered_set< T > &  tags,
hashmap::unordered_map< triple< T >, tri_sele< T > > &  tri_surf,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  quad_surf 
)
inline

Definition at line 1108 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ compute_surface() [2/2]

template<class T , class S >
void SF::compute_surface ( const meshdata< T, S > &  mesh,
const SF_nbr  numbering,
hashmap::unordered_map< triple< T >, tri_sele< T > > &  tri_surf,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  quad_surf 
)
inline

Definition at line 1167 of file SF_mesh_utils.h.

◆ compute_surface_mesh() [1/2]

template<class T , class S >
void SF::compute_surface_mesh ( const meshdata< T, S > &  mesh,
const SF_nbr  numbering,
const hashmap::unordered_set< T > &  tags,
meshdata< T, S > &  surfmesh 
)
inline

Compute the surface of a given mesh.

Template Parameters
TInteger type.
SFloating point type.
Parameters
meshInput mesh.
numberingInput global numbering.
tagsSurface is computed for region defined by these tags.
surfmeshOutput surface.

Definition at line 1371 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ compute_surface_mesh() [2/2]

template<class T , class S >
void SF::compute_surface_mesh ( const meshdata< T, S > &  mesh,
const SF_nbr  numbering,
meshdata< T, S > &  surfmesh 
)
inline

Compute the surface of a given mesh.

Template Parameters
TInteger type.
SFloating point type.
Parameters
meshInput mesh.
numberingInput global numbering.
surfmeshOutput surface.

Definition at line 1417 of file SF_mesh_utils.h.

◆ convert_mesh_surface()

template<class T , class S >
void SF::convert_mesh_surface ( const meshdata< T, S > &  surfmesh,
hashmap::unordered_map< triple< T >, tri_sele< T >> &  tri_surf,
hashmap::unordered_map< quadruple< T >, quad_sele< T >> &  quad_surf 
)
inline

this is somewhat similar to extract_surface(), but we dont try to be smart and just assume the surface con is already in correct indexing and we have a surface mesh and we dont care about the element indices. Maybe we can use compute_surface() but I dont have time to make it work nicely .. Aurel, 20.06.2023

Definition at line 1339 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ convert_surface_mesh()

template<class T , class S >
void SF::convert_surface_mesh ( hashmap::unordered_map< triple< T >, tri_sele< T >> &  tri_surf,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  quad_surf,
meshdata< T, S > &  surfmesh,
vector< T > &  elem_orig 
)
inline

Definition at line 1285 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ count()

template<class T , class S >
void SF::count ( const vector< T > &  data,
vector< S > &  cnt 
)
inline

Count number of occurrences of indices.

Parameters
dataVector of index data.
cntcnt[i] is the number of occurrences of index i.

Definition at line 332 of file SF_vector.h.

Here is the caller graph for this function:

◆ cross()

Point SF::cross ( const Point a,
const Point b 
)
inline

cross product

Definition at line 84 of file SF_container.h.

Here is the caller graph for this function:

◆ det_3x3()

template<class S >
S SF::det_3x3 ( const dmat< S > &  m)

Definition at line 497 of file dense_mat.hpp.

◆ distance()

double SF::distance ( const Point a,
const Point b 
)
inline

Definition at line 149 of file SF_container.h.

Here is the caller graph for this function:

◆ divide()

template<class T >
void SF::divide ( const size_t  gsize,
const size_t  num_parts,
vector< T > &  loc_sizes 
)
inline

divide gsize into num_parts local parts with even distribution of the remainder

Definition at line 358 of file SF_vector.h.

Here is the caller graph for this function:

◆ double_cont()

template<class S >
double SF::double_cont ( const dmat< S > &  A,
const dmat< S > &  B 
)

mat-mat double contraction A:B

Definition at line 438 of file dense_mat.hpp.

◆ dsp_from_cnt()

template<class T >
void SF::dsp_from_cnt ( const vector< T > &  cnt,
vector< T > &  dsp 
)
inline

Compute displacements from counts.

Definition at line 310 of file SF_vector.h.

Here is the caller graph for this function:

◆ extract_element_data()

template<class T , class S >
void SF::extract_element_data ( const element_view< mesh_int_t, mesh_real_t > &  view,
abstract_vector< T, S > &  vec,
SF_real buffer 
)
inline

Definition at line 1160 of file SF_fem_utils.h.

◆ extract_mesh()

template<class T , class S >
void SF::extract_mesh ( const vector< bool > &  keep,
const meshdata< T, S > &  mesh,
meshdata< T, S > &  submesh 
)
inline

Extract a submesh from a given mesh.

Parameters
[in]keepkeep[i] tell whether element i is extracted into the submesh.
[in]meshThe mesh to extract from.
[out]submeshThe submesh extracted into.

Definition at line 524 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ extract_myocardium()

template<class T , class S >
void SF::extract_myocardium ( const meshdata< T, S > &  mesh,
meshdata< T, S > &  submesh 
)
inline

Extract the myocardium submesh.

The myocardium is currently identified by empty fiber definitions.

Parameters
[in]meshThe mesh to extract from.
[out]submeshThe submesh extracted into.

Definition at line 644 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ extract_tagbased()

template<class T , class S >
void SF::extract_tagbased ( const meshdata< T, S > &  mesh,
meshdata< T, S > &  submesh 
)
inline

Extract a submesh based on element tags.

Note: The tag set the extraction is based on is expected to be in the submesh!

Parameters
[in]meshThe mesh.
[out]submeshThe extracted submesh.

Definition at line 687 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ file_size()

size_t SF::file_size ( FILE *  fd)
inline

return file size from a file descriptor

Definition at line 72 of file SF_io_base.h.

Here is the caller graph for this function:

◆ fileExists()

bool SF::fileExists ( std::string  filename)
inline

Function which checks if a given file exists.

Parameters
[in]filenameName of the file.
Returns
Boolean indicating existence.

Definition at line 66 of file SF_io_base.h.

Here is the caller graph for this function:

◆ gather_mesh()

template<class T , class S >
void SF::gather_mesh ( const meshdata< T, S > &  locmesh,
meshdata< T, S > &  globmesh 
)
inline

Gather a mesh on rank 0.

Parameters
[in]locmeshThe local mesh.
[out]globmeshThe gathered global mesh.

Definition at line 456 of file SF_mesh_utils.h.

◆ general_integration_points()

void SF::general_integration_points ( const elem_t  type,
const short  order,
Point ip,
double *  w,
int &  nint 
)
inline

Compute the integration point locations and weights.

Parameters
typeElement type.
orderIntegration order.
ipIntegration point locations.
wIntegration weights.
nintNumber of integration points.

Definition at line 121 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ get_alg_mask()

template<class T , class S >
void SF::get_alg_mask ( const meshdata< T, S > &  mesh,
vector< bool > &  alg_mask 
)

Definition at line 611 of file SF_container.h.

◆ get_hashmap_duplicates()

template<class V >
void SF::get_hashmap_duplicates ( const vector< V > &  data,
const MPI_Comm  comm,
vector< bool > &  is_dup 
)
inline

Definition at line 1176 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ get_transformed_pts()

template<class T , class S >
void SF::get_transformed_pts ( const element_view< T, S > &  view,
Point loc_pts,
Point trsf_fibre 
)
inline

Definition at line 1196 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ getElemTypeID()

elem_t SF::getElemTypeID ( char *  eletype)
inline

Generate element type enum from string.

Definition at line 155 of file SF_container.h.

Here is the caller graph for this function:

◆ global_max() [1/2]

template<class T >
T SF::global_max ( const vector< T > &  vec,
MPI_Comm  comm 
)
inline

Compute the global maximum of a distributed vector.

Parameters
[in]vec
[in]comm
Returns
The global maximum.

Definition at line 156 of file SF_network.h.

Here is the caller graph for this function:

◆ global_max() [2/2]

template<class T >
T SF::global_max ( const T  val,
MPI_Comm  comm 
)
inline

Compute the global maximum of a distributed vector.

Parameters
[in]vec
[in]comm
Returns
The global maximum.

Definition at line 186 of file SF_network.h.

◆ global_min()

template<class T >
T SF::global_min ( const vector< T > &  vec,
MPI_Comm  comm 
)
inline

Compute the global minimum of a distributed vector.

Parameters
[in]vec
[in]comm
Returns
The global minimum.

Definition at line 126 of file SF_network.h.

Here is the caller graph for this function:

◆ global_to_local() [1/2]

template<class T >
void SF::global_to_local ( const vector< T > &  glob,
vector< T > &  data,
bool  sortedData,
bool  doWarn 
)
inline

Map data, which consists of indices defined by glob, with glob.size() == N, to the range [0, ..., N-1]. glob can be unsorted.

Parameters
globThe global index set.
dataThe data to map.
sortedDataWhether the data is sorted or not.
doWarnWhether to issue a warning if an index cannot be mapped.

Definition at line 540 of file SF_sort.h.

Here is the caller graph for this function:

◆ global_to_local() [2/2]

template<class T >
void SF::global_to_local ( const hashmap::unordered_map< T, T > &  g2l,
vector< T > &  data,
bool  doWarn 
)
inline

Map data, which consists of indices defined by a global2local map, with g2l.size() == N, to the range [0, ..., N-1].

Parameters
g2lThe global to local map.
dataThe data to map.
doWarnWhether to issue a warning if an index cannot be mapped.

Definition at line 587 of file SF_sort.h.

◆ global_to_local_sorted()

template<class T >
void SF::global_to_local_sorted ( const vector< T > &  glob,
vector< T > &  data,
bool  sortedData,
bool  doWarn 
)
inline

Map data, which consists of indices in the range [glob[0], ..., glob[N-1]] to the range [0, ..., N-1]. glob needs to be sorted in ascending order.

Parameters
globThe global index set.
dataThe data to map.
sortedDataWhether the data is sorted or not.
doWarnWhether to issue a warning if an index cannot be mapped.

Definition at line 494 of file SF_sort.h.

◆ index_in_layout()

template<class T >
T SF::index_in_layout ( const T  idx,
const vector< T > &  layout 
)
inline

Definition at line 212 of file SF_network.h.

◆ init_matrix()

template<class T , class S >
void SF::init_matrix ( SF::abstract_matrix< T, S > **  mat)
inline

Initialize a default SF::abstract_matrix based on the param_globals::flavor setting.

Parameters
matThe matrix to initialize
Template Parameters
TInteger type (indices).
SFloating point type (values).
Exceptions
std::errorif the user requests an uncompiled flavor

Definition at line 200 of file SF_init.h.

Here is the caller graph for this function:

◆ init_solver()

template<class T , class S >
void SF::init_solver ( SF::abstract_linear_solver< T, S > **  sol)
inline

Initialize a default SF::abstract_linear_solver based on the param_globals::flavor setting.

Parameters
solThe solver to initialize
Template Parameters
TInteger type (indices).
SFloating point type (values).
Exceptions
std::errorif the user requests an uncompiled flavor

Definition at line 221 of file SF_init.h.

Here is the caller graph for this function:

◆ init_vector() [1/4]

template<class T , class S >
void SF::init_vector ( SF::abstract_vector< T, S > **  vec)
inline

Initialize a default SF::abstract_vector based on the param_globals::flavor setting.

Parameters
vecThe vector to initialize.j
Template Parameters
TInteger type (indices).
SFloating point type (values).
Exceptions
std::errorif the user requests an uncompiled flavor

Definition at line 100 of file SF_init.h.

Here is the caller graph for this function:

◆ init_vector() [2/4]

template<class T , class S >
void SF::init_vector ( SF::abstract_vector< T, S > **  vec,
int  igsize,
int  ilsize,
int  idpn = 1,
typename abstract_vector< T, S >::ltype  ilayout = abstract_vector<T, S>::unset 
)
inline

Initialize an SF::abstract_vector with specified sizes based on the param_globals::flavor setting.

Parameters
vecThe vector to initialize
igsizeGlobal size
ilsizeLocal size
idpnNumber of d.o.f. used per mesh node
ilayoutVector layout w.r.t. used mesh.
Template Parameters
TInteger type (indices).
SFloating point type (values).
Exceptions
std::errorif the user requests an uncompiled flavor

Definition at line 125 of file SF_init.h.

◆ init_vector() [3/4]

template<class T , class S >
void SF::init_vector ( SF::abstract_vector< T, S > **  vec,
const SF::meshdata< mesh_int_t, mesh_real_t > &  mesh,
int  i,
typename SF::abstract_vector< T, S >::ltype  ltype 
)
inline

Initialize an SF::abstract_vector from a mesh based on the param_globals::flavor setting.

Parameters
vecThe vector to initialize
meshThe mesh defining the parallel layout of the vector.
iThe number of d.o.f. per mesh vertex.
ltypeThe vector layout.
Template Parameters
TInteger type (indices).
SFloating point type (values).
Exceptions
std::errorif the user requests an uncompiled flavor

Definition at line 152 of file SF_init.h.

◆ init_vector() [4/4]

template<class T , class S >
void SF::init_vector ( SF::abstract_vector< T, S > **  vec,
SF::abstract_vector< T, S > *  in 
)
inline

Initialize an SF::abstract_vector from another vector based on the param_globals::flavor setting.

Parameters
vecThe vector to initialize
inThe vector to initialize from
Template Parameters
TInteger type (indices).
SFloating point type (values).
Exceptions
std::errorif the user requests an uncompiled flavor

Definition at line 177 of file SF_init.h.

◆ inner_prod()

double SF::inner_prod ( const Point a,
const Point b 
)
inline

Definition at line 90 of file SF_container.h.

Here is the caller graph for this function:

◆ insert_points()

template<class T , class S >
void SF::insert_points ( const vector< S > &  pts,
const vector< T > &  ptsidx,
std::list< meshdata< T, S > *> &  meshlist 
)
inline

Insert the points from the read-in buffers into a list of distributed meshes.

Parameters
meshlistA list of meshes.
[in]Thebasename of the points file.

Definition at line 878 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ insert_surf_hex()

template<class T >
void SF::insert_surf_hex ( const T *  nod,
const size_t  eidx,
vector< T > &  buff,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  surfmap 
)
inline

Definition at line 964 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ insert_surf_pri()

template<class T >
void SF::insert_surf_pri ( const T *  nod,
const size_t  eidx,
vector< T > &  buff,
hashmap::unordered_map< triple< T >, tri_sele< T > > &  surfmap,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  qsurfmap 
)
inline

Definition at line 944 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ insert_surf_pyr()

template<class T >
void SF::insert_surf_pyr ( const T *  nod,
const size_t  eidx,
vector< T > &  buff,
hashmap::unordered_map< triple< T >, tri_sele< T > > &  surfmap,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  qsurfmap 
)
inline

Definition at line 926 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ insert_surf_quad()

template<class T >
void SF::insert_surf_quad ( n1,
n2,
n3,
n4,
size_t  eidx,
vector< T > &  buff,
quadruple< T > &  surf,
quad_sele< T > &  sele,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  surfmap 
)
inline

Definition at line 891 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ insert_surf_tet()

template<class T >
void SF::insert_surf_tet ( const T *  nod,
const size_t  eidx,
hashmap::unordered_map< triple< T >, tri_sele< T > > &  surfmap 
)
inline

Definition at line 909 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ insert_surf_tri()

template<class T >
void SF::insert_surf_tri ( n1,
n2,
n3,
size_t  eidx,
triple< T > &  surf,
tri_sele< T > &  sele,
hashmap::unordered_map< triple< T >, tri_sele< T > > &  surfmap 
)
inline

Definition at line 877 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ inter_domain_mapping()

template<class T , class S >
void SF::inter_domain_mapping ( const meshdata< T, S > &  mesh_a,
const meshdata< T, S > &  mesh_b,
const SF_nbr  snbr,
index_mapping< T > &  a_to_b 
)
inline

Submesh index mapping between different domains/meshes.

Since the parallel distribution is not the same for different meshes, we need MPI communication to generate the mapping information.

Template Parameters
TInteger type.
SFloating point type.
Parameters
[in]mesh_aMesh A.
[in]mesh_bMesh B.
[in]snbrThe type of submesh indexing (NBR_SUBMESH or NBR_PETSC).
[out]a_to_bThe index mapping.

Definition at line 763 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ interval()

template<class T >
void SF::interval ( vector< T > &  vec,
size_t  start,
size_t  end 
)
inline

Create an integer interval between start and end.

Definition at line 350 of file SF_vector.h.

Here is the caller graph for this function:

◆ invert_2x2() [1/3]

template<class S >
dmat<S> SF::invert_2x2 ( const dmat< S > &  m)

Definition at line 508 of file dense_mat.hpp.

Here is the caller graph for this function:

◆ invert_2x2() [2/3]

template<class S >
void SF::invert_2x2 ( S *  ele,
S &  det 
)

Definition at line 521 of file dense_mat.hpp.

◆ invert_2x2() [3/3]

template<class S >
void SF::invert_2x2 ( dmat< S > &  m,
S &  det 
)

Definition at line 537 of file dense_mat.hpp.

◆ invert_3x3() [1/3]

template<class S >
void SF::invert_3x3 ( S *  ele,
S &  det 
)

Definition at line 452 of file dense_mat.hpp.

Here is the caller graph for this function:

◆ invert_3x3() [2/3]

template<class S >
void SF::invert_3x3 ( dmat< S > &  m,
S &  det 
)

Definition at line 474 of file dense_mat.hpp.

◆ invert_3x3() [3/3]

template<class S >
dmat<S> SF::invert_3x3 ( const dmat< S > &  m)

Definition at line 483 of file dense_mat.hpp.

◆ invert_jacobian_matrix()

void SF::invert_jacobian_matrix ( const elem_t  type,
double *  J,
double &  detJ 
)
inline

Definition at line 633 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ is_init()

template<class T , class S >
bool SF::is_init ( const abstract_vector< T, S > *  v)
inline

check is v is initialized. since we have abstract vector pointers in the simulator we need to first check for nullptr, then for v->is_init().

Definition at line 652 of file SF_abstract_vector.h.

Here is the caller graph for this function:

◆ isEmpty()

template<class T >
bool SF::isEmpty ( vector< T > &  v)
inline

Return whether an vector is empty (all values are 0).

Definition at line 378 of file SF_vector.h.

Here is the caller graph for this function:

◆ jacobian_matrix()

void SF::jacobian_matrix ( const dmat< double > &  rshape,
const int  npts,
const Point pts,
double *  J 
)
inline

Compute Jacobian matrix from the real element to the reference element.

Parameters
rshapeReference element shape derivatives.
nptsNumber of points.
ptsPoints array.
JJacobian matrix.

Definition at line 610 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ layout_from_count()

template<class T >
void SF::layout_from_count ( const T  count,
vector< T > &  layout,
MPI_Comm  comm 
)
inline

compute a vector holding the parallel partitioning displacements (i.e. the layout) from a data count input

Definition at line 201 of file SF_network.h.

Here is the caller graph for this function:

◆ local_nodal_to_local_petsc()

template<class T , class S >
T SF::local_nodal_to_local_petsc ( const meshdata< T, S > &  mesh,
int  rank,
local_nodal 
)

A helper function to convert from a local node index in the DD data to the local index of a local PETSc vector chunk. This function expects local_nodal to be in the set mesh.pl.algebraic_nodes().

Definition at line 912 of file SF_parallel_layout.h.

Here is the caller graph for this function:

◆ local_petsc_to_local_nodal()

template<class T , class S >
T SF::local_petsc_to_local_nodal ( const meshdata< T, S > &  mesh,
int  rank,
local_petsc 
)

A helper function to convert from the index in a local PETSc vector chunk to a local node index in the DD data. For many calls use a SF::mapping instead!

Definition at line 925 of file SF_parallel_layout.h.

◆ local_petsc_to_nodal_mapping()

template<class T , class S >
void SF::local_petsc_to_nodal_mapping ( const meshdata< T, S > &  mesh,
index_mapping< T > &  petsc_to_nodal 
)

Definition at line 942 of file SF_parallel_layout.h.

Here is the caller graph for this function:

◆ mag()

double SF::mag ( const Point vect)
inline

vector magnitude

Definition at line 111 of file SF_container.h.

Here is the caller graph for this function:

◆ make_global() [1/2]

template<class T >
void SF::make_global ( const vector< T > &  vec,
vector< T > &  out,
MPI_Comm  comm 
)
inline

make a parallel vector global

Definition at line 225 of file SF_network.h.

Here is the caller graph for this function:

◆ make_global() [2/2]

template<class T >
void SF::make_global ( vector< T > &  vec,
MPI_Comm  comm 
)
inline

Definition at line 237 of file SF_network.h.

◆ max_nodal_edgecount()

template<class T , class S >
int SF::max_nodal_edgecount ( const meshdata< T, S > &  mesh)

Compute the maximum number of node-to-node edges for a mesh.

Template Parameters
TInteger type.
SFloating point type.
Parameters
meshThe mesh.
Returns
The computed maximum.

Definition at line 596 of file SF_container.h.

Here is the caller graph for this function:

◆ MPI_Exchange()

template<class T , class S >
void SF::MPI_Exchange ( commgraph< T > &  grph,
vector< S > &  send,
vector< S > &  recv,
MPI_Comm  comm 
)
inline

Exchange data in parallel over MPI.

Parameters
[in]grphThe communications graph.
[in]sendThe send buffer.
[out]revcThe receive buffer.

Definition at line 47 of file SF_network.h.

Here is the caller graph for this function:

◆ multiply_connectivities()

template<class T >
void SF::multiply_connectivities ( const vector< T > &  a_cnt,
const vector< T > &  a_con,
const vector< T > &  b_cnt,
const vector< T > &  b_con,
vector< T > &  c_cnt,
vector< T > &  c_con 
)
inline

Matrix graph (aka connectivity) multiplication function.

We compute the matrix multiplications C := (A * B)'. Only the matrix graphs are exposed to the outside.

Template Parameters
TInteger type
Parameters
a_cnt[in] A matrix counts
a_con[in] A matrix column indices
b_cnt[in] B matrix counts
b_con[in] B matrix column indices
b_cnt[out] C matrix counts
b_con[out] C matrix column indices

Definition at line 159 of file SF_linalg_utils.h.

Here is the caller graph for this function:

◆ nodal_connectivity_graph()

template<class T , class S >
void SF::nodal_connectivity_graph ( const meshdata< T, S > &  mesh,
vector< T > &  n2n_cnt,
vector< T > &  n2n_con 
)
inline

Compute the node-to-node connectivity.

Parameters
meshThe mesh.
n2n_cntCounts of the connectivity matrix rows.
n2n_conColumn indices of the connectivity matrix.

Definition at line 571 of file SF_container.h.

Here is the caller graph for this function:

◆ normalize()

Point SF::normalize ( const Point vect)
inline

Definition at line 116 of file SF_container.h.

Here is the caller graph for this function:

◆ num_dof()

short SF::num_dof ( elem_t  type,
short  order 
)
inline

Get number of d.o.f. for an element type and an Ansatz function order.

Parameters
typeElement type.
orderAnsatz function order
Returns
Number of d.o.f.

Definition at line 58 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ operator*() [1/5]

Point SF::operator* ( const Point a,
const double &  s 
)
inline

Definition at line 132 of file SF_container.h.

◆ operator*() [2/5]

template<class S >
dmat<S> SF::operator* ( const dmat< S > &  a,
const dmat< S > &  b 
)

Definition at line 373 of file dense_mat.hpp.

◆ operator*() [3/5]

template<class S >
S* SF::operator* ( const dmat< S > &  a,
const S *  v 
)

Definition at line 381 of file dense_mat.hpp.

◆ operator*() [4/5]

template<class S >
dmat<S> SF::operator* ( const dmat< S > &  a,
const S  v 
)

Definition at line 389 of file dense_mat.hpp.

◆ operator*() [5/5]

template<class S >
dmat<S> SF::operator* ( const S  v,
const dmat< S > &  a 
)

Definition at line 397 of file dense_mat.hpp.

◆ operator+() [1/2]

Point SF::operator+ ( const Point a,
const Point b 
)
inline

Definition at line 127 of file SF_container.h.

◆ operator+() [2/2]

template<class S >
dmat<S> SF::operator+ ( const dmat< S > &  a,
const dmat< S > &  b 
)

Definition at line 413 of file dense_mat.hpp.

◆ operator-() [1/2]

Point SF::operator- ( const Point a,
const Point b 
)
inline

Definition at line 122 of file SF_container.h.

◆ operator-() [2/2]

template<class S >
dmat<S> SF::operator- ( const dmat< S > &  a,
const dmat< S > &  b 
)

Definition at line 421 of file dense_mat.hpp.

◆ operator/()

template<class S >
dmat<S> SF::operator/ ( const dmat< S > &  a,
const S  v 
)

Definition at line 405 of file dense_mat.hpp.

◆ operator<() [1/4]

template<class T >
bool SF::operator< ( const struct tuple< T > &  lhs,
const struct tuple< T > &  rhs 
)

Definition at line 761 of file SF_container.h.

◆ operator<() [2/4]

template<class T , class S >
bool SF::operator< ( const struct mixed_tuple< T, S > &  lhs,
const struct mixed_tuple< T, S > &  rhs 
)

Definition at line 769 of file SF_container.h.

◆ operator<() [3/4]

template<class T >
bool SF::operator< ( const struct triple< T > &  lhs,
const struct triple< T > &  rhs 
)

Definition at line 778 of file SF_container.h.

◆ operator<() [4/4]

template<class T >
bool SF::operator< ( const struct quadruple< T > &  lhs,
const struct quadruple< T > &  rhs 
)

Definition at line 789 of file SF_container.h.

◆ orthogonalize()

Point SF::orthogonalize ( const Point a,
const Point b 
)
inline

Definition at line 143 of file SF_container.h.

◆ outer_prod() [1/2]

void SF::outer_prod ( const Point a,
const Point b,
const double  s,
double *  buff,
const bool  add = false 
)
inline

Definition at line 95 of file SF_container.h.

Here is the caller graph for this function:

◆ outer_prod() [2/2]

void SF::outer_prod ( const Point a,
const Point b,
double *  buff 
)
inline

Definition at line 105 of file SF_container.h.

◆ parallel_distribution()

template<class T >
void SF::parallel_distribution ( const vector< T > &  gtarget,
const vector< T > &  cnt,
const vector< T > &  dsp,
const vector< T > &  ranks,
const int  myrank,
vector< T > &  owner,
vector< T > &  counts 
)
inline

The distribution distributes entities between all ranks.

The graph (cnt, dsp, ranks) holds the redistribution candidates. For each entity index i, cnt[i] is the number of ranks that i can be assigned to and the rank indices are ranks[dsp[i]] to ranks[dsp[i+1]].

Parameters
[in]gtargetGlobal number of entities that need to be assigned to each rank.
[in]cntCounts w.r.t. the ranks vector.
[in]dspDisplacements w.r.t. the ranks vector.
[in]ranksThe ranks which can be assigned to each individual entity.
[in]myrankThe rank of the calling process.
[out]ownerThe process index of the owner of each entity.
[out]countsThe number of entities that has been assigned to each process.

Definition at line 57 of file SF_parallel_layout.h.

Here is the caller graph for this function:

◆ parallel_distribution_minrank()

template<class T >
void SF::parallel_distribution_minrank ( const vector< T > &  gtarget,
const vector< T > &  cnt,
const vector< T > &  dsp,
const vector< T > &  ranks,
vector< T > &  owner,
vector< T > &  counts 
)
inline

Definition at line 201 of file SF_parallel_layout.h.

Here is the caller graph for this function:

◆ parallel_fallback_value()

template<class T >
T SF::parallel_fallback_value ( const vector< T > &  vec,
MPI_Comm  comm 
)
inline

Get a fallback value for operations on parallel vectors if the local vector is of 0 size.

The fallback value is the first value of the first rank with a nonzero local size.

Template Parameters
TVector data type
Parameters
vecthe vector.
commMPI communicator used.
Returns
The fallback value.

Definition at line 92 of file SF_network.h.

Here is the caller graph for this function:

◆ permute_mesh()

template<class T , class S >
void SF::permute_mesh ( const meshdata< T, S > &  inmesh,
meshdata< T, S > &  outmesh,
const vector< T > &  perm 
)
inline

Permute the element data of a mesh based on a given permutation.

Parameters
[in]inmeshThe input mesh.
[out]outmeshThe output mesh.
[in]permThe permutation as in: outmesh[i] = inmesh[perm[i]]

Definition at line 56 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ point_to_arr()

template<class V >
void SF::point_to_arr ( Point p,
V *  arr 
)
inline

Definition at line 78 of file SF_container.h.

◆ print_DD_info()

template<class T , class S >
void SF::print_DD_info ( const meshdata< T, S > &  mesh)
inline

Print some basic information on the domain decomposition of a mesh.

Definition at line 473 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ print_mesh_graph()

template<class T , class S >
void SF::print_mesh_graph ( meshdata< T, S > &  mesh)
inline

One-by-one each process prints the graph of a given mesh.

Parameters
meshThe mesh to print the graph of.

Definition at line 730 of file SF_mesh_utils.h.

◆ print_vector()

template<class T >
void SF::print_vector ( MPI_Comm  comm,
const vector< T > &  vec,
const short  dpn,
FILE *  fd 
)

Definition at line 603 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ project()

Point SF::project ( const Point a,
const Point b 
)
inline

project b onto a

Definition at line 138 of file SF_container.h.

Here is the caller graph for this function:

◆ read_elem_block()

template<class T , class S >
void SF::read_elem_block ( FILE *&  fd,
bool  read_binary,
size_t  bstart,
size_t  bsize,
meshdata< T, S > &  mesh 
)
inline

Read a block of size bsize from an CARP element file.

Parameters
[in]fdFile descriptor of the element file.
[in]read_binaryBoolean telling if the file is in binary format.
[in]bstartStarting index of elements.
[in]bsizeNumber of elements to read.
[out]meshMesh structure.

Definition at line 210 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ read_elements()

template<class T , class S >
void SF::read_elements ( meshdata< T, S > &  mesh,
std::string  basename 
)
inline

Read the element data (elements and fibers) of a CARP mesh.

The elements are distributed linearly across the process range.

Parameters
[out]meshThe mesh.
[in]basenameBase of the element file (without file extension).

Definition at line 513 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ read_fib_block()

template<class T , class S >
void SF::read_fib_block ( FILE *&  fd,
bool  read_binary,
bool  twoFib,
size_t  bsize,
meshdata< T, S > &  mesh 
)
inline

Read a chunk of fibers from a file descriptor.

Parameters
[in]fdThe file descriptor.
[in]read_binaryWhether the file is in binary format.
[in]twoFibWhether two fiber directions are provided.
[in]bsizeThe chunk size to read.
[out]meshThe mesh.

Definition at line 396 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ read_headers()

void SF::read_headers ( FILE *  ele_fd,
FILE *  fib_fd,
bool  read_binary,
size_t &  numelem,
bool &  twoFib 
)
inline

Read the header from the element and fiber files.

The files can be in either text or binary format.

Parameters
[in]ele_fdFile descriptor of the element file.
[in]fib_fdFile descriptor of the fibers file.
[in]read_binaryBoolean telling if the file is in binary format.
[out]numelemThe number of elements.
[out]twoFibBoolean holding whether two fiber directions are used.

Definition at line 90 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ read_num_pts()

size_t SF::read_num_pts ( std::string  basename)
inline

Function returns the number of points in a CARP points file.

Parameters
[in]filenameName of the file.
Returns
Number of points.

Definition at line 55 of file SF_mesh_io.h.

◆ read_points()

template<class T , class S >
void SF::read_points ( const std::string  basename,
const MPI_Comm  comm,
vector< S > &  pts,
vector< T > &  ptsidx 
)
inline

Read the points and insert them into a list of meshes.

Parameters
meshlistA list of meshes.
[in]Thebasename of the points file.

Definition at line 807 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ read_pts_block()

template<class S >
void SF::read_pts_block ( FILE *&  fd,
bool  read_binary,
size_t  bsize,
vector< S > &  xyz 
)
inline

Read a chunk of points from a file descriptor.

Parameters
[in]fdThe file descriptor.
[in]read_binaryWhether the file is in binary format.
[in]bsizeThe chunk size to read.
[out]xyzThe buffer where the coordinates are read.

Definition at line 743 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ read_surface_mesh()

template<class T , class S >
void SF::read_surface_mesh ( const meshdata< T, S > &  mesh,
meshdata< T, S > &  surface,
std::string  filename 
)
inline

Definition at line 1425 of file SF_mesh_utils.h.

◆ rebalance_mesh()

template<class T , class S >
void SF::rebalance_mesh ( meshdata< T, S > &  mesh)
inline

Rebalance the parallel distribution of a mesh, if a local size is 0.

Parameters
meshThe mesh to rebalance.

Definition at line 606 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ redistribute_elements() [1/2]

template<class T , class S >
void SF::redistribute_elements ( meshdata< T, S > &  mesh,
meshdata< T, S > &  sendbuff,
vector< T > &  part 
)
inline

Redistribute the element data of a parallel mesh among the ranks based on a partitioning.

Parameters
[in,out]meshThe mesh before and after redistribution.
[out]sendbuffAn auxiliary mesh used for communication.
[in]partThe partitioning. One process rank per element.
Postcondition
The mesh class is filled with the redistributed mesh.

Definition at line 125 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ redistribute_elements() [2/2]

template<class T , class S >
void SF::redistribute_elements ( meshdata< T, S > &  mesh,
vector< T > &  part 
)
inline

Redistribute the element data of a parallel mesh among the ranks based on a partitioning.

Parameters
[in,out]meshThe mesh.
[in]partThe partitioning. One process rank per element.

Definition at line 206 of file SF_mesh_utils.h.

◆ redistribute_mesh()

template<class T , class S >
void SF::redistribute_mesh ( meshdata< T, S > &  mesh,
vector< T > &  part 
)
inline

Redistribute both element and vertex data of a mesh.

Note: This is more expensive than redistribute_elements. Use that function if you can.

Parameters
[in,out]meshThe mesh.
[in]partThe partitioning. One process rank per element.

Definition at line 222 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ reference_shape()

void SF::reference_shape ( const elem_t  type,
const Point  ip,
dmat< double > &  rshape 
)
inline

Compute shape function and its derivatives on a reference element.

Parameters
typeElement type.
orderOrder of the Ansatz functions.
ipIntegration point.
rshapeReference shape and deriv. matrix.

Definition at line 383 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ refine_distribution()

template<class T >
void SF::refine_distribution ( const vector< T > &  gtarget,
const vector< T > &  cnt,
const vector< T > &  dsp,
const vector< T > &  ranks,
const int  myrank,
vector< T > &  owner,
vector< T > &  counts 
)
inline

Further refine a distribution generated by parallel_distribution().

Parameters
[in]gtargetGlobal number of entities that need to be assigned to each rank.
[in]cntCounts w.r.t. the ranks vector.
[in]dspDisplacements w.r.t. the ranks vector.
[in]ranksThe ranks which can be assigned to each individual entity.
[in]myrankThe rank of the calling process.
[out]ownerThe process index of the owner of each entity.
[out]countsThe number of entities that has been assigned to each process.

Definition at line 139 of file SF_parallel_layout.h.

Here is the caller graph for this function:

◆ reindex_cuthill_mckee()

template<class T >
void SF::reindex_cuthill_mckee ( const vector< T > &  n2n_cnt,
const vector< T > &  n2n_dsp,
const vector< T > &  n2n_con,
const bool  reverse,
hashmap::unordered_map< T, T > &  old2new 
)
inline

Definition at line 161 of file SF_numbering.h.

Here is the caller graph for this function:

◆ remove_duplicates() [1/2]

template<class K , class V >
void SF::remove_duplicates ( hashmap::unordered_map< K, V > &  map,
const MPI_Comm  comm 
)
inline

remove parallel duplicates from a hashmap::unordered_map

Definition at line 1238 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ remove_duplicates() [2/2]

template<class K >
void SF::remove_duplicates ( hashmap::unordered_set< K > &  set,
const MPI_Comm  comm 
)
inline

remove parallel duplicates from a hashmap::unordered_set

Definition at line 1254 of file SF_mesh_utils.h.

◆ remove_parallel_duplicates()

template<class T >
void SF::remove_parallel_duplicates ( hashmap::unordered_map< triple< T >, tri_sele< T >> &  tri_surf,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  quad_surf,
MPI_Comm  comm 
)
inline

Definition at line 1268 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ restrict_to_set() [1/2]

template<class T >
void SF::restrict_to_set ( vector< T > &  v,
const hashmap::unordered_set< T > &  set 
)
inline

Definition at line 1544 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ restrict_to_set() [2/2]

template<class T >
void SF::restrict_to_set ( vector< T > &  v,
const vector< T > &  vset 
)
inline

Definition at line 1555 of file SF_mesh_utils.h.

◆ root_count_ascii_lines()

size_t SF::root_count_ascii_lines ( std::string  file,
MPI_Comm  comm 
)
inline

count the lines in a ascii file

Definition at line 440 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ root_read() [1/2]

template<class V >
size_t SF::root_read ( FILE *  fd,
vector< V > &  vec,
MPI_Comm  comm 
)

Read binary data into a vector.

Only rank 0 reads, communicates in chunks.

Template Parameters
VValue type.
Parameters
fdFile descriptor to use for reading.
vecThe data vector to read into. Must be already of correct size.
commMPI communicator to use.
Returns
Total number of items read.

Definition at line 322 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ root_read() [2/2]

template<class V >
size_t SF::root_read ( FILE *  fd,
V *  vec,
const size_t  vec_size,
MPI_Comm  comm 
)

root_read wrapper that takes array pointers instead of vectors.

Definition at line 478 of file SF_parallel_utils.h.

◆ root_read_ascii() [1/2]

template<class V >
size_t SF::root_read_ascii ( FILE *  fd,
vector< V > &  vec,
MPI_Comm  comm,
bool  int_data 
)

Read binary data into a vector.

Only rank 0 reads, communicates in chunks.

Template Parameters
VValue type.
Parameters
fdFile descriptor to use for reading.
vecThe data vector to read into. Must be already of correct size.
commMPI communicator to use.
int_dataWhether to interpret read data as integer or float type.
Returns
Total number of items read.

Definition at line 376 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ root_read_ascii() [2/2]

template<class V >
size_t SF::root_read_ascii ( FILE *  fd,
V *  vec,
const size_t  vec_size,
MPI_Comm  comm,
bool  int_type 
)

root_read_ascii wrapper that takes array pointers instead of vectors.

Definition at line 494 of file SF_parallel_utils.h.

◆ root_write() [1/2]

template<class V >
size_t SF::root_write ( FILE *  fd,
const vector< V > &  vec,
MPI_Comm  comm 
)

Write vector data binary to disk.

Only rank 0 writes, rest communicates in chunks.

Template Parameters
VValue type.
Parameters
fdFile descriptor to use for writing.
vecThe data vector to write.
commMPI communicator to use.
Returns
Number of items written.

Definition at line 250 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ root_write() [2/2]

template<class V >
size_t SF::root_write ( FILE *  fd,
V *  vec,
const size_t  vec_size,
MPI_Comm  comm 
)

root_write wrapper that takes array pointers instead of vectors.

Definition at line 296 of file SF_parallel_utils.h.

◆ root_write_ordered() [1/4]

template<class T , class V >
size_t SF::root_write_ordered ( FILE *  fd,
const vector< T > &  idx,
const vector< V > &  vec,
MPI_Comm  comm 
)

Write index value pairs to disk in ordered permutation.

This function usese sort_parallel before writing with root write.

Template Parameters
TInteger type.
VValue type.
Parameters
fdFile descriptor to use for writing.
idxThe indices vector
vecThe data vector to write.
commMPI communicator to use.
Returns
Number of items written.

Definition at line 522 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ root_write_ordered() [2/4]

template<class T , class V >
size_t SF::root_write_ordered ( FILE *  fd,
const vector< T > &  idx,
const vector< T > &  cnt,
const vector< V > &  vec,
MPI_Comm  comm 
)

Write index value pairs to disk in ordered permutation.

This function usese sort_parallel before writing with root write.

Template Parameters
TInteger type.
VValue type.
Parameters
fdFile descriptor to use for writing.
idxThe indices of each logical unit
cntThe number of vector entries associated to each logical unit
vecThe data vector holding the logical units
commMPI communicator to use.
Returns
Number of items written.

Definition at line 548 of file SF_parallel_utils.h.

◆ root_write_ordered() [3/4]

template<class T , class V >
size_t SF::root_write_ordered ( FILE *  fd,
T *  idx,
V *  vec,
const size_t  vec_size,
MPI_Comm  comm 
)

root_write_ordered wrapper that takes array pointers instead of vectors.

Definition at line 563 of file SF_parallel_utils.h.

◆ root_write_ordered() [4/4]

template<class T , class V >
size_t SF::root_write_ordered ( FILE *  fd,
T *  idx,
T *  cnt,
V *  vec,
const size_t  idx_size,
const size_t  vec_size,
MPI_Comm  comm 
)

root_write_ordered wrapper that takes array pointers instead of vectors.

Definition at line 582 of file SF_parallel_utils.h.

◆ search_for_surface()

template<class T , class S >
void SF::search_for_surface ( const meshdata< T, S > &  mesh,
const SF_nbr  numbering,
const hashmap::unordered_map< triple< T >, tri_sele< T > > &  search_tri,
const hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  search_quad,
hashmap::unordered_map< triple< T >, tri_sele< T > > &  found_tri,
hashmap::unordered_map< quadruple< T >, quad_sele< T > > &  found_quad 
)
inline

Definition at line 983 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ set_element_data()

template<class T , class S >
void SF::set_element_data ( const element_view< mesh_int_t, mesh_real_t > &  view,
SF_real buffer,
abstract_vector< T, S > &  vec 
)
inline

Definition at line 1176 of file SF_fem_utils.h.

◆ shape_deriv()

void SF::shape_deriv ( const double *  iJ,
const dmat< double > &  rshape,
const int  ndof,
dmat< double > &  shape 
)
inline

Compute shape derivatives for an element, based on the shape derivatives of the associated reference element.

Parameters
iJInverse Jacobian from the reference element to the real element.
rshapeReference shape funciton and derivatives.
ndofNumber of d.o.f.
shapeShape derivatives.

Definition at line 674 of file SF_fem_utils.h.

Here is the caller graph for this function:

◆ sort_parallel() [1/3]

template<class T >
void SF::sort_parallel ( MPI_Comm  comm,
const vector< T > &  idx,
vector< T > &  out_idx 
)

Sort index values parallel ascending across the ranks.

Template Parameters
TInteger type.
VValue type.
Parameters
commMPI communicator to use.
idxIndices vector
out_idxOutput indices vector

Definition at line 52 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ sort_parallel() [2/3]

template<class T , class V >
void SF::sort_parallel ( MPI_Comm  comm,
const vector< T > &  idx,
const vector< V > &  val,
vector< T > &  out_idx,
vector< V > &  out_val 
)

Sort index-value tuples parallel ascending across the ranks.

Template Parameters
TInteger type.
VValue type.
Parameters
commMPI communicator to use.
idxIndices vector
valValues vector
out_idxOutput indices vector
out_valOutput values vector

Definition at line 106 of file SF_parallel_utils.h.

◆ sort_parallel() [3/3]

template<class T , class V >
void SF::sort_parallel ( MPI_Comm  comm,
const vector< T > &  idx,
const vector< T > &  cnt,
const vector< V > &  val,
vector< T > &  out_idx,
vector< T > &  out_cnt,
vector< V > &  out_val 
)

Definition at line 154 of file SF_parallel_utils.h.

◆ sum()

template<class T >
T SF::sum ( const vector< T > &  vec)
inline

Compute sum of a vector's entries.

Definition at line 340 of file SF_vector.h.

Here is the caller graph for this function:

◆ tensors_to_array()

template<class S , class V >
void SF::tensors_to_array ( const vector< dmat< S > > &  m,
vector< V > &  arr 
)

Definition at line 557 of file dense_mat.hpp.

◆ transpose()

template<class S >
dmat<S> SF::transpose ( const dmat< S > &  a)

Definition at line 429 of file dense_mat.hpp.

◆ transpose_connectivity()

template<class T >
void SF::transpose_connectivity ( const vector< T > &  a_cnt,
const vector< T > &  a_con,
vector< T > &  b_cnt,
vector< T > &  b_con 
)
inline

Transpose CRS matrix graph A into B.

Template Parameters
TInteger type
Parameters
a_cnt[in] A matrix counts
a_con[in] A matrix column indices
b_cnt[out] B matrix counts
b_con[out] B matrix column indices

Definition at line 186 of file SF_linalg_utils.h.

Here is the caller graph for this function:

◆ treat_file_open_error()

void SF::treat_file_open_error ( const char *  file,
const char *  caller,
const int  errnum,
const bool  do_exit,
int  rank 
)
inline

treat a file open error by displaying the errnum string interpretation and the caller

Definition at line 83 of file SF_io_base.h.

Here is the caller graph for this function:

◆ unique_accumulate() [1/2]

template<class T , class S >
void SF::unique_accumulate ( vector< T > &  _P,
vector< S > &  _A 
)
inline

The unique_accumulate procedure calculates a partial set union of pairs only looking at the first argument and accumulates the values of the second argument of partially matching pairs.

Parameters
_PInput: Vector sorted in ascending order, first argument. Output: Vector sorted in ascending order with only unique elements, first argument.
_AInput: Vector to accumulate, second argument. Output: Vector of accumulated values, second argument.

Definition at line 409 of file SF_sort.h.

Here is the caller graph for this function:

◆ unique_accumulate() [2/2]

template<class T , class S >
void SF::unique_accumulate ( vector< T > &  _P,
vector< T > &  _U,
vector< S > &  _A 
)
inline

The unique_accumulate procedure calculates a partial set union of triples only looking at the first and second argument and accumulates the values of the third argument of partially matching triples.

Parameters
_PInput: Vector sorted in lexicographic order, first argument. Output: Vector sorted in lexicographic order with only unique elements, first argument.
_UInput: Vector sorted in lexicographic order, second argument. Output: Vector sorted in lexicographic order with only unique elements, second argument.
_AInput: Vector to accumulate, third argument. Output: Vector of accumulated values, third argument.

Definition at line 447 of file SF_sort.h.

◆ unique_resize() [1/2]

template<class T >
void SF::unique_resize ( vector< T > &  _P)
inline

The unique_resize procedure calculates the set union of an in ascending order sorted vector.

Parameters
_PInput: Vector sorted in ascending order. Output: Vector sorted in ascending order with only unique elements.

Definition at line 348 of file SF_sort.h.

Here is the caller graph for this function:

◆ unique_resize() [2/2]

template<class T >
void SF::unique_resize ( vector< T > &  _P,
vector< T > &  _U 
)
inline

The unique_resize procedure calculates the set union of an in ascending order sorted vector.

Parameters
_PInput: Vector sorted in ascending order. Output: Vector sorted in ascending order with only unique elements.
_UInput: Vector sorted in ascending order. Output: Vector sorted in ascending order with only unique elements.

Definition at line 376 of file SF_sort.h.

◆ vec_assign()

template<class S , class V >
void SF::vec_assign ( S *  lhs,
const V *  rhs,
size_t  size 
)
inline

Assign the values in rhs to lhs. The data-type of rhs is cast to the type of lhs.

Definition at line 371 of file SF_vector.h.

Here is the caller graph for this function:

◆ write_data_ascii()

template<class T , class S >
void SF::write_data_ascii ( const MPI_Comm  comm,
const vector< T > &  idx,
const vector< S > &  data,
std::string  file,
short  dpn = 1 
)

Definition at line 641 of file SF_parallel_utils.h.

Here is the caller graph for this function:

◆ write_elem_block()

template<class T , class S >
void SF::write_elem_block ( FILE *  fd,
bool  write_binary,
const meshdata< T, S > &  mesh 
)
inline

Write the local element block to a file.

Parameters
[in]fdThe file descriptor.
[in]write_binaryWhether to write in binary format.
[in]meshThe mesh.

Definition at line 314 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ write_elem_headers()

void SF::write_elem_headers ( FILE *&  ele_fd,
FILE *&  fib_fd,
bool  binary,
size_t  numelem,
bool  twoFib 
)
inline

Write the header of the element and fiber files.

The files can be in either text or binary format.

Parameters
[in]ele_fdFile descriptor of the element file.
[in]fib_fdFile descriptor of the fibers file.
[in]binaryWhether to write in binary file format.
[in]numelemThe number of elements.
[in]twoFibOne or two fiber directions.

Definition at line 147 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ write_elements()

template<class T , class S >
void SF::write_elements ( const meshdata< T, S > &  mesh,
bool  binary,
std::string  basename 
)
inline

Read the element data (elements and fibers) of a CARP mesh.

The elements are distributed linearly across the process range.

Parameters
[out]meshThe mesh.
[in]basenameBase of the element file (without file extension).

Definition at line 637 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ write_fib_block()

template<class T , class S >
void SF::write_fib_block ( FILE *&  fd,
bool  write_binary,
const meshdata< T, S > &  mesh 
)
inline

Write the local chunk of fibers to a file.

Parameters
[in]fdThe file descriptor we write to.
[in]write_binaryWhether to write in binary format.
[in]meshThe mesh we write.

Definition at line 465 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ write_mesh_parallel()

template<class T , class S >
void SF::write_mesh_parallel ( const meshdata< T, S > &  mesh,
bool  binary,
std::string  basename 
)
inline

Write a parallel mesh to harddisk without gathering it on one rank.

Template Parameters
TInteger type.
SFloating point type.
Parameters
[in]meshThe mesh to write.
[in]binaryWhether to write in binary format.
[in]basenameThe basename of the mesh files.

Definition at line 334 of file SF_mesh_utils.h.

Here is the caller graph for this function:

◆ write_pts_block()

template<class S >
void SF::write_pts_block ( FILE *&  fd,
bool  write_binary,
const vector< S > &  xyz 
)
inline

Write a chunk of points to a file.

Parameters
[in]fdThe file descriptor we write to.
[in]write_binaryWhether to write in binary format.
[in]xyzThe points coord vector.

Definition at line 780 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ write_pts_header()

void SF::write_pts_header ( FILE *&  pts_fd,
bool  binary,
size_t  numpts 
)
inline

Write the header of the points file.

The files can be in either text or binary format.

Parameters
[in]pts_fdFile descriptor of the points file.
[in]binaryWhether to write in binary file format.
[in]numptsThe number of points.

Definition at line 183 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ write_surface()

template<class T , class S >
void SF::write_surface ( const meshdata< T, S > &  surfmesh,
std::string  surffile 
)
inline

Definition at line 695 of file SF_mesh_io.h.

Here is the caller graph for this function:

◆ writeVTKmesh_binary()

template<class T , class S >
void SF::writeVTKmesh_binary ( const meshdata< T, S > &  mesh,
std::string  file 
)
inline

Write a mesh in binary vtk format.

Parameters
meshThe mesh.
fileThe output file name.

Definition at line 954 of file SF_mesh_io.h.