44 #include <fei_trilinos_macros.hpp>
45 #include <fei_iostream.hpp>
47 #ifdef HAVE_FEI_AZTECOO
55 #define AZTEC_MPI AZTEC_MPI
64 #include <fei_Aztec_Map.hpp>
66 namespace fei_trilinos {
69 Aztec_Map::Aztec_Map(
int globalSz,
int N_update,
const int* update,
70 int localOffs, MPI_Comm comm)
72 proc_config(AZ_PROC_SIZE),
73 update(update, update+N_update),
79 az_transformed(false),
80 globalSize_(globalSz),
82 localOffset_(localOffs),
87 AZ_set_proc_config(&proc_config[0], comm_);
91 Aztec_Map::Aztec_Map(
const Aztec_Map& map) :
92 proc_config(AZ_PROC_SIZE),
98 orderingUpdate(map.orderingUpdate),
99 az_transformed(map.az_transformed),
100 globalSize_(map.globalSize_),
101 localSize_(map.localSize_),
102 localOffset_(map.localOffset_),
103 N_update_(map.localSize_),
106 AZ_processor_info(&proc_config[0]);
107 update_index = (
int*)AZ_allocate(N_update_*
sizeof(
int));
108 for(
int i=0; i<N_update_; ++i) {
109 update_index[i] = map.update_index[i];
111 external = (
int*)AZ_allocate(data_org[AZ_N_external]*
sizeof(
int));
112 extern_index = (
int*)AZ_allocate(data_org[AZ_N_external]*
sizeof(
int));
113 for(
int i=0; i<data_org[AZ_N_external]; ++i) {
114 external[i] = map.external[i];
115 extern_index[i] = map.extern_index[i];
120 Aztec_Map::~Aztec_Map()
126 std::free(update_index);
128 std::free(extern_index);
133 void Aztec_Map::checkInput() {
135 if (globalSize_ <= 0) {
136 throw std::runtime_error(
"Aztec_Map: ERROR, globalSize <= 0.");
139 if (localSize_ < 0) {
140 throw std::runtime_error(
"Aztec_Map: ERROR, localSize negative.");
143 if (localOffset_ < 0) {
144 throw std::runtime_error(
"Aztec_Map: ERROR, localOffset negative.");