diff --git a/Tests/VecMatOnMeshLib/TestSerialLinearSolver.cpp b/Tests/VecMatOnMeshLib/TestSerialLinearSolver.cpp
index ec6f8536b1f88bfc22b3b452a65efe864d8939fa..368c5c9963c8c2dca3b8124ca7b9b752253d86ae 100644
--- a/Tests/VecMatOnMeshLib/TestSerialLinearSolver.cpp
+++ b/Tests/VecMatOnMeshLib/TestSerialLinearSolver.cpp
@@ -18,6 +18,8 @@
 
 #include <gtest/gtest.h>
 
+#include "AssemblerLib/MeshComponentMap.h"
+
 #include "MathLib/LinAlg/Dense/DenseTools.h"
 #include "MathLib/LinAlg/Solvers/GaussAlgorithm.h"
 #include "MathLib/LinAlg/FinalizeMatrixAssembly.h"
@@ -32,7 +34,6 @@
 
 #include "VecMatOnMeshLib/MeshItemWiseTask/LinearSystemAssembler.h"
 #include "VecMatOnMeshLib/Serial/SerialVectorMatrixBuilder.h"
-#include "VecMatOnMeshLib/VecMeshItems/MeshComponentMap.h"
 
 #include "../TestTools.h"
 #include "SteadyDiffusion2DExample1.h"
@@ -61,8 +62,8 @@ TEST(VecMatOnMeshLib, SerialLinearSolver)
 	std::vector<MeshLib::MeshSubsets*> vec_comp_dis;
 	vec_comp_dis.push_back(
 	    new MeshLib::MeshSubsets(&mesh_items_all_nodes));
-	VecMatOnMeshLib::MeshComponentMap vec1_composition(
-	    vec_comp_dis, VecMatOnMeshLib::ComponentOrder::BY_COMPONENT);
+	AssemblerLib::MeshComponentMap vec1_composition(
+	    vec_comp_dis, AssemblerLib::ComponentOrder::BY_COMPONENT);
 
 	// allocate a vector and matrix
 	typedef SerialBuilder::VectorType TVec;
@@ -92,8 +93,8 @@ TEST(VecMatOnMeshLib, SerialLinearSolver)
 			    (*e)->getNode(j)->getID());
 
 		map_ele_nodes2vec_entries.push_back(
-		    vec1_composition.getDataIDList
-				<VecMatOnMeshLib::ComponentOrder::BY_COMPONENT>(vec_items));
+		    vec1_composition.getGlobalIndices
+				<AssemblerLib::ComponentOrder::BY_COMPONENT>(vec_items));
 	}
 
 	// Local and global assemblers.
diff --git a/Tests/VecMatOnMeshLib/TestSerialVecMat.cpp b/Tests/VecMatOnMeshLib/TestSerialVecMat.cpp
index d6c5b172a566ab30d9c57dbd81c9ec351ddbe3f1..2cc804d1e7552c9e3e51c9b7e7665f2ed23e59be 100644
--- a/Tests/VecMatOnMeshLib/TestSerialVecMat.cpp
+++ b/Tests/VecMatOnMeshLib/TestSerialVecMat.cpp
@@ -20,6 +20,8 @@
 
 #include <gtest/gtest.h>
 
+#include "AssemblerLib/MeshComponentMap.h"
+
 #include "MathLib/LinAlg/Dense/DenseMatrix.h"
 #include "MathLib/LinAlg/Dense/DenseTools.h"
 #include "MathLib/MathTools.h"
@@ -36,7 +38,6 @@
 #include "VecMatOnMeshLib/MeshItemWiseTask/MatrixAssembler.h"
 #include "VecMatOnMeshLib/MeshItemWiseTask/VectorAssembler.h"
 #include "VecMatOnMeshLib/Serial/SerialVectorMatrixBuilder.h"
-#include "VecMatOnMeshLib/VecMeshItems/MeshComponentMap.h"
 
 #include "../TestTools.h"
 
