Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/beaminteraction/src/4C_beaminteraction_calc_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,7 @@ namespace BeamInteraction
std::vector<int> colgids(coleleset.begin(), coleleset.end());

// create new ele col map
Core::LinAlg::Map newelecolmap(
-1, static_cast<int>(colgids.size()), colgids.data(), 0, discret.get_comm());
Core::LinAlg::Map newelecolmap(-1, std::span<const int>(colgids), 0, discret.get_comm());

// temporarily extend ghosting
Core::Binstrategy::Utils::extend_discretization_ghosting(
Expand Down Expand Up @@ -1254,7 +1253,7 @@ namespace BeamInteraction
std::vector<int> mapvec(eletypeset[i].begin(), eletypeset[i].end());
eletypeset[i].clear();
maps[i] = std::make_shared<Core::LinAlg::Map>(
-1, mapvec.size(), mapvec.data(), 0, discret.get_comm());
-1, std::span<const int>(mapvec), 0, discret.get_comm());
}

eletypeextractor.setup(*discret.element_row_map(), maps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ void Solid::ModelEvaluator::BeamInteractionModelEvaluator::extend_ghosting()
// build auxiliary bin col map
std::vector<int> auxgids(colbins.begin(), colbins.end());
std::shared_ptr<Core::LinAlg::Map> auxmap = std::make_shared<Core::LinAlg::Map>(
-1, static_cast<int>(auxgids.size()), auxgids.data(), 0, bindis_->get_comm());
-1, std::span<const int>(auxgids), 0, bindis_->get_comm());

std::shared_ptr<Core::LinAlg::Map> ia_elecolmap = binstrategy_->extend_element_col_map(
ia_state_ptr_->get_bin_to_row_ele_map(), ia_state_ptr_->get_bin_to_row_ele_map(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ void BeamInteraction::BeamToSolidMortarManager::setup()
}

// Rowmap for the additional GIDs used by the mortar contact discretization.
lambda_dof_rowmap_translations_ =
std::make_shared<Core::LinAlg::Map>(-1, my_lambda_gid_translational.size(),
my_lambda_gid_translational.data(), 0, discret_->get_comm());
lambda_dof_rowmap_rotations_ = std::make_shared<Core::LinAlg::Map>(-1,
my_lambda_gid_rotational.size(), my_lambda_gid_rotational.data(), 0, discret_->get_comm());
lambda_dof_rowmap_translations_ = std::make_shared<Core::LinAlg::Map>(
-1, std::span<const int>(my_lambda_gid_translational), 0, discret_->get_comm());
lambda_dof_rowmap_rotations_ = std::make_shared<Core::LinAlg::Map>(
-1, std::span<const int>(my_lambda_gid_rotational), 0, discret_->get_comm());
lambda_dof_rowmap_ =
Core::LinAlg::merge_map(lambda_dof_rowmap_translations_, lambda_dof_rowmap_rotations_, false);
// We need to be able to get the global ids for a Lagrange multiplier DOF from the global id
// of a node or element. To do so, we 'abuse' the Core::LinAlg::MultiVector<double> as map between
// the global node / element ids and the global Lagrange multiplier DOF ids.
Core::LinAlg::Map node_gid_rowmap(-1, n_nodes, my_nodes_gid.data(), 0, discret_->get_comm());
Core::LinAlg::Map node_gid_rowmap(
-1, std::span<const int>(my_nodes_gid.data(), n_nodes), 0, discret_->get_comm());
Core::LinAlg::Map element_gid_rowmap(
-1, n_element, my_elements_gid.data(), 0, discret_->get_comm());
-1, std::span<const int>(my_elements_gid.data(), n_element), 0, discret_->get_comm());

// Map from global node / element ids to global lagrange multiplier ids. Only create the
// multivector if it hase one or more columns.
Expand Down Expand Up @@ -214,9 +214,9 @@ void BeamInteraction::BeamToSolidMortarManager::set_global_maps()

// Create the beam and solid maps.
beam_dof_rowmap_ = std::make_shared<Core::LinAlg::Map>(
-1, beam_dofs.size(), beam_dofs.data(), 0, discret_->get_comm());
-1, std::span<const int>(beam_dofs), 0, discret_->get_comm());
solid_dof_rowmap_ = std::make_shared<Core::LinAlg::Map>(
-1, solid_dofs.size(), solid_dofs.data(), 0, discret_->get_comm());
-1, std::span<const int>(solid_dofs), 0, discret_->get_comm());

// Reset the local maps.
node_gid_to_lambda_gid_map_.clear();
Expand Down Expand Up @@ -279,9 +279,9 @@ void BeamInteraction::BeamToSolidMortarManager::set_local_maps(

// Create the maps for the extraction of the values.
Core::LinAlg::Map node_gid_needed_rowmap(
-1, node_gid_needed.size(), node_gid_needed.data(), 0, discret_->get_comm());
-1, std::span<const int>(node_gid_needed), 0, discret_->get_comm());
Core::LinAlg::Map element_gid_needed_rowmap(
-1, element_gid_needed.size(), element_gid_needed.data(), 0, discret_->get_comm());
-1, std::span<const int>(element_gid_needed), 0, discret_->get_comm());

// Create the Multivectors that will be filled with all values needed on this rank.
std::shared_ptr<Core::LinAlg::MultiVector<double>> node_gid_to_lambda_gid_copy = nullptr;
Expand Down Expand Up @@ -333,7 +333,7 @@ void BeamInteraction::BeamToSolidMortarManager::set_local_maps(

// Create the global lambda col map.
lambda_dof_colmap_ = std::make_shared<Core::LinAlg::Map>(
-1, lambda_gid_for_col_map.size(), lambda_gid_for_col_map.data(), 0, discret_->get_comm());
-1, std::span<const int>(lambda_gid_for_col_map), 0, discret_->get_comm());

// Set flags for local maps.
is_local_maps_build_ = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ void BeamInteraction::add_beam_interaction_nodal_forces(
for (unsigned int dim = 0; dim < 3; ++dim) gid_solid_dof.push_back(gid_node[dim]);
}
Core::LinAlg::Map beam_dof_map(
-1, gid_beam_dof.size(), gid_beam_dof.data(), 0, discret_ptr->get_comm());
-1, std::span<const int>(gid_beam_dof), 0, discret_ptr->get_comm());
Core::LinAlg::Map solid_dof_map(
-1, gid_solid_dof.size(), gid_solid_dof.data(), 0, discret_ptr->get_comm());
-1, std::span<const int>(gid_solid_dof), 0, discret_ptr->get_comm());

// Extract the forces and add them to the discretization.
std::shared_ptr<Core::LinAlg::Vector<double>> force_beam =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void BeamInteraction::BeamToSolidOutputWriterVisualization::
}
}
node_gid_map_ = std::make_shared<Core::LinAlg::Map>(
-1, my_global_dof_ids.size(), my_global_dof_ids.data(), 0, discret_->get_comm());
-1, std::span<const int>(my_global_dof_ids), 0, discret_->get_comm());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ void BeamInteraction::SubmodelEvaluator::Crosslinking::read_restart(

// build dummy map according to read data on myrank
Core::LinAlg::Map dummy_cl_map(
-1, read_node_ids.size(), read_node_ids.data(), 0, bin_discret().get_comm());
-1, std::span<const int>(read_node_ids), 0, bin_discret().get_comm());

// build exporter object
std::shared_ptr<Core::Communication::Exporter> exporter =
Expand Down Expand Up @@ -1513,7 +1513,7 @@ void BeamInteraction::SubmodelEvaluator::Crosslinking::read_restart(

// build dummy map according to read data on myrank
std::shared_ptr<Core::LinAlg::Map> dummy_beam_map = std::make_shared<Core::LinAlg::Map>(
-1, read_ele_ids.size(), read_ele_ids.data(), 0, discret().get_comm());
-1, std::span<const int>(read_ele_ids), 0, discret().get_comm());

// build exporter object
exporter = std::make_shared<Core::Communication::Exporter>(
Expand Down
2 changes: 1 addition & 1 deletion src/cardiovascular0d/4C_cardiovascular0d_dofset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int Utils::Cardiovascular0DDofSet::assign_degrees_of_freedom(

// dofrowmap with index base = 0
dofrowmap_ =
std::make_shared<Core::LinAlg::Map>(-1, gids.size(), gids.data(), 0, dis->get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(gids), 0, dis->get_comm());

return count;
}
Expand Down
2 changes: 1 addition & 1 deletion src/constraint/4C_constraint_dofset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int Constraints::ConstraintDofSet::assign_degrees_of_freedom(

// dofrowmap with index base = 0
dofrowmap_ =
std::make_shared<Core::LinAlg::Map>(-1, gids.size(), gids.data(), 0, dis->get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(gids), 0, dis->get_comm());

return count;
}
Expand Down
4 changes: 2 additions & 2 deletions src/constraint/4C_constraint_multipointconstraint2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ Constraints::MPConstraint2::create_discretization_from_condition(
std::vector<int> boundarynoderowvec(rownodeset.begin(), rownodeset.end());
rownodeset.clear();
Core::LinAlg::Map constraintnoderowmap(
-1, boundarynoderowvec.size(), boundarynoderowvec.data(), 0, newdis->get_comm());
-1, std::span<const int>(boundarynoderowvec), 0, newdis->get_comm());
boundarynoderowvec.clear();

// build overlapping node column map
std::vector<int> constraintnodecolvec(colnodeset.begin(), colnodeset.end());
colnodeset.clear();
Core::LinAlg::Map constraintnodecolmap(
-1, constraintnodecolvec.size(), constraintnodecolvec.data(), 0, newdis->get_comm());
-1, std::span<const int>(constraintnodecolvec), 0, newdis->get_comm());

constraintnodecolvec.clear();

Expand Down
4 changes: 2 additions & 2 deletions src/constraint/4C_constraint_multipointconstraint3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ Constraints::MPConstraint3::create_discretization_from_condition(
std::vector<int> boundarynoderowvec(rownodeset.begin(), rownodeset.end());
rownodeset.clear();
Core::LinAlg::Map constraintnoderowmap(
-1, boundarynoderowvec.size(), boundarynoderowvec.data(), 0, newdis->get_comm());
-1, std::span<const int>(boundarynoderowvec), 0, newdis->get_comm());
boundarynoderowvec.clear();

// build overlapping node column map
std::vector<int> constraintnodecolvec(colnodeset.begin(), colnodeset.end());
colnodeset.clear();
Core::LinAlg::Map constraintnodecolmap(
-1, constraintnodecolvec.size(), constraintnodecolvec.data(), 0, newdis->get_comm());
-1, std::span<const int>(constraintnodecolvec), 0, newdis->get_comm());

constraintnodecolvec.clear();
newdis->redistribute({constraintnoderowmap, constraintnodecolmap});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ void Constraints::EmbeddedMesh::SolidToSolidMortarManager::setup(

// Rowmap for the additional GIDs used by the mortar contact discretization.
lambda_dof_rowmap_ = std::make_shared<Core::LinAlg::Map>(
-1, my_lambda_gid.size(), my_lambda_gid.data(), 0, discret_->get_comm());
-1, std::span<const int>(my_lambda_gid), 0, discret_->get_comm());

// We need to be able to get the global ids for a Lagrange multiplier DOF from the global id
// of a node. To do so, we 'abuse' the Core::LinAlg::MultiVector<double> as map between the
// global node ids and the global Lagrange multiplier DOF ids.
Core::LinAlg::Map node_gid_rowmap(-1, n_nodes, my_nodes_gid.data(), 0, discret_->get_comm());
Core::LinAlg::Map node_gid_rowmap(
-1, std::span<const int>(my_nodes_gid.data(), n_nodes), 0, discret_->get_comm());

// Map from global node ids to global lagrange multiplier ids. Only create the
// multivector if it has one or more columns.
Expand Down Expand Up @@ -207,11 +208,10 @@ void Constraints::EmbeddedMesh::SolidToSolidMortarManager::set_global_maps()
}

// Create the beam and solid maps.
boundary_layer_interface_dof_rowmap_ =
std::make_shared<Core::LinAlg::Map>(-1, boundary_layer_interface_dofs.size(),
boundary_layer_interface_dofs.data(), 0, discret_->get_comm());
boundary_layer_interface_dof_rowmap_ = std::make_shared<Core::LinAlg::Map>(
-1, std::span<const int>(boundary_layer_interface_dofs), 0, discret_->get_comm());
background_dof_rowmap_ = std::make_shared<Core::LinAlg::Map>(
-1, background_dofs.size(), background_dofs.data(), 0, discret_->get_comm());
-1, std::span<const int>(background_dofs), 0, discret_->get_comm());

// Reset the local maps.
node_gid_to_lambda_gid_map_.clear();
Expand Down Expand Up @@ -265,7 +265,7 @@ void Constraints::EmbeddedMesh::SolidToSolidMortarManager::set_local_maps(

// Create the maps for the extraction of the values.
Core::LinAlg::Map node_gid_needed_rowmap(
-1, node_gid_needed.size(), node_gid_needed.data(), 0, discret_->get_comm());
-1, std::span<const int>(node_gid_needed), 0, discret_->get_comm());

