Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
io_grid_function_ordering.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2022: G-CSC, Goethe University Frankfurt
3 * Author: Lukas Larisch
4 *
5 * This file is part of UG4.
6 *
7 * UG4 is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License version 3 (as published by the
9 * Free Software Foundation) with the following additional attribution
10 * requirements (according to LGPL/GPL v3 §7):
11 *
12 * (1) The following notice must be displayed in the Appropriate Legal Notices
13 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 *
15 * (2) The following notice must be displayed at a prominent place in the
16 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 *
18 * (3) The following bibliography is recommended for citation and must be
19 * preserved in all covered files:
20 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 * parallel geometric multigrid solver on hierarchically distributed grids.
22 * Computing and visualization in science 16, 4 (2013), 151-164"
23 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 * flexible software system for simulating pde based models on high performance
25 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU Lesser General Public License for more details.
31 */
32
33
34#include "lib_disc/domain.h"
38
39namespace ug{
40
41template <typename TDomain, typename TAlgebra>
43{
46
47 typedef typename TGridFunction::template traits<Vertex>::const_iterator VertexConstIterator;
48
49public:
51 {
52 m_u = spGridFct->clone_without_values();
53 m_name = name;
54
55 std::vector<DoFIndex> ind(1);
56 size_t k = 0;
57 for(VertexConstIterator iter = m_u->template begin<Vertex>(); iter != m_u->template end<Vertex>(); ++iter)
58 {
59 // get vertex
60 Vertex* vrt = *iter;
61
62 // get vector holding all indices on the vertex
63 m_u->inner_dof_indices(vrt, 0, ind);
64 DoFRef(*m_u, ind[0]) = k++;
65 }
66 }
67
71
72private:
74 const char* m_name;
75};
76
77} //namespace
location name
Definition checkpoint_util.lua:128
Definition smart_pointer.h:108
represents numerical solutions on a grid using an algebraic vector
Definition grid_function.h:121
Definition grid_function_user_data.h:68
Definition io_grid_function_ordering.cpp:43
SmartPtr< TGridFunctionNumberData > get()
Definition io_grid_function_ordering.cpp:68
const char * m_name
Definition io_grid_function_ordering.cpp:74
GridFunctionNumberData< GridFunction< TDomain, TAlgebra > > TGridFunctionNumberData
Definition io_grid_function_ordering.cpp:45
GridFunction< TDomain, TAlgebra > TGridFunction
Definition io_grid_function_ordering.cpp:44
TGridFunction::template traits< Vertex >::const_iterator VertexConstIterator
Definition io_grid_function_ordering.cpp:47
SmartPtr< TGridFunction > m_u
Definition io_grid_function_ordering.cpp:73
GridFunctionOrdering(SmartPtr< TGridFunction > spGridFct, const char *name)
Definition io_grid_function_ordering.cpp:50
Base-class for all vertex-types.
Definition grid_base_objects.h:231
the ug namespace
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition multi_index.h:276