@@ -125,8 +126,8 @@ TEST(VecMatOnMeshLib, SerialVectorMatrixBuilder)
 	vec_comp_dis.push_back(
 	    new MeshLib::MeshSubsets(&mesh_items_left_nodes));
 
-	VecMatOnMeshLib::MeshComponentMap vec1_composition(
-	    vec_comp_dis, VecMatOnMeshLib::ComponentOrder::BY_COMPONENT);
+	AssemblerLib::MeshComponentMap vec1_composition(
+	    vec_comp_dis, AssemblerLib::ComponentOrder::BY_COMPONENT);
 	//vec1_composition.print();
 
 	// allocate a vector and matrix
@@ -143,7 +144,7 @@ TEST(VecMatOnMeshLib, SerialVectorMatrixBuilder)
 	std::vector<std::vector<std::size_t> > map_node2vec_entry(
 	        mesh_items_left_nodes.getNNodes());
 	for (std::size_t i = 0; i < map_node2vec_entry.size(); i++)
-		map_node2vec_entry[i] = vec1_composition.getDataIDList(
+		map_node2vec_entry[i] = vec1_composition.getGlobalIndices(
 	        MeshLib::Location(msh->getID(),
 	                                  MeshLib::MeshItemType::Node,
 		                              mesh_items_left_nodes.getNodeID(i)));
@@ -179,8 +180,8 @@ TEST(VecMatOnMeshLib, SerialVectorMatrixBuilder)
 					MeshLib::MeshItemType::Node,
 					e->getNode(j)->getID()));
 
-			mat_row_column_positions.push_back(vec1_composition.getDataIDList
-				<VecMatOnMeshLib::ComponentOrder::BY_COMPONENT>(vec_items));
+			mat_row_column_positions.push_back(vec1_composition.getGlobalIndices
+				<AssemblerLib::ComponentOrder::BY_COMPONENT>(vec_items));
 			//std::cout << i << ": ";
 			//std::copy(vec_data_pos[i].begin(), vec_data_pos[i].end(),
 			//    std::ostream_iterator<std::size_t>(std::cout, " "));
