OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
parallelordering.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef parallelordering_h
36 #define parallelordering_h
37 
38 #include "oofemcfg.h"
39 #include "intarray.h"
40 #include "dofmanager.h"
41 
42 #include <map>
43 
44 namespace oofem {
45 class EngngModel;
46 class IntArray;
47 class UnknownNumberingScheme;
48 
49 class OOFEM_EXPORT ParallelOrdering
50 {
51 public:
53  virtual ~ParallelOrdering() { }
54 
56  bool isLocal(DofManager *dman);
58  bool isShared(DofManager *dman);
59 
65  virtual void init(EngngModel *em, int di, const UnknownNumberingScheme &u) = 0;
66 
73  virtual int giveNumberOfLocalEqs() { return 0; }
77  virtual int giveNumberOfGlobalEqs() { return 0; }
78 
84  virtual int giveNewEq(int leq) = 0;
90  virtual int giveOldEq(int eq) = 0;
91 
92  virtual void map2New(IntArray &answer, const IntArray &src, int baseOffset = 0) = 0;
93  virtual void map2Old(IntArray &answer, const IntArray &src, int baseOffset = 0) = 0;
94 };
95 
100 class OOFEM_EXPORT Natural2GlobalOrdering : public ParallelOrdering
101 {
102 protected:
106  std :: map< int, int >globLocMap;
107 
109  int l_neqs, g_neqs;
110 
111 public:
114 
115  virtual void init(EngngModel *, int di, const UnknownNumberingScheme &n);
116 
117  virtual int giveNewEq(int leq);
118  virtual int giveOldEq(int eq);
119 
120  virtual void map2New(IntArray &answer, const IntArray &src, int baseOffset = 0);
121  virtual void map2Old(IntArray &answer, const IntArray &src, int baseOffset = 0);
122 
123  int giveNumberOfLocalEqs() { return l_neqs; }
124  int giveNumberOfGlobalEqs() { return g_neqs; }
125 
126  IntArray *giveN2Gmap() { return & locGlobMap; }
127 };
128 
133 class OOFEM_EXPORT Natural2LocalOrdering : public ParallelOrdering
134 {
135 protected:
138 
139 public:
142 
143  virtual void init(EngngModel *, int di, const UnknownNumberingScheme &n);
144 
145  virtual int giveNewEq(int leq);
146  virtual int giveOldEq(int eq);
147 
148  virtual void map2New(IntArray &answer, const IntArray &src, int baseOffset = 0);
149  virtual void map2Old(IntArray &answer, const IntArray &src, int baseOffset = 0);
150 
151  IntArray *giveN2Lmap() { return & n2l; }
152 };
153 } // end namespace oofem
154 
155 #endif // parallelordering_h
int giveNumberOfLocalEqs()
Returns number of local eqs; ie.
Ordering from oofem natural ordering (includes all local and shared eqs) to local ordering...
Base class for dof managers.
Definition: dofmanager.h:113
Ordering from oofem natural ordering (includes all local and shared eqs) to global ordering...
Class implementing an array of integers.
Definition: intarray.h:61
IntArray n2l
Natural to local.
virtual int giveNumberOfGlobalEqs()
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
int l_neqs
Number of local and global eqs.
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
the oofem namespace is to define a context or scope in which all oofem names are defined.
std::map< int, int > globLocMap
New to old mapping.
virtual int giveNumberOfLocalEqs()
Returns number of local eqs; ie.
IntArray locGlobMap
Old to new mapping; uses 0-based global eq ordering; 1-based local ordering.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011