268 rank_dvs(
_comm.size(), 0);
294 std::map<uint_t, MAST::Optimization::DesignParameter<ScalarType>*>
295 dof_to_ghost_param_map;
306 std::vector<std::vector<uint_t>>
307 ghosted_indices_on_rank_send(
_comm.size()),
308 ghosted_indices_on_rank_recv(
_comm.size()),
309 ghosted_dv_id_on_rank_recv(
_comm.size());
315 owner = dof_map.dof_owner(dof_id);
318 ghosted_indices_on_rank_send[owner].push_back(dof_id);
330 if (i ==
_comm.rank())
331 _comm.send(j, ghosted_indices_on_rank_send[j]);
332 else if (j ==
_comm.rank())
333 _comm.receive(i, ghosted_indices_on_rank_recv[i]);
345 for (
uint_t k=0; k<ghosted_indices_on_rank_recv[i].size(); k++) {
348 Assert2(ghosted_indices_on_rank_recv[i][k]
349 >= dof_map.first_dof(
_comm.rank()),
350 ghosted_indices_on_rank_recv[i][k],
351 dof_map.first_dof(
_comm.rank()),
352 "Requested dof does not belong to this processor");
353 Assert2(ghosted_indices_on_rank_recv[i][k]
354 < dof_map.end_dof(
_comm.rank()),
355 ghosted_indices_on_rank_recv[i][k],
356 dof_map.end_dof(
_comm.rank()),
357 "Requested dof does not belong to this processor");
360 std::map<uint_t, uint_t>::const_iterator
364 "No DV Id found for this dof id");
366 ghosted_indices_on_rank_recv[i][k] = it->second;
375 if (( i ==
_comm.rank() && ghosted_indices_on_rank_recv[j].size()) ||
376 ( j ==
_comm.rank() && ghosted_indices_on_rank_send[i].size())) {
380 if (i ==
_comm.rank())
381 _comm.send(j, ghosted_indices_on_rank_recv[j]);
382 else if (j ==
_comm.rank()) {
384 _comm.receive(i, ghosted_dv_id_on_rank_recv[i]);
387 ghosted_dv_id_on_rank_recv[i].
size(),
388 ghosted_indices_on_rank_send[i].
size(),
389 ghosted_dv_id_on_rank_recv[i].
size(),
390 "Dof and DV ID map sizes must be same");
396 for (
uint_t k=0; k<ghosted_dv_id_on_rank_recv[i].size(); k++) {
398 dof_id = ghosted_indices_on_rank_send[i][k];
399 dv_id = ghosted_dv_id_on_rank_recv[i][k];
400 dof_to_ghost_param_map[dof_id]->set_id(dv_id);
std::map< uint_t, MAST::Optimization::DesignParameter< ScalarType > * > _parameters
std::vector< MAST::Optimization::DesignParameter< ScalarType > * > _local_parameters
std::vector< MAST::Optimization::DesignParameter< ScalarType > * > _ghosted_parameters
const libMesh::Parallel::Communicator & _comm
const MAST::Base::ParameterData & get_data_for_parameter(const MAST::Optimization::DesignParameter< ScalarType > &p) const
#define Assert0(cond, msg)
std::vector< uint_t > _rank_begin_index
#define Assert2(cond, v1, v2, msg)
std::vector< uint_t > _rank_end_index
std::map< uint_t, uint_t > _dof_id_to_dv_id_map