diff --git a/Tests/VecMatOnMeshLib/TestVectorComposition.cpp b/Tests/VecMatOnMeshLib/TestVectorComposition.cpp
deleted file mode 100644
index 705e921caf24628eaad01b022fbfef476296bbd8..0000000000000000000000000000000000000000
--- a/Tests/VecMatOnMeshLib/TestVectorComposition.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * \file
- * \author Norihiro Watanabe
- * \date   2013-04-16
- * \brief  Implementation tests.
- *
- * \copyright
- * Copyright (c) 2013, OpenGeoSys Community (http://www.opengeosys.org)
- *            Distributed under a Modified BSD License.
- *              See accompanying file LICENSE.txt or
- *              http://www.opengeosys.org/project/license
- *
- */
-
-#include <gtest/gtest.h>
-#include <vector>
-
-#include "MeshLib/MeshGenerators/MeshGenerator.h"
-#include "MeshLib/MeshSubsets.h"
-
-#include "VecMatOnMeshLib/VecMeshItems/MeshComponentMap.h"
-
-class VecMatOnMeshLibTest : public ::testing::Test
-{
-	public:
-	VecMatOnMeshLibTest()
-	    : mesh(nullptr), mesh_items(nullptr)
-	{
-		mesh = MeshLib::MeshGenerator::generateLineMesh(1.0, 9);
-		mesh_items = new MeshLib::MeshSubset(*mesh, mesh->getNodes());
-
-		//set up data arrangement
-		vec_comp_dis.emplace_back(new MeshLib::MeshSubsets(mesh_items));
-		vec_comp_dis.emplace_back(new MeshLib::MeshSubsets(mesh_items));
-
-	}
-	~VecMatOnMeshLibTest()
-	{
-		std::remove_if(vec_comp_dis.begin(), vec_comp_dis.end(),
-		    [](MeshLib::MeshSubsets* p) { delete p; return true; });
-		delete mesh_items;
-		delete mesh;
-	}
-
-	MeshLib::Mesh const* mesh;
-	MeshLib::MeshSubset const* mesh_items;
-
-	//data component 0 and 1 are assigned to all nodes in the mesh
-	std::size_t const comp0_id = 0;
-	std::size_t const comp1_id = 1;
-	std::vector<MeshLib::MeshSubsets*> vec_comp_dis;
-};
-
-TEST_F(VecMatOnMeshLibTest, DataArrangementByComponentType)
-{
-	// This test checks the following case:
-	// - Each node has two scalar values (i.e. two components per node)
-	// - A vector is created such that it contains all nodal values
-	// - Entries in the vector are arranged in the order of a component type and then node ID
-	// - For example, x=[(node 0, comp 0) (node 1, comp 0) ... (node n, comp0), (node 0, comp1) ... ]
-
-	//set up data arrangement
-	VecMatOnMeshLib::MeshComponentMap da(
-	    vec_comp_dis, VecMatOnMeshLib::ComponentOrder::BY_COMPONENT);
-	//std::cout << "# database \n";
-	//da.print();
-	//std::cout << std::endl;
-
-	using MeshLib::MeshItemType;
-	typedef MeshLib::Location Loc;
-	//check
-	auto checkNodeAndComponent =
-	    [&da, this](std::size_t const n, std::size_t const c)
-	    {
-	        return da.getDataID(Loc(mesh->getID(), MeshItemType::Node, n), c);
-	    };
-
-	ASSERT_EQ(20u, da.size());
-	ASSERT_EQ(0u , checkNodeAndComponent(0, comp0_id));
-	ASSERT_EQ(1u , checkNodeAndComponent(1, comp0_id));
-	ASSERT_EQ(10u, checkNodeAndComponent(0, comp1_id));
-	ASSERT_EQ(11u, checkNodeAndComponent(1, comp1_id));
-
-	auto vecCompIDs = da.getComponentIDs(
-	    Loc(mesh->getID(), MeshItemType::Node, 0));
-	ASSERT_EQ(2u, vecCompIDs.size());
-	ASSERT_EQ(0u, vecCompIDs[0]);
-	ASSERT_EQ(1u, vecCompIDs[1]);
-
-	//check out of range
-	std::size_t const out_of_range = std::numeric_limits<std::size_t>::max();
-	ASSERT_EQ(out_of_range, checkNodeAndComponent(10, comp0_id));
-	ASSERT_EQ(out_of_range, da.getDataID(
-	    Loc(mesh->getID() + 1, MeshItemType::Node, 0), comp0_id));
-	ASSERT_EQ(out_of_range, da.getDataID(
-	    Loc(mesh->getID(), MeshItemType::Cell, 0), comp0_id));
-	ASSERT_EQ(out_of_range, da.getDataID(
-	    Loc(mesh->getID(), MeshItemType::Node, 0), 10));
-}
-
-TEST_F(VecMatOnMeshLibTest, DataArrangementByLocationType)
-{
-	// This test checks the following case:
-	// - Each node has two scalar values (i.e. two components per node)
-	// - A vector is created such that it contains all nodal values
-	// - Entries in the vector are arranged in the order of node ID and then a component type
-	// - For example, x=[(node 0, comp 0) (node 0, comp 1) ... (node n, comp0), (node n, comp1) ]
-
-	//set up data arrangement
-	VecMatOnMeshLib::MeshComponentMap da(
-	    vec_comp_dis, VecMatOnMeshLib::ComponentOrder::BY_LOCATION);
-	//std::cout << "# database \n";
-	//da.print();
-	//std::cout << std::endl;
-
-	using MeshLib::MeshItemType;
-	typedef MeshLib::Location Loc;
-	//check
-	auto checkNodeAndComponent =
-	    [&da, this](std::size_t const n, std::size_t const c)
-	    {
-	        return da.getDataID(Loc(mesh->getID(), MeshItemType::Node, n), c);
-	    };
-
-	ASSERT_EQ(20u, da.size());
-	ASSERT_EQ(0u, checkNodeAndComponent(0, comp0_id));
-	ASSERT_EQ(1u, checkNodeAndComponent(0, comp1_id));
-	ASSERT_EQ(2u, checkNodeAndComponent(1, comp0_id));
-	ASSERT_EQ(3u, checkNodeAndComponent(1, comp1_id));
-	auto vecCompIDs = da.getComponentIDs(
-	    Loc(mesh->getID(), MeshItemType::Node, 0));
-	ASSERT_EQ(2u, vecCompIDs.size());
-	ASSERT_EQ(0u, vecCompIDs[0]);
-	ASSERT_EQ(1u, vecCompIDs[1]);
-
-	//check out of range
-	std::size_t const out_of_range = std::numeric_limits<std::size_t>::max();
-	ASSERT_EQ(out_of_range, checkNodeAndComponent(10, comp0_id));
-	ASSERT_EQ(out_of_range, da.getDataID(
-	    Loc(mesh->getID() + 1, MeshItemType::Node, 0), comp0_id));
-	ASSERT_EQ(out_of_range, da.getDataID(
-	    Loc(mesh->getID(), MeshItemType::Cell, 0), comp0_id));
-	ASSERT_EQ(out_of_range, da.getDataID(
-	    Loc(mesh->getID(), MeshItemType::Node, 0), 10));
-}
diff --git a/VecMatOnMeshLib/Serial/SerialVectorMatrixBuilder.h b/VecMatOnMeshLib/Serial/SerialVectorMatrixBuilder.h
index 667ead192e6ad217c1eb55a5bd9f9b508aaf8749..ca128c841386e69cf1bda21987aa833489a58065 100644
--- a/VecMatOnMeshLib/Serial/SerialVectorMatrixBuilder.h
+++ b/VecMatOnMeshLib/Serial/SerialVectorMatrixBuilder.h
@@ -22,11 +22,13 @@
 #include "MathLib/LinAlg/Dense/GlobalDenseMatrix.h"
 #include "MathLib/LinAlg/Lis/LisMatrix.h"
 
-#include "../VecMeshItems/MeshComponentMap.h"
+#include "AssemblerLib/MeshComponentMap.h"
 
 namespace VecMatOnMeshLib
 {
 
+using AssemblerLib::MeshComponentMap;
+
 /**
  * Non-parallel version using default LinAlg
  */
diff --git a/VecMatOnMeshLib/VecMeshItems/MeshComponentMap.cpp b/VecMatOnMeshLib/VecMeshItems/MeshComponentMap.cpp
deleted file mode 100644
index c389536ca986a23b13f76fd2bddb17a8f7e47d6e..0000000000000000000000000000000000000000
--- a/VecMatOnMeshLib/VecMeshItems/MeshComponentMap.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * \file
- * \author Norihiro Watanabe
- * \date   2013-04-16
- * \brief
- *
- * \copyright
- * Copyright (c) 2013, OpenGeoSys Community (http://www.opengeosys.org)
- *            Distributed under a Modified BSD License.
- *              See accompanying file LICENSE.txt or
- *              http://www.opengeosys.org/project/license
- *
- */
-
-
-#include "MeshComponentMap.h"
-
-#include <numeric>
-#include <iostream>
-#include <boost/range/algorithm/for_each.hpp>
-
-#include "MeshLib/MeshSubsets.h"
-
-namespace VecMatOnMeshLib
-{
-
-MeshComponentMap::MeshComponentMap(const std::vector<MeshLib::MeshSubsets*> &components, ComponentOrder order)
-{
-    // construct dict (and here we number global_index by component type)
-    std::size_t global_index = 0;
-    for (auto component = components.begin(); component != components.end(); ++component) {
-        auto comp_id = std::distance(components.begin(), component);
-        for (unsigned mesh_subset_index = 0; mesh_subset_index < (*component)->size(); mesh_subset_index++) {
-			MeshLib::MeshSubset const& mesh_subset = (*component)->getMeshSubset(mesh_subset_index);
-            std::size_t mesh_id = mesh_subset.getMeshID();
-            // mesh items are ordered first by node, cell, ....
-            for (std::size_t j=0; j<mesh_subset.getNNodes(); j++) {
-                _dict.insert(MeshitemDataPosition(Location(mesh_id, MeshLib::MeshItemType::Node, j), comp_id, global_index++));
-            }
-            for (std::size_t j=0; j<mesh_subset.getNElements(); j++) {
-                _dict.insert(MeshitemDataPosition(Location(mesh_id, MeshLib::MeshItemType::Cell, j), comp_id, global_index++));
-            }
-        }
-    }
-
-    if (order == ComponentOrder::BY_LOCATION)
-        renumberByLocation();
-}
-
-void MeshComponentMap::renumberByLocation(std::size_t offset)
-{
-    std::size_t global_index = offset;
-
-    auto &m = _dict.get<ByLocation>(); // view as sorted by mesh item
-    for (auto itr_mesh_item=m.begin(); itr_mesh_item!=m.end(); ++itr_mesh_item) {
-        MeshitemDataPosition pos = *itr_mesh_item;
-        pos.global_index = global_index++;
-        m.replace(itr_mesh_item, pos);
-    }
-}
-
-
-std::size_t MeshComponentMap::getDataID(const Location &pos, unsigned compID) const
-{
-    auto &m = _dict.get<ByLocationAndComponent>();
-    auto itr = m.find(MeshitemDataPosition(pos, compID, -1));
-    return itr!=m.end() ? itr->global_index : -1;
-}
-
-std::vector<std::size_t> MeshComponentMap::getComponentIDs(const Location &pos) const
-{
-    auto &m = _dict.get<ByLocation>();
-    auto p = m.equal_range(MeshitemDataPosition(pos, -1, -1));
-    std::vector<std::size_t> vec_compID;
-    for (auto itr=p.first; itr!=p.second; ++itr)
-        vec_compID.push_back(itr->comp_id);
-    return vec_compID;
-}
-
-std::vector<std::size_t> MeshComponentMap::getDataIDList(const Location &pos) const
-{
-    auto &m = _dict.get<ByLocation>();
-    auto p = m.equal_range(MeshitemDataPosition(pos, -1, -1));
-    std::vector<std::size_t> vec_dataID;
-    for (auto itr=p.first; itr!=p.second; ++itr)
-        vec_dataID.push_back(itr->global_index);
-    return vec_dataID;
-}
-
-
-template <>
-std::vector<std::size_t>
-MeshComponentMap::getDataIDList<ComponentOrder::BY_LOCATION>(
-    const std::vector<Location> &vec_pos) const
-{
-    // Create vector of global indices sorted by location containing all
-    // locations given in vec_pos parameter.
-
-    std::vector<std::size_t> vec_dataID;
-    vec_dataID.reserve(vec_pos.size());
-
-    auto &m = _dict.get<ByLocation>();
-    for (auto &location : vec_pos) {
-        auto p = m.equal_range(MeshitemDataPosition(location, -1, -1));
-        for (auto itr=p.first; itr!=p.second; ++itr)
-            vec_dataID.push_back(itr->global_index);
-    }
-
-    return vec_dataID;
-}
-
-template <>
-std::vector<std::size_t>
-MeshComponentMap::getDataIDList<ComponentOrder::BY_COMPONENT>(
-    const std::vector<Location> &vec_pos) const
-{
-    // vector of (Component, global Index) pairs.
-    typedef std::pair<std::size_t, std::size_t> CIPair;
-    std::vector<CIPair> pairs;
-    pairs.reserve(vec_pos.size());
-
-    // Create a sub dictionary containing all lines with location from vec_pos.
-    auto const &m = _dict.get<ByLocation>();
-    for (auto const &location : vec_pos) {
-        auto const p = m.equal_range(MeshitemDataPosition(location, -1, -1));
-        for (auto itr=p.first; itr!=p.second; ++itr)
-            pairs.emplace_back(itr->comp_id, itr->global_index);
-    }
-
-    auto CIPairLess = [](CIPair const& a, CIPair const& b)
-        {
-            return (a.first < b.first);
-        };
-
-    // Create vector of global indices from sub dictionary sorting by component.
-    if (!std::is_sorted(pairs.begin(), pairs.end(), CIPairLess))
-        std::stable_sort(pairs.begin(), pairs.end(), CIPairLess);
-
-    std::vector<std::size_t> vec_dataID;
-    vec_dataID.reserve(pairs.size());
-    for (auto p = pairs.cbegin(); p != pairs.cend(); ++p)
-        vec_dataID.push_back(p->second);
-
-    return vec_dataID;
-}
-
-#ifndef NDEBUG
-void disp(const MeshitemDataPosition &dat)
-{
-    dat.print();
-}
-
-void MeshComponentMap::print()
-{
-
-    boost::for_each(_dict, disp);
-}
-#endif	// NDEBUG
-
-} // VecMatOnMeshLib
-
diff --git a/VecMatOnMeshLib/VecMeshItems/MeshComponentMap.h b/VecMatOnMeshLib/VecMeshItems/MeshComponentMap.h
deleted file mode 100644
index 34a0ff66b60cb8de074ab3673abbbfd924379b5b..0000000000000000000000000000000000000000
--- a/VecMatOnMeshLib/VecMeshItems/MeshComponentMap.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * \file
- * \author Norihiro Watanabe
- * \date   2013-04-16
- * \brief
- *
- * \copyright
- * Copyright (c) 2013, 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 MESHDOFMAPPING_H_
-#define MESHDOFMAPPING_H_
-
-#include <vector>
-
-#include "MeshLib/Location.h"
-
-#include "MeshItemDataPositionDictionary.h"
-
-namespace MeshLib
-{
-	class MeshSubsets;
-}
-
-namespace VecMatOnMeshLib
-{
-
-/// Ordering of components in global matrix/vector.
-enum class ComponentOrder
-{
-    BY_COMPONENT,   ///< Ordering data by component type
-    BY_LOCATION     ///< Ordering data by spatial location
-};
-
-/// Multidirectional mapping between mesh entities and degrees of freedom.
-class MeshComponentMap
-{
-public:
-	using Location = MeshLib::Location;
-public:
-	/**
-	 *
-	 * @param vec_comp_dis    a vector of component distributions
-	 * The size of the vector means the number of components in the vector.
-	 * @param ordering        type of ordering values in a vector
-	 */
-    MeshComponentMap(const std::vector<MeshLib::MeshSubsets*> &vec_comp_dis, ComponentOrder order);
-
-    /// return the size of the vector
-    std::size_t size() const { return _dict.size(); }
-
-    /// return a vector of component IDs on a given mesh item
-    std::vector<std::size_t> getComponentIDs(const Location &item) const;
-
-    /// find a mesh item on which a given data position is assigned
-	Location getMeshItem(unsigned dataID) const;
-
-    /// find a data position from a given mesh item and component ID
-    std::size_t getDataID(const Location &item, unsigned compID) const;
-
-    /**
-     * return a vector of data positions related to a given mesh item
-     *
-     * @param item   Location
-     * @return a vector of data positions
-     * If there is more than one component on a given mesh item, the function returns
-     * a vector containing data positions for each component.
-     */
-    std::vector<std::size_t> getDataIDList(const Location &item) const;
-
-    /**
-     * return a vector of data positions corresponding to given items
-     *
-     * @param vec_items  a vector of mesh items
-     * @tparam ORDER     ordering of data positions in a resulted vector
-     * @return
-     */
-    template <ComponentOrder ORDER>
-    std::vector<std::size_t> getDataIDList(const std::vector<Location> &vec_items) const;
-
-#ifndef NDEBUG
-    const MeshitemDataPositionDictionary& getDictionary() const {return _dict; }
-    void print();
-#endif	// NDEBUG
-
-private:
-    void renumberByLocation(std::size_t offset=0);
-
-private:
-    MeshitemDataPositionDictionary _dict;
-};
-
-} // MESHDOFMAPPING_H_
-
-#endif /* MESHDOFMAPPING_H_ */
diff --git a/VecMatOnMeshLib/VecMeshItems/MeshItemDataPositionDictionary.h b/VecMatOnMeshLib/VecMeshItems/MeshItemDataPositionDictionary.h
deleted file mode 100644
index 853c8321cd7448a0b657ff6f2d2f3af7b46370ba..0000000000000000000000000000000000000000
--- a/VecMatOnMeshLib/VecMeshItems/MeshItemDataPositionDictionary.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * \file
- * \author Norihiro Watanabe
- * \date   2013-04-16
- * \brief
- *
- * \copyright
- * Copyright (c) 2013, 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 MESHITEMDATAPOSITIONDICTIONARY_H_
-#define MESHITEMDATAPOSITIONDICTIONARY_H_
-
-#include <iostream>
-
-#include <boost/multi_index_container.hpp>
-#include <boost/multi_index/member.hpp>
-#include <boost/multi_index/ordered_index.hpp>
-#include <boost/multi_index/composite_key.hpp>
-
-#include "MeshLib/Location.h"
-
-namespace VecMatOnMeshLib
-{
-
-struct MeshitemDataPosition
-{
-	MeshLib::Location location;
-
-    // Physical component
-    std::size_t comp_id;
-
-    // Position in global matrix or vector
-    std::size_t global_index;
-
-    MeshitemDataPosition(MeshLib::Location const& location,
-                         std::size_t comp_id,
-                         std::size_t global_index)
-    : location(location),
-      comp_id(comp_id),
-      global_index(global_index)
-    {}
-
-    void print() const
-    {
-        std::cout << location << ", " << comp_id << ", " << global_index << "\n";
-    }
-};
-
-struct MeshitemDataPositionByLocationComparator
-{
-    bool operator()(MeshitemDataPosition const& a, MeshitemDataPosition const& b) const
-    {
-        return a.location < b.location;
-    }
-};
-
-struct MeshitemDataPositionByLocationAndComponentComparator
-{
-    bool operator()(MeshitemDataPosition const& a, MeshitemDataPosition const& b) const
-    {
-        if (a.location < b.location)
-            return true;
-        if (b.location < a.location)
-            return false;
-
-        // a.loc == b.loc
-        return a.comp_id < b.comp_id;
-    }
-};
-
-struct ByLocation {};
-struct ByLocationAndComponent {};
-struct ByComponent {};
-struct ByGlobalIndex {};
-
-typedef boost::multi_index::multi_index_container<
-        MeshitemDataPosition,
-        boost::multi_index::indexed_by
-        <
-            boost::multi_index::ordered_unique
-            <
-                boost::multi_index::tag<ByLocationAndComponent>,
-                boost::multi_index::identity<MeshitemDataPosition>,
-                MeshitemDataPositionByLocationAndComponentComparator
-            >,
-            boost::multi_index::ordered_non_unique
-            <
-                boost::multi_index::tag<ByLocation>,
-                boost::multi_index::identity<MeshitemDataPosition>,
-                MeshitemDataPositionByLocationComparator
-            >,
-            boost::multi_index::ordered_non_unique
-            <
-                boost::multi_index::tag<ByComponent>,
-                boost::multi_index::member<MeshitemDataPosition, std::size_t, &MeshitemDataPosition::comp_id>
-            >,
-            boost::multi_index::ordered_non_unique
-            <
-                boost::multi_index::tag<ByGlobalIndex>,
-                boost::multi_index::member<MeshitemDataPosition, std::size_t, &MeshitemDataPosition::global_index>
-            >
-        >
-    > MeshitemDataPositionDictionary;
-
-} // VecMatOnMeshLib
-
-#endif /* MESHITEMDATAPOSITIONDICTIONARY_H_ */