Xyce
6.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
N_DEV_SGF_Interface.h
Go to the documentation of this file.
1
//-----------------------------------------------------------------------------
2
// Copyright Notice
3
//
4
// Copyright 2002 Sandia Corporation. Under the terms
5
// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6
// Government retains certain rights in this software.
7
//
8
// Xyce(TM) Parallel Electrical Simulator
9
// Copyright (C) 2002-2015 Sandia Corporation
10
//
11
// This program is free software: you can redistribute it and/or modify
12
// it under the terms of the GNU General Public License as published by
13
// the Free Software Foundation, either version 3 of the License, or
14
// (at your option) any later version.
15
//
16
// This program is distributed in the hope that it will be useful,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
// GNU General Public License for more details.
20
//
21
// You should have received a copy of the GNU General Public License
22
// along with this program. If not, see <http://www.gnu.org/licenses/>.
23
//-----------------------------------------------------------------------------
24
25
//-----------------------------------------------------------------------------
26
// Filename : $RCSfile: N_DEV_SGF_Interface.h,v $
27
//
28
// Purpose : This file contains auxilliary classes, etc. which
29
// are neccessary for outputting sgplot files, and
30
// also for reading SGF mesh files.
31
//
32
// Special Notes :
33
//
34
// Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
35
//
36
// Creation Date : 07/08/03
37
//
38
// Revision Information:
39
// ---------------------
40
//
41
// Revision Number: $Revision: 1.8.2.1 $
42
//
43
// Revision Date : $Date: 2015/04/02 18:20:12 $
44
//
45
// Current Owner : $Author: tvrusso $
46
//-----------------------------------------------------------------------------
47
48
#ifndef Xyce_N_DEV_SGF_INTERFACE_h
49
#define Xyce_N_DEV_SGF_INTERFACE_h
50
51
// ---------- Standard Includes ----------
52
53
// ---------- Xyce Includes ----------
54
55
// ---------- Forward Declarations -------
56
57
//-----------------------------------------------------------------------------
58
// Legacy class definitions needed for sgplot output.
59
//-----------------------------------------------------------------------------
60
61
#define LEN_IDENT 15 // identifier length
62
#define TYPE_ICONST 4 // integer constant
63
64
namespace
{
65
typedef
unsigned
int
UINT;
66
}
67
68
class
RESHEAD
69
{
70
public
:
71
char
szLogo
[64];
// text logo
72
char
szSign
[16];
// signature
73
char
szMeshFile
[128];
// name of mesh file
74
UINT
cConstant
;
// number of constants
75
UINT
cVariable
;
// number of variables
76
UINT
cArray
;
// number of arrays
77
UINT
cElement
;
// number of elements
78
UINT
c1DArray
;
// number of 1D arrays
79
UINT
c2DArray
;
// number of 2D arrays
80
UINT
c3DArray
;
// number of 3D arrays
81
UINT
cSet
;
// number of data sets
82
};
83
84
class
XLATARRAY
85
{
86
public
:
87
char
szName
[
LEN_IDENT
+1];
// array name
88
UINT
uOffset
;
// array offset
89
UINT
cDim
;
// number of dimensions
90
UINT
acElements
[3];
// elements per dimensions
91
};
92
93
class
XLATVAR
94
{
95
public
:
96
char
szName
[
LEN_IDENT
+1];
// variable name
97
UINT
uOffset
;
// variable offset
98
};
99
100
101
102
//-----------------------------------------------------------------------------
103
// Class : DAXLATARRAY
104
// Purpose : Dynamic array of the XLATARRAY class
105
//
106
// Special Notes : This is only used for output sgplot style binary files.
107
// Otherwise, ignore.
108
//
109
// Creator : Eric Keiter, SNL, Parallel Computational Sciences
110
// Creation Date : 09/29/02
111
//-----------------------------------------------------------------------------
112
class
DAXLATARRAY
113
{
private
:
114
UINT
cSize
;
// total number of elements
115
UINT
uInc
;
// increment size
116
UINT
cElements
;
// number of elements in array
117
XLATARRAY
*
dynarray
;
// dynamic array
118
119
void
IncSize
()
120
{
if
(cElements == cSize)
121
{ cSize +=
uInc
;
122
dynarray =
123
(
XLATARRAY
*) realloc(dynarray, cSize*
sizeof
(
XLATARRAY
));
124
}
125
}
126
127
public
:
128
void
set
(
const
char
*,UINT ,UINT,UINT,UINT,UINT);
129
UINT
GetElements
() {
return
cElements
; }
130
UINT
Add
(
XLATARRAY
t) {
IncSize
(); dynarray[
cElements
] = t;
131
return
cElements++; }
132
133
void
RemoveLast
() { --
cElements
; }
134
void
Flush
() { cElements = 0; }
135
136
XLATARRAY
*
GetPointer
(UINT i) {
return
dynarray + i; }
137
XLATARRAY
operator[]
(UINT i) {
return
dynarray[i]; }
138
139
public
:
140
DAXLATARRAY
(
int
numMeshPoints);
141
~DAXLATARRAY
() {
delete
[]
dynarray
; }
142
};
143
144
#endif // Xyce_N_DEV_SGF_INTERFACE_h
145
DAXLATARRAY::cSize
UINT cSize
Definition:
N_DEV_SGF_Interface.h:114
DAXLATARRAY::Add
UINT Add(XLATARRAY t)
Definition:
N_DEV_SGF_Interface.h:130
RESHEAD::c3DArray
UINT c3DArray
Definition:
N_DEV_SGF_Interface.h:80
XLATVAR::szName
char szName[15+1]
Definition:
N_DEV_SGF_Interface.h:96
RESHEAD
Definition:
N_DEV_SGF_Interface.h:68
DAXLATARRAY::~DAXLATARRAY
~DAXLATARRAY()
Definition:
N_DEV_SGF_Interface.h:141
RESHEAD::c1DArray
UINT c1DArray
Definition:
N_DEV_SGF_Interface.h:78
XLATARRAY::szName
char szName[15+1]
Definition:
N_DEV_SGF_Interface.h:87
RESHEAD::c2DArray
UINT c2DArray
Definition:
N_DEV_SGF_Interface.h:79
DAXLATARRAY::RemoveLast
void RemoveLast()
Definition:
N_DEV_SGF_Interface.h:133
XLATARRAY
Definition:
N_DEV_SGF_Interface.h:84
RESHEAD::cElement
UINT cElement
Definition:
N_DEV_SGF_Interface.h:77
DAXLATARRAY::Flush
void Flush()
Definition:
N_DEV_SGF_Interface.h:134
RESHEAD::szLogo
char szLogo[64]
Definition:
N_DEV_SGF_Interface.h:71
DAXLATARRAY::GetElements
UINT GetElements()
Definition:
N_DEV_SGF_Interface.h:129
DAXLATARRAY
Definition:
N_DEV_SGF_Interface.h:112
RESHEAD::cVariable
UINT cVariable
Definition:
N_DEV_SGF_Interface.h:75
RESHEAD::cArray
UINT cArray
Definition:
N_DEV_SGF_Interface.h:76
XLATARRAY::acElements
UINT acElements[3]
Definition:
N_DEV_SGF_Interface.h:90
DAXLATARRAY::dynarray
XLATARRAY * dynarray
Definition:
N_DEV_SGF_Interface.h:117
XLATARRAY::uOffset
UINT uOffset
Definition:
N_DEV_SGF_Interface.h:88
DAXLATARRAY::DAXLATARRAY
DAXLATARRAY(int numMeshPoints)
Definition:
N_DEV_2DPDE_Output.C:1286
DAXLATARRAY::uInc
UINT uInc
Definition:
N_DEV_SGF_Interface.h:115
RESHEAD::cConstant
UINT cConstant
Definition:
N_DEV_SGF_Interface.h:74
DAXLATARRAY::operator[]
XLATARRAY operator[](UINT i)
Definition:
N_DEV_SGF_Interface.h:137
RESHEAD::cSet
UINT cSet
Definition:
N_DEV_SGF_Interface.h:81
RESHEAD::szSign
char szSign[16]
Definition:
N_DEV_SGF_Interface.h:72
DAXLATARRAY::GetPointer
XLATARRAY * GetPointer(UINT i)
Definition:
N_DEV_SGF_Interface.h:136
LEN_IDENT
#define LEN_IDENT
Definition:
N_DEV_SGF_Interface.h:61
DAXLATARRAY::cElements
UINT cElements
Definition:
N_DEV_SGF_Interface.h:116
XLATARRAY::cDim
UINT cDim
Definition:
N_DEV_SGF_Interface.h:89
RESHEAD::szMeshFile
char szMeshFile[128]
Definition:
N_DEV_SGF_Interface.h:73
DAXLATARRAY::IncSize
void IncSize()
Definition:
N_DEV_SGF_Interface.h:119
DAXLATARRAY::set
void set(const char *, UINT, UINT, UINT, UINT, UINT)
Definition:
N_DEV_2DPDE_Output.C:1250
XLATVAR
Definition:
N_DEV_SGF_Interface.h:93
XLATVAR::uOffset
UINT uOffset
Definition:
N_DEV_SGF_Interface.h:97
src
DeviceModelPKG
TCADModels
include
N_DEV_SGF_Interface.h
Generated on Wed May 6 2015 14:34:40 for Xyce by
1.8.9.1