// Create the Multivectors that will be filled with all values needed on this rank.
std::shared_ptr<Core::LinAlg::MultiVector<double>> node_gid_to_lambda_gid_copy = nullptr;
Expand Down Expand Up @@ -297,7 +297,7 @@ void Constraints::EmbeddedMesh::SolidToSolidMortarManager::set_local_maps(

// Create the global lambda col map.
lambda_dof_colmap_ = std::make_shared<Core::LinAlg::Map>(
-1, lambda_gid_for_col_map.size(), lambda_gid_for_col_map.data(), 0, discret_->get_comm());
-1, std::span<const int>(lambda_gid_for_col_map), 0, discret_->get_comm());

// Set flags for local maps.
is_local_maps_build_ = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Constraints::SubmodelEvaluator::NullspaceConstraintManager::NullspaceConstraintM
}

dof_condition_map_ = std::make_shared<Core::LinAlg::Map>(
-1, cond_dof_gids.size(), cond_dof_gids.data(), 0, discret_ptr_->get_comm());
-1, std::span<const int>(cond_dof_gids), 0, discret_ptr_->get_comm());
}

/*----------------------------------------------------------------------------*
Expand Down
3 changes: 1 addition & 2 deletions src/contact/src/4C_contact_abstract_strategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,7 @@ std::shared_ptr<Core::LinAlg::Map> CONTACT::AbstractStrategy::create_determinist

my_lm_gids[slid] = interface_lmgid;
}
return std::make_shared<Core::LinAlg::Map>(
-1, static_cast<int>(my_lm_gids.size()), my_lm_gids.data(), 0, get_comm());
return std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(my_lm_gids), 0, get_comm());
}


Expand Down
44 changes: 23 additions & 21 deletions src/contact/src/4C_contact_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,17 @@ void CONTACT::Interface::update_target_source_sets()
}

sdofVertexRowmap_ =
std::make_shared<Core::LinAlg::Map>(-1, (int)sVr.size(), sVr.data(), 0, get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(sVr), 0, get_comm());
sdofVertexColmap_ =
std::make_shared<Core::LinAlg::Map>(-1, (int)sVc.size(), sVc.data(), 0, get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(sVc), 0, get_comm());
sdofEdgeRowmap_ =
std::make_shared<Core::LinAlg::Map>(-1, (int)sEr.size(), sEr.data(), 0, get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(sEr), 0, get_comm());
sdofEdgeColmap_ =
std::make_shared<Core::LinAlg::Map>(-1, (int)sEc.size(), sEc.data(), 0, get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(sEc), 0, get_comm());
sdofSurfRowmap_ =
std::make_shared<Core::LinAlg::Map>(-1, (int)sSr.size(), sSr.data(), 0, get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(sSr), 0, get_comm());
sdofSurfColmap_ =
std::make_shared<Core::LinAlg::Map>(-1, (int)sSc.size(), sSc.data(), 0, get_comm());
std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(sSc), 0, get_comm());
}
}

Expand Down Expand Up @@ -533,7 +533,7 @@ void CONTACT::Interface::extend_interface_ghosting_safely(const double meanVeloc
Core::LinAlg::gather<int>(sdata, rdata, (int)allproc.size(), allproc.data(), get_comm());

// build completely overlapping map of nodes (on ALL processors)
Core::LinAlg::Map newnodecolmap(-1, (int)rdata.size(), rdata.data(), 0, get_comm());
Core::LinAlg::Map newnodecolmap(-1, std::span<const int>(rdata), 0, get_comm());
sdata.clear();
rdata.clear();

Expand All @@ -547,7 +547,7 @@ void CONTACT::Interface::extend_interface_ghosting_safely(const double meanVeloc
Core::LinAlg::gather<int>(sdata, rdata, (int)allproc.size(), allproc.data(), get_comm());

// build complete overlapping map of elements (on ALL processors)
Core::LinAlg::Map newelecolmap(-1, (int)rdata.size(), rdata.data(), 0, get_comm());
Core::LinAlg::Map newelecolmap(-1, std::span<const int>(rdata), 0, get_comm());
sdata.clear();
rdata.clear();
allproc.clear();
Expand Down Expand Up @@ -599,7 +599,7 @@ void CONTACT::Interface::extend_interface_ghosting_safely(const double meanVeloc
}

// build new node column map (on ALL processors)
Core::LinAlg::Map newnodecolmap(-1, (int)rdata.size(), rdata.data(), 0, get_comm());
Core::LinAlg::Map newnodecolmap(-1, std::span<const int>(rdata), 0, get_comm());
sdata.clear();
rdata.clear();

Expand Down Expand Up @@ -631,7 +631,7 @@ void CONTACT::Interface::extend_interface_ghosting_safely(const double meanVeloc
}

// build new element column map (on ALL processors)
Core::LinAlg::Map newelecolmap(-1, (int)rdata.size(), rdata.data(), 0, get_comm());
Core::LinAlg::Map newelecolmap(-1, std::span<const int>(rdata), 0, get_comm());
sdata.clear();
rdata.clear();
allproc.clear();
Expand Down Expand Up @@ -690,7 +690,7 @@ void CONTACT::Interface::extend_interface_ghosting_safely(const double meanVeloc
}

std::vector<int> colnodes(nodes.begin(), nodes.end());
Core::LinAlg::Map nodecolmap(-1, (int)colnodes.size(), colnodes.data(), 0, get_comm());
Core::LinAlg::Map nodecolmap(-1, std::span<const int>(colnodes), 0, get_comm());

discret().export_column_nodes(nodecolmap);
break;
Expand Down Expand Up @@ -767,9 +767,9 @@ void CONTACT::Interface::redistribute()

// we need an arbitrary preliminary element row map
Core::LinAlg::Map sourceCloseRowEles(
-1, (int)closeele.size(), closeele.data(), 0, Interface::get_comm());
-1, std::span<const int>(closeele), 0, Interface::get_comm());
Core::LinAlg::Map sourceNonCloseRowEles(
-1, (int)noncloseele.size(), noncloseele.data(), 0, Interface::get_comm());
-1, std::span<const int>(noncloseele), 0, Interface::get_comm());
Core::LinAlg::Map targetRowEles(*target_row_elements());

// check for consistency
Expand Down Expand Up @@ -995,7 +995,7 @@ void CONTACT::Interface::redistribute()
mygids.resize(count);
sort(mygids.begin(), mygids.end());
srownodes = std::make_shared<Core::LinAlg::Map>(
-1, (int)mygids.size(), mygids.data(), 0, sourceCloseRowNodes->get_comm());
-1, std::span<const int>(mygids), 0, sourceCloseRowNodes->get_comm());
}

// merge interface node row map from source and target parts
Expand Down Expand Up @@ -1028,8 +1028,9 @@ void CONTACT::Interface::redistribute()
// get column map from the graph -> build source node column map
const Core::LinAlg::Map& bcol = outgraph->col_map();
std::shared_ptr<Core::LinAlg::Map> scolnodes =
std::make_shared<Core::LinAlg::Map>(bcol.num_global_elements(), bcol.num_my_elements(),
bcol.my_global_elements(), 0, Interface::get_comm());
std::make_shared<Core::LinAlg::Map>(bcol.num_global_elements(),
std::span<const int>(bcol.my_global_elements(), bcol.num_my_elements()), 0,
Interface::get_comm());

// trash new graph
outgraph = nullptr;
Expand Down Expand Up @@ -7408,8 +7409,10 @@ bool CONTACT::Interface::split_active_dofs()
FOUR_C_THROW("split_active_dofs: Splitting went wrong!");

// create Nmap and Tmap objects
activen_ = std::make_shared<Core::LinAlg::Map>(gcountN, countN, myNgids.data(), 0, get_comm());
activet_ = std::make_shared<Core::LinAlg::Map>(gcountT, countT, myTgids.data(), 0, get_comm());
activen_ = std::make_shared<Core::LinAlg::Map>(
gcountN, std::span<const int>(myNgids.data(), countN), 0, get_comm());
activet_ = std::make_shared<Core::LinAlg::Map>(
gcountT, std::span<const int>(myTgids.data(), countT), 0, get_comm());

// *******************************************************************
// FRICTION - EXTRACTING TANGENTIAL DOFS FROM SLIP DOFS
Expand Down Expand Up @@ -7468,7 +7471,7 @@ bool CONTACT::Interface::split_active_dofs()

// create Tslipmap objects
slipt_ = std::make_shared<Core::LinAlg::Map>(
gcountslipT, countslipT, myslipTgids.data(), 0, get_comm());
gcountslipT, std::span<const int>(myslipTgids.data(), countslipT), 0, get_comm());

return true;
}
Expand Down Expand Up @@ -7552,8 +7555,7 @@ void CONTACT::Interface::update_self_contact_lag_mult_set(
lmdofs.push_back(ref_lmgids[ref_lid]);
}

lmdofmap_ = std::make_shared<Core::LinAlg::Map>(
-1, static_cast<int>(lmdofs.size()), lmdofs.data(), 0, get_comm());
lmdofmap_ = std::make_shared<Core::LinAlg::Map>(-1, std::span<const int>(lmdofs), 0, get_comm());
}

/*----------------------------------------------------------------------------*
Expand Down
Loading
Loading