MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / insert

Method insert

cpp/dolfinx/la/SparsityPattern.cpp:142–161  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

140}
141//-----------------------------------------------------------------------------
142void SparsityPattern::insert(std::int32_t row, std::int32_t col)
143{
144 if (!_offsets.empty())
145 {
146 throw std::runtime_error(
147 "Cannot insert into sparsity pattern. It has already been finalized");
148 }
149
150 assert(_index_maps[0]);
151 const std::int32_t max_row
152 = _index_maps[0]->size_local() + _index_maps[0]->num_ghosts() - 1;
153
154 if (row > max_row or row < 0)
155 {
156 throw std::runtime_error(
157 "Cannot insert rows that do not exist in the IndexMap.");
158 }
159
160 _row_cache[row].push_back(col);
161}
162//-----------------------------------------------------------------------------
163void SparsityPattern::insert(std::span<const std::int32_t> rows,
164 std::span<const std::int32_t> cols)

Callers 15

create_test_sparsityFunction · 0.95
test_distributed_csrFunction · 0.95
_mat_randomFunction · 0.95
test_create_matrix_csrFunction · 0.95
test_custom_partitionerFunction · 0.80
laFunction · 0.80
declare_formFunction · 0.80
conf.pyFile · 0.80
display_vectorFunction · 0.80
test_matrixFunction · 0.80
interval.cppFile · 0.80
interior_facetsMethod · 0.80

Calls 2

size_localMethod · 0.80
num_ghostsMethod · 0.80

Tested by 6

create_test_sparsityFunction · 0.76
test_distributed_csrFunction · 0.76
_mat_randomFunction · 0.76
test_create_matrix_csrFunction · 0.76
test_custom_partitionerFunction · 0.64
test_matrixFunction · 0.64