FEI Version of the Day
fei_impl_utils.hpp
00001 #ifndef _fei_impl_utils_hpp_
00002 #define _fei_impl_utils_hpp_
00003 
00004 /*--------------------------------------------------------------------*/
00005 /*    Copyright 2008 Sandia Corporation.                              */
00006 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00007 /*    non-exclusive license for use of this work by or on behalf      */
00008 /*    of the U.S. Government.  Export of this program may require     */
00009 /*    a license from the United States Government.                    */
00010 /*--------------------------------------------------------------------*/
00011 
00012 #include <fei_macros.hpp>
00013 #include <fei_fwd.hpp>
00014 #include <fei_mpi.h>
00015 
00016 #include <Teuchos_ParameterList.hpp>
00017 
00018 #include <string>
00019 #include <vector>
00020 #include <map>
00021 
00022 
00025 namespace fei {
00026 
00030 namespace impl_utils {
00031 
00039 void find_offsets(const std::vector<int>& sources,
00040                   const std::vector<int>& targets,
00041                   std::vector<int>& offsets);
00042 
00045 void pack_FillableMat(const fei::FillableMat& mat,
00046                       std::vector<int>& intdata,
00047                       std::vector<double>& doubledata);
00048 
00049 void pack_FillableMat(const fei::FillableMat& mat,
00050                       std::vector<char>& intdata);
00051 
00056 void unpack_FillableMat(const std::vector<int>& intdata,
00057                         const std::vector<double>& doubledata,
00058                         fei::FillableMat& mat,
00059                         bool clear_mat_on_entry = true,
00060                         bool overwrite_entries = true);
00061 
00062 void unpack_FillableMat(const std::vector<char>& intdata,
00063                         fei::FillableMat& mat,
00064                         bool clear_mat_on_entry = true,
00065                         bool overwrite_entries = true);
00066 
00067 void unpack_CSRMat(const std::vector<char>& buffer, fei::CSRMat& mat);
00068 
00069 void pack_indices_coefs(const std::vector<int>& indices,
00070                         const std::vector<double>& coefs,
00071                         std::vector<char>& buffer);
00072 
00073 void unpack_indices_coefs(const std::vector<char>& buffer,
00074                           std::vector<int>& indices,
00075                           std::vector<double>& coefs);
00076 
00077 void separate_BC_eqns(const fei::FillableMat& mat,
00078                     std::vector<int>& bcEqns,
00079                     std::vector<double>& bcVals);
00080 
00081 void create_col_to_row_map(const fei::FillableMat& mat,
00082                            std::multimap<int,int>& crmap);
00083 
00084 int remove_couplings(fei::FillableMat& mat);
00085 
00086 void global_union(MPI_Comm comm,
00087                   const fei::FillableMat& localMatrix,
00088                   fei::FillableMat& globalUnionMatrix);
00089 
00090 void global_union(MPI_Comm comm,
00091                   const fei::CSVec& localVec,
00092                   fei::CSVec& globalUnionVec);
00093 
00094 void translate_to_reduced_eqns(const fei::Reducer& reducer, fei::CSRMat& mat);
00095 
00096 void translate_to_reduced_eqns(const fei::Reducer& reducer, fei::CSVec& vec);
00097 
00098 void add_to_graph(const fei::CSRMat& inmat, fei::Graph& graph);
00099 
00100 void add_to_matrix(const fei::CSRMat& inmat, bool sum_into, fei::Matrix& matrix);
00101 
00102 }//namespace impl_utils
00103 }//namespace fei
00104 
00105 #endif
00106 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends