1 #ifndef _fei_impl_utils_hpp_
2 #define _fei_impl_utils_hpp_
12 #include <fei_macros.hpp>
13 #include <fei_fwd.hpp>
30 namespace impl_utils {
40 const std::vector<int>& targets,
41 std::vector<int>& offsets);
43 size_t num_bytes_FillableMat(
const fei::FillableMat& mat);
45 void pack_FillableMat(
const fei::FillableMat& mat,
char* buffer);
52 fei::FillableMat& mat,
53 bool clear_mat_on_entry =
true,
54 bool overwrite_entries =
true);
59 size_t num_bytes_indices_coefs(
const std::vector<int>& indices,
60 const std::vector<double>& coefs);
62 void pack_indices_coefs(
const std::vector<int>& indices,
63 const std::vector<double>& coefs,
64 std::vector<char>& buffer,
65 bool resize_buffer=
true);
67 void unpack_indices_coefs(
const std::vector<char>& buffer,
68 std::vector<int>& indices,
69 std::vector<double>& coefs);
71 void separate_BC_eqns(
const fei::FillableMat& mat,
72 std::vector<int>& bcEqns,
73 std::vector<double>& bcVals);
75 void create_col_to_row_map(
const fei::FillableMat& mat,
76 std::multimap<int,int>& crmap);
78 int remove_couplings(fei::FillableMat& mat);
80 void global_union(MPI_Comm comm,
81 const fei::FillableMat& localMatrix,
82 fei::FillableMat& globalUnionMatrix);
84 void global_union(MPI_Comm comm,
88 void translate_to_reduced_eqns(
const fei::Reducer& reducer,
fei::CSRMat& mat);
90 void translate_to_reduced_eqns(
const fei::Reducer& reducer,
fei::CSVec& vec);
bool unpack_CSRMat(const char *buffer_begin, const char *buffer_end, fei::CSRMat &mat)
void find_offsets(const std::vector< int > &sources, const std::vector< int > &targets, std::vector< int > &offsets)
void unpack_FillableMat(const char *buffer_begin, const char *buffer_end, fei::FillableMat &mat, bool clear_mat_on_entry, bool overwrite_entries)