Skip to content

Commit

Permalink
[PL] Move some methods into private Process' part.
Browse files Browse the repository at this point in the history
  • Loading branch information
endJunction committed Jan 14, 2016
1 parent 5652842 commit e49fa5c
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions ProcessLib/Process.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,24 @@ class Process
_linear_solver_options.reset(new BaseLib::ConfigTree(config));
}

/// Sets the initial condition values in the solution vector x for a given
/// process variable and component.
void setInitialConditions(ProcessVariable const& variable,
int const component_id)
{
std::size_t const n = _mesh.getNNodes();
for (std::size_t i = 0; i < n; ++i)
{
MeshLib::Location const l(_mesh.getID(),
MeshLib::MeshItemType::Node, i);
auto const global_index = std::abs(
_local_to_global_index_map->getGlobalIndex(l, component_id));
_x->set(global_index,
variable.getInitialConditionValue(*_mesh.getNode(i)));
}
}

private:
/// Creates global matrix, rhs and solution vectors, and the linear solver.
void createLinearSolver(std::string const solver_name)
{
Expand Down Expand Up @@ -143,24 +161,6 @@ class Process
*_local_to_global_index_map, _mesh));
}


/// Sets the initial condition values in the solution vector x for a given
/// process variable and component.
void setInitialConditions(ProcessVariable const& variable,
int const component_id)
{
std::size_t const n = _mesh.getNNodes();
for (std::size_t i = 0; i < n; ++i)
{
MeshLib::Location const l(_mesh.getID(),
MeshLib::MeshItemType::Node, i);
auto const global_index = std::abs(
_local_to_global_index_map->getGlobalIndex(l, component_id));
_x->set(global_index,
variable.getInitialConditionValue(*_mesh.getNode(i)));
}
}

protected:
MeshLib::Mesh& _mesh;
std::vector<MeshLib::MeshSubsets*> _all_mesh_subsets;
Expand Down

0 comments on commit e49fa5c

Please sign in to comment.