Skip to content

Commit 6e0c302

Browse files
committed
Move Exodus helper function implementations to .C
These are long enough that they might not be inlined regardless, and this helper class is complicated enough with the declarations alone
1 parent 7dc50cf commit 6e0c302

2 files changed

Lines changed: 30 additions & 22 deletions

File tree

include/mesh/exodusII_io_helper.h

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -942,34 +942,14 @@ class ExodusII_IO_Helper : public ParallelObject
942942
* each processor. This plus a node id gives a valid nodal solution
943943
* vector index.
944944
*/
945-
dof_id_type node_id_to_vec_id(dof_id_type n) const
946-
{
947-
if (_added_side_node_offsets.empty())
948-
return n;
949-
950-
// Find the processor id that has node_id in the parallel vec
951-
const auto lb = std::upper_bound(_true_node_offsets.begin(),
952-
_true_node_offsets.end(), n);
953-
libmesh_assert(lb != _true_node_offsets.end());
954-
const processor_id_type p = lb - _true_node_offsets.begin();
955-
956-
return n + (p ? _added_side_node_offsets[p-1] : 0);
957-
}
945+
dof_id_type node_id_to_vec_id(dof_id_type n) const;
958946

959947
/*
960948
* Returns the sum of both added node "offsets" on processors 0
961949
* through p-1 and real nodes added on processors 0 to p.
962950
* This is the starting index for added nodes' data.
963951
*/
964-
dof_id_type added_node_offset_on(processor_id_type p) const
965-
{
966-
libmesh_assert (p < _true_node_offsets.size());
967-
const dof_id_type added_node_offsets =
968-
(_added_side_node_offsets.empty() || !p) ? 0 :
969-
_added_side_node_offsets[p-1];
970-
return _true_node_offsets[p] + added_node_offsets;
971-
}
972-
952+
dof_id_type added_node_offset_on(processor_id_type p) const;
973953

974954
protected:
975955
/**

src/mesh/exodusII_io_helper.C

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4948,6 +4948,34 @@ void ExodusII_IO_Helper::build_subdomain_map(const MeshBase & mesh, bool local)
49484948
}
49494949

49504950

4951+
4952+
dof_id_type ExodusII_IO_Helper::node_id_to_vec_id(dof_id_type n) const
4953+
{
4954+
if (_added_side_node_offsets.empty())
4955+
return n;
4956+
4957+
// Find the processor id that has node_id in the parallel vec
4958+
const auto lb = std::upper_bound(_true_node_offsets.begin(),
4959+
_true_node_offsets.end(), n);
4960+
libmesh_assert(lb != _true_node_offsets.end());
4961+
const processor_id_type p = lb - _true_node_offsets.begin();
4962+
4963+
return n + (p ? _added_side_node_offsets[p-1] : 0);
4964+
}
4965+
4966+
4967+
4968+
dof_id_type ExodusII_IO_Helper::added_node_offset_on(processor_id_type p) const
4969+
{
4970+
libmesh_assert (p < _true_node_offsets.size());
4971+
const dof_id_type added_node_offsets =
4972+
(_added_side_node_offsets.empty() || !p) ? 0 :
4973+
_added_side_node_offsets[p-1];
4974+
return _true_node_offsets[p] + added_node_offsets;
4975+
}
4976+
4977+
4978+
49514979
int ExodusII_IO_Helper::Conversion::get_node_map(int i) const
49524980
{
49534981
if (!node_map)

0 commit comments

Comments
 (0)