Skip to content
Snippets Groups Projects
Commit 9eb9b8b1 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Move SparsityPattern typedef to MathLib.

Updating includes and use some fwd.decls.
parent b8909bfb
No related branches found
No related tags found
No related merge requests found
...@@ -7,18 +7,15 @@ ...@@ -7,18 +7,15 @@
* *
*/ */
#include "MeshLib/NodeAdjacencyTable.h"
#include "LocalToGlobalIndexMap.h"
#include "ComputeSparsityPattern.h" #include "ComputeSparsityPattern.h"
#include "LocalToGlobalIndexMap.h"
#include "MeshLib/NodeAdjacencyTable.h"
namespace AssemblerLib namespace AssemblerLib
{ {
MathLib::SparsityPattern computeSparsityPattern(
SparsityPattern LocalToGlobalIndexMap const& dof_table, MeshLib::Mesh const& mesh)
computeSparsityPattern(LocalToGlobalIndexMap const& dof_table,
MeshLib::Mesh const& mesh
)
{ {
MeshLib::NodeAdjacencyTable node_adjacency_table; MeshLib::NodeAdjacencyTable node_adjacency_table;
node_adjacency_table.createTable(mesh.getNodes()); node_adjacency_table.createTable(mesh.getNodes());
...@@ -34,7 +31,7 @@ computeSparsityPattern(LocalToGlobalIndexMap const& dof_table, ...@@ -34,7 +31,7 @@ computeSparsityPattern(LocalToGlobalIndexMap const& dof_table,
global_idcs.push_back(dof_table.getGlobalIndices(l)); global_idcs.push_back(dof_table.getGlobalIndices(l));
} }
SparsityPattern sparsity_pattern(dof_table.dofSizeWithGhosts()); MathLib::SparsityPattern sparsity_pattern(dof_table.dofSizeWithGhosts());
// Map adjacent mesh nodes to "adjacent global indices". // Map adjacent mesh nodes to "adjacent global indices".
for (std::size_t n=0; n<mesh.getNNodes(); ++n) for (std::size_t n=0; n<mesh.getNNodes(); ++n)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <vector> #include <vector>
#include "MathLib/LinAlg/SparsityPattern.h"
#include "ProcessLib/NumericsConfig.h" #include "ProcessLib/NumericsConfig.h"
namespace MeshLib namespace MeshLib
...@@ -23,9 +24,6 @@ namespace AssemblerLib ...@@ -23,9 +24,6 @@ namespace AssemblerLib
{ {
class LocalToGlobalIndexMap; class LocalToGlobalIndexMap;
/// A vector telling how many nonzeros there are in each global matrix row.
using SparsityPattern = std::vector<GlobalIndexType>;
/** /**
* @brief Computes a sparsity pattern for the given inputs. * @brief Computes a sparsity pattern for the given inputs.
* *
...@@ -34,11 +32,8 @@ using SparsityPattern = std::vector<GlobalIndexType>; ...@@ -34,11 +32,8 @@ using SparsityPattern = std::vector<GlobalIndexType>;
* *
* @return The computed sparsity pattern. * @return The computed sparsity pattern.
*/ */
SparsityPattern MathLib::SparsityPattern computeSparsityPattern(
computeSparsityPattern( LocalToGlobalIndexMap const& dof_table, MeshLib::Mesh const& mesh);
LocalToGlobalIndexMap const& dof_table,
MeshLib::Mesh const& mesh
);
} }
#endif // ASSEMBLERLIB_COMPUTESPARSITYPATTERN_H #endif // ASSEMBLERLIB_COMPUTESPARSITYPATTERN_H
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
#include <cstddef> #include <cstddef>
#include "AssemblerLib/ComputeSparsityPattern.h" #include "SparsityPattern.h"
namespace AssemblerLib { class LocalToGlobalIndexMap; }
namespace MeshLib { class Mesh; }
namespace MathLib namespace MathLib
{ {
...@@ -20,7 +23,7 @@ namespace MathLib ...@@ -20,7 +23,7 @@ namespace MathLib
struct MatrixSpecifications struct MatrixSpecifications
{ {
MatrixSpecifications(std::size_t const nrows_, std::size_t const ncols_, MatrixSpecifications(std::size_t const nrows_, std::size_t const ncols_,
AssemblerLib::SparsityPattern const*const sparsity_pattern_, SparsityPattern const*const sparsity_pattern_,
AssemblerLib::LocalToGlobalIndexMap const*const dof_table_, AssemblerLib::LocalToGlobalIndexMap const*const dof_table_,
MeshLib::Mesh const*const mesh_) MeshLib::Mesh const*const mesh_)
: nrows(nrows_), ncols(ncols_), sparsity_pattern(sparsity_pattern_) : nrows(nrows_), ncols(ncols_), sparsity_pattern(sparsity_pattern_)
...@@ -29,7 +32,7 @@ struct MatrixSpecifications ...@@ -29,7 +32,7 @@ struct MatrixSpecifications
std::size_t const nrows; std::size_t const nrows;
std::size_t const ncols; std::size_t const ncols;
AssemblerLib::SparsityPattern const*const sparsity_pattern; SparsityPattern const*const sparsity_pattern;
AssemblerLib::LocalToGlobalIndexMap const*const dof_table; AssemblerLib::LocalToGlobalIndexMap const*const dof_table;
MeshLib::Mesh const*const mesh; MeshLib::Mesh const*const mesh;
}; };
......
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#ifndef MATHLIB_LINALG_SPARSITYPATTERN_H
#define MATHLIB_LINALG_SPARSITYPATTERN_H
#include <vector>
#include "ProcessLib/NumericsConfig.h"
namespace MathLib
{
/// A vector telling how many nonzeros there are in each global matrix row.
using SparsityPattern = std::vector<GlobalIndexType>;
}
#endif // MATHLIB_LINALG_SPARSITYPATTERN_H
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "BaseLib/ConfigTree.h" #include "BaseLib/ConfigTree.h"
#include "FileIO/VtkIO/VtuInterface.h" #include "FileIO/VtkIO/VtuInterface.h"
#include "MeshGeoToolsLib/MeshNodeSearcher.h" #include "MeshGeoToolsLib/MeshNodeSearcher.h"
#include "MathLib/LinAlg/SparsityPattern.h"
#include "MeshLib/MeshSubset.h" #include "MeshLib/MeshSubset.h"
#include "MeshLib/MeshSubsets.h" #include "MeshLib/MeshSubsets.h"
...@@ -351,7 +352,7 @@ private: ...@@ -351,7 +352,7 @@ private:
std::unique_ptr<AssemblerLib::LocalToGlobalIndexMap> std::unique_ptr<AssemblerLib::LocalToGlobalIndexMap>
_local_to_global_index_map; _local_to_global_index_map;
AssemblerLib::SparsityPattern _sparsity_pattern; MathLib::SparsityPattern _sparsity_pattern;
std::vector<DirichletBc<GlobalIndexType>> _dirichlet_bcs; std::vector<DirichletBc<GlobalIndexType>> _dirichlet_bcs;
std::vector<std::unique_ptr<NeumannBc<GlobalSetup>>> _neumann_bcs; std::vector<std::unique_ptr<NeumannBc<GlobalSetup>>> _neumann_bcs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment