Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
src
Commits
823161aa
Commit
823161aa
authored
Aug 05, 2020
by
snuverink_j
Browse files
replace C assert with PAssert; typo and include fixes
parent
7c1f8233
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
76 additions
and
75 deletions
+76
-75
ippl/test/particle/p3m3dHeating.cpp
ippl/test/particle/p3m3dHeating.cpp
+3
-3
ippl/test/particle/p3m3dMicrobunching.cpp
ippl/test/particle/p3m3dMicrobunching.cpp
+4
-4
src/Amr/BoxLibLayout.hpp
src/Amr/BoxLibLayout.hpp
+3
-4
src/Classic/Fields/Fieldmap.cpp
src/Classic/Fields/Fieldmap.cpp
+10
-8
src/Classic/Solvers/GreenWakeFunction.cpp
src/Classic/Solvers/GreenWakeFunction.cpp
+6
-6
src/Classic/Solvers/GreenWakeFunction.hh
src/Classic/Solvers/GreenWakeFunction.hh
+3
-3
src/Classic/Structure/LossDataSink.cpp
src/Classic/Structure/LossDataSink.cpp
+4
-2
src/Expressions/Expressions.cpp
src/Expressions/Expressions.cpp
+0
-1
src/OpalParser/OpalParser.cpp
src/OpalParser/OpalParser.cpp
+1
-2
src/Solvers/ArbitraryDomain.cpp
src/Solvers/ArbitraryDomain.cpp
+0
-1
src/Solvers/BoxCornerDomain.cpp
src/Solvers/BoxCornerDomain.cpp
+0
-1
src/Solvers/BoxLibSolvers/FMGPoissonSolver.cpp
src/Solvers/BoxLibSolvers/FMGPoissonSolver.cpp
+5
-5
src/Solvers/EllipticDomain.cpp
src/Solvers/EllipticDomain.cpp
+0
-1
src/Solvers/IrregularDomain.cpp
src/Solvers/IrregularDomain.cpp
+3
-3
src/Structure/BoundaryGeometry.cpp
src/Structure/BoundaryGeometry.cpp
+12
-11
src/Structure/BoundaryGeometry.h
src/Structure/BoundaryGeometry.h
+8
-9
src/Structure/H5PartWrapper.cpp
src/Structure/H5PartWrapper.cpp
+14
-11
No files found.
ippl/test/particle/p3m3dHeating.cpp
View file @
823161aa
...
...
@@ -36,10 +36,10 @@
#include "Particle/PairBuilder/HashPairBuilderPeriodic.h"
#include "Particle/PairBuilder/HashPairBuilderPeriodicParallel.h"
#include "Particle/PairBuilder/PairConditions.h"
#include "Utility/PAssert.h"
#include "math.h"
#include <random>
#include <cassert>
#include "VTKFieldWriterParallel.hpp"
#include "ChargedParticleFactory.hpp"
...
...
@@ -477,9 +477,9 @@ public:
#if defined (NDEBUG)
(
void
)
h5err
;
#endif
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
H5f_m
=
H5OpenFile
(
fn
.
c_str
(),
H5_O_RDONLY
,
props
);
a
ssert
(
H5f_m
!=
(
h5_file_t
)
H5_ERR
);
PA
ssert
(
H5f_m
!=
(
h5_file_t
)
H5_ERR
);
H5CloseProp
(
props
);
}
...
...
ippl/test/particle/p3m3dMicrobunching.cpp
View file @
823161aa
...
...
@@ -22,7 +22,6 @@
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#include "Ippl.h"
#include <cassert>
#include <string>
#include <vector>
#include <iostream>
...
...
@@ -35,6 +34,7 @@
#include "Particle/PairBuilder/HashPairBuilderPeriodic.h"
#include "Particle/PairBuilder/HashPairBuilderPeriodicParallel.h"
#include "Particle/PairBuilder/PairConditions.h"
#include "Utility/PAssert.h"
#include "math.h"
//#include "FixedAlgebra/FMatrix.h"
...
...
@@ -61,8 +61,8 @@ typedef Field<std::complex<double>, Dim, Mesh_t, Center_t> CxField_t;
typedef
FFT
<
CCTransform
,
Dim
,
double
>
FFT_t
;
typedef
IntCIC
IntrplCIC_t
;
typedef
IntNGP
IntrplNGP_t
;
typedef
IntTSC
IntrplTSC_t
;
//
typedef IntNGP IntrplNGP_t;
//
typedef IntTSC IntrplTSC_t;
typedef
UniformCartesian
<
2
,
double
>
Mesh2d_t
;
typedef
CenteredFieldLayout
<
2
,
Mesh2d_t
,
Center_t
>
FieldLayout2d_t
;
...
...
@@ -464,7 +464,7 @@ class ChargedParticles : public IpplParticleBase<PL> {
h5_prop_t
props
=
H5CreateFileProp
();
MPI_Comm
comm
=
Ippl
::
getComm
();
h5_err_t
h5err
=
H5SetPropFileMPIOCollective
(
props
,
&
comm
);
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
H5f_m
=
H5OpenFile
(
fn
.
c_str
(),
H5_O_WRONLY
,
props
);
}
...
...
src/Amr/BoxLibLayout.hpp
View file @
823161aa
...
...
@@ -41,7 +41,6 @@
#include "Message/Formatter.h"
#include "Utilities/OpalException.h"
#include <cassert>
#include <cmath>
template
<
class
T
,
unsigned
Dim
>
...
...
@@ -473,7 +472,7 @@ void BoxLibLayout<T, Dim>::buildLevelMask(int lev, const int ncells) {
template
<
class
T
,
unsigned
Dim
>
void
BoxLibLayout
<
T
,
Dim
>::
clearLevelMask
(
int
lev
)
{
assert
(
lev
<
(
int
)
masks_m
.
size
());
BL_ASSERT
(
lev
<
(
int
)
masks_m
.
size
());
masks_m
[
lev
].
reset
(
nullptr
);
}
...
...
@@ -810,8 +809,8 @@ void BoxLibLayout<T, Dim>::initBaseBox_m(int nGridPoints,
AmrDomain_t
real_box
;
for
(
int
d
=
0
;
d
<
AMREX_SPACEDIM
;
++
d
)
{
assert
(
lowerBound
[
d
]
<
0
);
assert
(
upperBound
[
d
]
>
0
);
BL_ASSERT
(
lowerBound
[
d
]
<
0
);
BL_ASSERT
(
upperBound
[
d
]
>
0
);
real_box
.
setLo
(
d
,
lowerBound
[
d
]
*
(
1.0
+
dh
));
real_box
.
setHi
(
d
,
upperBound
[
d
]
*
(
1.0
+
dh
));
...
...
src/Classic/Fields/Fieldmap.cpp
View file @
823161aa
#include "Fields/Fieldmap.h"
#include "Utility/PAssert.h"
#include "Fields/FM3DDynamic.h"
#include "Fields/FM3DH5BlockBase.h"
#include "Fields/FM3DH5Block.h"
...
...
@@ -38,7 +41,6 @@
#include <iostream>
#include <fstream>
#include <ios>
#include <cassert>
namespace
fs
=
boost
::
filesystem
;
...
...
@@ -366,22 +368,22 @@ MapType Fieldmap::readHeader(std::string Filename) {
h5_prop_t
props
=
H5CreateFileProp
();
MPI_Comm
comm
=
Ippl
::
getComm
();
h5err
=
H5SetPropFileMPIOCollective
(
props
,
&
comm
);
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
h5_file_t
file
=
H5OpenFile
(
Filename
.
c_str
(),
H5_O_RDONLY
,
props
);
a
ssert
(
file
!=
(
h5_file_t
)
H5_ERR
);
PA
ssert
(
file
!=
(
h5_file_t
)
H5_ERR
);
H5CloseProp
(
props
);
h5err
=
H5SetStep
(
file
,
0
);
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
h5_int64_t
num_fields
=
H5BlockGetNumFields
(
file
);
a
ssert
(
num_fields
!=
H5_ERR
);
PA
ssert
(
num_fields
!=
H5_ERR
);
MapType
maptype
=
UNKNOWN
;
for
(
h5_ssize_t
i
=
0
;
i
<
num_fields
;
++
i
)
{
h5err
=
H5BlockGetFieldInfo
(
file
,
(
h5_size_t
)
i
,
name
,
len_name
,
NULL
,
NULL
,
NULL
,
NULL
);
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
// using field name "Bfield" and "Hfield" to distinguish the type
if
(
std
::
strcmp
(
name
,
"Bfield"
)
==
0
)
{
maptype
=
T3DMagnetoStaticH5Block
;
...
...
@@ -392,7 +394,7 @@ MapType Fieldmap::readHeader(std::string Filename) {
}
}
h5err
=
H5CloseFile
(
file
);
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
if
(
maptype
!=
UNKNOWN
)
return
maptype
;
}
...
...
@@ -747,7 +749,7 @@ void Fieldmap::write3DField(unsigned int nx,
});
std
::
ofstream
of
;
of
.
open
(
fname
);
a
ssert
(
of
.
is_open
());
PA
ssert
(
of
.
is_open
());
of
.
precision
(
6
);
const
double
hx
=
(
xrange
.
second
-
xrange
.
first
)
/
(
nx
-
1
);
...
...
src/Classic/Solvers/GreenWakeFunction.cpp
View file @
823161aa
...
...
@@ -136,9 +136,9 @@ void GreenWakeFunction::apply(PartBunchBase<double, 3> *bunch) {
spacing
=
rmax
(
0
)
*
rmax
(
0
)
+
rmax
(
1
)
*
rmax
(
1
);
break
;
default:
throw
GeneralClassicException
(
"GreenWakeFunction"
,
"invalid direction specified"
);
throw
GeneralClassicException
(
"GreenWakeFunction
::apply
"
,
"invalid direction specified"
);
}
a
ssert
(
NBin_m
>
0
);
PA
ssert
(
NBin_m
>
0
);
spacing
/=
(
NBin_m
-
1
);
//FIXME: why -1? CKR: because grid spacings = grid points - 1
// Calculate the Wakefield if needed
...
...
@@ -187,7 +187,7 @@ void GreenWakeFunction::apply(PartBunchBase<double, 3> *bunch) {
int
idx
=
(
int
)(
floor
((
bunch
->
R
[
i
](
2
)
-
mindist
)
/
spacing
));
//IFF: should be ok
if
(
idx
==
NBin_m
)
idx
--
;
a
ssert
(
idx
>=
0
&&
idx
<
NBin_m
);
PA
ssert
(
idx
>=
0
&&
idx
<
NBin_m
);
double
dE
=
OutEnergy
[
idx
];
bunch
->
Ef
[
i
](
2
)
+=
dE
;
...
...
@@ -201,12 +201,12 @@ void GreenWakeFunction::apply(PartBunchBase<double, 3> *bunch) {
int
idx
=
(
int
)(
floor
((
bunch
->
R
[
i
](
2
)
-
mindist
)
/
spacing
));
//IFF: should be ok
if
(
idx
==
NBin_m
)
idx
--
;
a
ssert
(
idx
>=
0
&&
idx
<
NBin_m
);
PA
ssert
(
idx
>=
0
&&
idx
<
NBin_m
);
double
dE
=
OutEnergy
[
idx
];
// ACHTUNG spacing auch in transversal richtung
double
dist
=
sqrt
(
bunch
->
R
[
i
](
0
)
*
bunch
->
R
[
i
](
0
)
+
bunch
->
R
[
i
](
1
)
*
bunch
->
R
[
i
](
1
));
a
ssert
(
dist
>
0
);
PA
ssert
(
dist
>
0
);
bunch
->
Ef
[
i
](
0
)
+=
dE
*
bunch
->
R
[
i
](
0
)
/
dist
;
bunch
->
Ef
[
i
](
1
)
+=
dE
*
bunch
->
R
[
i
](
1
)
/
dist
;
...
...
@@ -214,7 +214,7 @@ void GreenWakeFunction::apply(PartBunchBase<double, 3> *bunch) {
break
;
default:
throw
GeneralClassicException
(
"GreenWakeFunction"
,
"invalid direction specified"
);
throw
GeneralClassicException
(
"GreenWakeFunction
::apply
"
,
"invalid direction specified"
);
}
#ifdef ENABLE_WAKE_DUMP
...
...
src/Classic/Solvers/GreenWakeFunction.hh
View file @
823161aa
...
...
@@ -21,9 +21,9 @@
#include "Solvers/WakeFunction.hh"
#include "Physics/Physics.h"
#include "Utility/IpplInfo.h"
#include "Utility/PAssert.h"
#include <vector>
#include <cassert>
#include <map>
#include <string>
#include <complex>
...
...
@@ -138,8 +138,8 @@ private:
*
*/
template
<
class
F
>
double
simpson
(
F
&
f
,
double
a
,
double
b
,
unsigned
int
N
)
{
a
ssert
(
b
>
a
);
a
ssert
(
N
>
0
);
PA
ssert
(
b
>
a
);
PA
ssert
(
N
>
0
);
double
result
=
0
;
double
h
=
(
b
-
a
)
/
N
;
...
...
src/Classic/Structure/LossDataSink.cpp
View file @
823161aa
...
...
@@ -9,7 +9,9 @@
#include <boost/filesystem.hpp>
#include "OPALconfig.h"
#include <cassert>
#include "Message/GlobalComm.h"
#include "Utility/IpplInfo.h"
#include <cmath>
#define ADD_ATTACHMENT( fname ) { \
...
...
@@ -479,7 +481,7 @@ void LossDataSink::saveASCII() {
}
bool
res
=
Ippl
::
Comm
->
send
(
smsg
,
0
,
tag
);
if
(
!
res
)
ERRORMSG
(
"LossDataSink Ippl::Comm->send(smsg, 0, tag) failed "
<<
endl
;
);
ERRORMSG
(
"LossDataSink Ippl::Comm->send(smsg, 0, tag) failed "
<<
endl
);
}
}
...
...
src/Expressions/Expressions.cpp
View file @
823161aa
...
...
@@ -53,7 +53,6 @@
#include "Utilities/ParseError.h"
#include "ValueDefinitions/BoolConstant.h"
#include <algorithm>
#include <cassert>
#include <cerrno>
#include <cmath>
#include <list>
...
...
src/OpalParser/OpalParser.cpp
View file @
823161aa
...
...
@@ -34,7 +34,6 @@
#include "Utilities/OpalException.h"
#include "Utilities/ParseError.h"
#include "Utilities/Options.h"
#include <cassert>
#include <cmath>
#include <ctime>
#include <exception>
...
...
@@ -178,7 +177,7 @@ void OpalParser::parseAction(Statement &stat) const {
}
else
{
std
::
string
hint
=
getHint
(
cmdName
,
"command"
);
if
(
hint
!=
""
)
{
throw
ParseError
(
"OpalParser::parse()"
,
throw
ParseError
(
"OpalParser::parse
Action
()"
,
"Syntax error, "
+
hint
);
}
...
...
src/Solvers/ArbitraryDomain.cpp
View file @
823161aa
...
...
@@ -34,7 +34,6 @@
#include <cmath>
#include <iostream>
#include <tuple>
#include <cassert>
#include "Utilities/OpalException.h"
ArbitraryDomain
::
ArbitraryDomain
(
BoundaryGeometry
*
bgeom
,
...
...
src/Solvers/BoxCornerDomain.cpp
View file @
823161aa
...
...
@@ -30,7 +30,6 @@
#include <string>
#include <cmath>
#include <iostream>
#include <cassert>
//FIXME: ORDER HOW TO TRAVERSE NODES IS FIXED, THIS SHOULD BE MORE GENERIC! (PLACES MARKED)
...
...
src/Solvers/BoxLibSolvers/FMGPoissonSolver.cpp
View file @
823161aa
...
...
@@ -22,13 +22,13 @@
//
#include "FMGPoissonSolver.h"
#include "Utility/PAssert.h"
#include "Utilities/OpalException.h"
#include <AMReX_ParmParse.H>
#include <AMReX_Interpolater.H>
#include <cassert>
FMGPoissonSolver
::
FMGPoissonSolver
(
AmrBoxLib
*
itsAmrObject_p
)
:
AmrPoissonSolver
<
AmrBoxLib
>
(
itsAmrObject_p
),
reltol_m
(
1.0e-15
),
...
...
@@ -70,14 +70,14 @@ void FMGPoissonSolver::solve(AmrScalarFieldContainer_t& rho,
amrex
::
Vector
<
AmrField_t
>
tmp
(
rho
.
size
());
a
ssert
(
baseLevel
<=
finestLevel
);
a
ssert
(
finestLevel
<
(
int
)
rho
.
size
());
PA
ssert
(
baseLevel
<=
finestLevel
);
PA
ssert
(
finestLevel
<
(
int
)
rho
.
size
());
for
(
int
lev
=
baseLevel
;
lev
<=
finestLevel
;
++
lev
)
{
const
AmrProcMap_t
&
dmap
=
rho
[
lev
]
->
DistributionMap
();
grad_phi_edge
[
lev
].
resize
(
AMREX_SPACEDIM
);
tmp
[
lev
].
define
(
rho
[
lev
]
->
boxArray
(),
dmap
,
AMREX_SPACEDIM
,
1
);
for
(
int
n
=
0
;
n
<
AMREX_SPACEDIM
;
++
n
)
{
AmrGrid_t
ba
=
rho
[
lev
]
->
boxArray
();
grad_phi_edge
[
lev
][
n
].
reset
(
new
AmrField_t
(
ba
.
surroundingNodes
(
n
),
dmap
,
1
,
1
));
...
...
src/Solvers/EllipticDomain.cpp
View file @
823161aa
...
...
@@ -30,7 +30,6 @@
#include <map>
#include <cmath>
#include <iostream>
#include <cassert>
//FIXME: ORDER HOW TO TRAVERSE NODES IS FIXED, THIS SHOULD BE MORE GENERIC! (PLACES MARKED)
...
...
src/Solvers/IrregularDomain.cpp
View file @
823161aa
...
...
@@ -25,9 +25,9 @@
//
#include "Solvers/IrregularDomain.h"
#include "Utilities/OpalException.h"
#include <cassert>
#include "Utility/PAssert.h"
#include "Utilities/OpalException.h"
IrregularDomain
::
IrregularDomain
(
const
IntVector_t
&
nr
,
const
Vector_t
&
hr
,
const
std
::
string
&
interpl
)
...
...
@@ -114,7 +114,7 @@ void IrregularDomain::getBoundaryStencil(int x, int y, int z, StencilValue_t& va
}
// stencil center value has to be positive!
a
ssert
(
value
.
center
>
0
);
PA
ssert
(
value
.
center
>
0
);
}
...
...
src/Structure/BoundaryGeometry.cpp
View file @
823161aa
...
...
@@ -13,15 +13,16 @@
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL.
If not, see <https://www.gnu.org/licenses/>.
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
//#define ENABLE_DEBUG
#include "Structure/BoundaryGeometry.h"
#include <fstream>
#include <cmath>
#include <fstream>
#include <string>
#include "H5hut.h"
...
...
@@ -685,7 +686,7 @@ static inline Vector_t normalVector (
)
{
const
Vector_t
N
=
cross
(
B
-
A
,
C
-
A
);
const
double
magnitude
=
std
::
sqrt
(
SQR
(
N
(
0
))
+
SQR
(
N
(
1
))
+
SQR
(
N
(
2
)));
a
ssert
(
gsl_fcmp
(
magnitude
,
0.0
,
EPS
)
>
0
);
// in case we have degenerted triangles
PA
ssert
(
gsl_fcmp
(
magnitude
,
0.0
,
EPS
)
>
0
);
// in case we have degener
a
ted triangles
return
N
/
magnitude
;
}
...
...
@@ -746,17 +747,17 @@ BoundaryGeometry::BoundaryGeometry() :
itsAttr
[
L1
]
=
Attributes
::
makeReal
(
"L1"
,
"In case of BOXCORNER Specifies first part with hight == B [m]"
,
"In case of BOXCORNER Specifies first part with h
e
ight == B [m]"
,
0.5
);
itsAttr
[
L2
]
=
Attributes
::
makeReal
(
"L2"
,
"In case of BOXCORNER Specifies first second with hight == B-C [m]"
,
"In case of BOXCORNER Specifies first second with h
e
ight == B-C [m]"
,
0.2
);
itsAttr
[
C
]
=
Attributes
::
makeReal
(
"C"
,
"In case of BOXCORNER Specifies hight of corner C [m]"
,
"In case of BOXCORNER Specifies h
e
ight of corner C [m]"
,
0.01
);
itsAttr
[
XYZSCALE
]
=
Attributes
::
makeReal
...
...
@@ -1589,7 +1590,7 @@ Change orientation if diff is:
for
(
unsigned
int
triangle_id
=
0
;
triangle_id
<
bg
->
Triangles_m
.
size
();
triangle_id
++
)
{
for
(
unsigned
int
j
=
1
;
j
<=
3
;
j
++
)
{
auto
pt_id
=
bg
->
PointID
(
triangle_id
,
j
);
a
ssert
(
pt_id
<
bg
->
Points_m
.
size
());
PA
ssert
(
pt_id
<
bg
->
Points_m
.
size
());
adjacencies_to_pt
[
pt_id
].
insert
(
triangle_id
);
}
}
...
...
@@ -1708,7 +1709,7 @@ Change orientation if diff is:
}
}
}
a
ssert
(
n
==
2
);
PA
ssert
(
n
==
2
);
edge_found:
int
diff
=
id
[
1
]
-
id
[
0
];
if
((((
ic
[
1
]
-
ic
[
0
])
==
1
)
&&
((
diff
==
1
)
||
(
diff
==
-
2
)))
||
...
...
@@ -1798,7 +1799,7 @@ Change orientation if diff is:
(
void
)
rc
;
#endif
rc
=
H5SetErrorHandler
(
H5AbortErrorhandler
);
a
ssert
(
rc
!=
H5_ERR
);
PA
ssert
(
rc
!=
H5_ERR
);
H5SetVerbosityLevel
(
1
);
h5_prop_t
props
=
H5CreateFileProp
();
...
...
@@ -2052,7 +2053,7 @@ BoundaryGeometry::intersectTinyLineSegmentBoundary (
}
break
;
case
-
1
:
// triangle is degenerated
a
ssert
(
tmp_intersect_result
!=
-
1
);
PA
ssert
(
tmp_intersect_result
!=
-
1
);
exit
(
42
);
// terminate even if NDEBUG is set
}
}
// end for all triangles
...
...
@@ -2192,7 +2193,7 @@ void
BoundaryGeometry
::
writeGeomToVtk
(
std
::
string
fn
)
{
std
::
ofstream
of
;
of
.
open
(
fn
.
c_str
());
a
ssert
(
of
.
is_open
());
PA
ssert
(
of
.
is_open
());
of
.
precision
(
6
);
of
<<
"# vtk DataFile Version 2.0"
<<
std
::
endl
;
of
<<
"generated using DataSink::writeGeoToVtk"
<<
std
::
endl
;
...
...
src/Structure/BoundaryGeometry.h
View file @
823161aa
...
...
@@ -36,20 +36,19 @@
class
OpalBeamline
;
class
ElementBase
;
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <array>
#include <vector>
#include "AbstractObjects/Definition.h"
#include "Attributes/Attributes.h"
#include "Utilities/Util.h"
#include "Utility/IpplTimings.h"
#include "Utility/PAssert.h"
#include <gsl/gsl_rng.h>
extern
Inform
*
gmsg
;
class
BoundaryGeometry
:
public
Definition
{
public:
...
...
@@ -286,7 +285,7 @@ private:
}
inline
const
Vector_t
&
getPoint
(
const
int
triangle_id
,
const
int
vertex_id
)
{
a
ssert
(
1
<=
vertex_id
&&
vertex_id
<=
3
);
PA
ssert
(
1
<=
vertex_id
&&
vertex_id
<=
3
);
return
Points_m
[
Triangles_m
[
triangle_id
][
vertex_id
]];
}
...
...
@@ -312,12 +311,12 @@ private:
FGEOM
,
// file holding the geometry
LENGTH
,
// length of elliptic tube or boxcorner
S
,
// start of the geometry
L1
,
// in case of BOXCORNER first part of geometry with hight B
L2
,
// in case of BOXCORNER second part of geometry with hight B-C
L1
,
// in case of BOXCORNER first part of geometry with h
e
ight B
L2
,
// in case of BOXCORNER second part of geometry with h
e
ight B-C
A
,
// major semi-axis of elliptic tube
B
,
// minor semi-axis of ellitpic tube
C
,
// in case of BOXCORNER hight of corner
TOPO
,
// RECTANGULAR, BOXCORNER, ELLIPTIC if FGEOM is selected
topo
is over-written
C
,
// in case of BOXCORNER h
e
ight of corner
TOPO
,
// RECTANGULAR, BOXCORNER, ELLIPTIC if FGEOM is selected
TOPO
is over-written
ZSHIFT
,
// Shift in z direction
XYZSCALE
,
// Multiplicative scaling factor for coordinates
XSCALE
,
// Multiplicative scaling factor for x-coordinates
...
...
@@ -339,4 +338,4 @@ inline Inform &operator<< (Inform& os, const BoundaryGeometry& b) {
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
// End:
\ No newline at end of file
src/Structure/H5PartWrapper.cpp
View file @
823161aa
...
...
@@ -6,8 +6,13 @@
#include "OPALconfig.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
#include "Utilities/Options.h"
#include "Utilities/OpalException.h"
#include "Message/Communicate.h"
#include "Message/Message.h"
#include "Utility/PAssert.h"
#include <boost/filesystem.hpp>
...
...
@@ -40,8 +45,6 @@ H5PartWrapper::H5PartWrapper(const std::string &fileName, int restartStep, std::
numSteps_m
(
0
),
startedFromExistingFile_m
(
true
)
{
namespace
fs
=
boost
::
filesystem
;
if
(
sourceFile
==
""
)
sourceFile
=
fileName_m
;
copyFile
(
sourceFile
,
restartStep
,
flags
);
...
...
@@ -72,9 +75,9 @@ void H5PartWrapper::open(h5_int32_t flags) {
#if defined (NDEBUG)
(
void
)
h5err
;
#endif
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
file_m
=
H5OpenFile
(
fileName_m
.
c_str
(),
flags
,
props
);
a
ssert
(
file_m
!=
(
h5_file_t
)
H5_ERR
);
PA
ssert
(
file_m
!=
(
h5_file_t
)
H5_ERR
);
H5CloseProp
(
props
);
}
...
...
@@ -135,9 +138,9 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
#if defined (NDEBUG)
(
void
)
h5err
;
#endif
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
h5_file_t
source
=
H5OpenFile
(
sourceFile
.
c_str
(),
H5_O_RDONLY
,
props
);
a
ssert
(
source
!=
(
h5_file_t
)
H5_ERR
);
PA
ssert
(
source
!=
(
h5_file_t
)
H5_ERR
);
H5CloseProp
(
props
);
h5_ssize_t
numStepsInSource
=
H5GetNumSteps
(
source
);
...
...
@@ -169,9 +172,9 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
props
=
H5CreateFileProp
();
comm
=
Ippl
::
getComm
();
h5err
=
H5SetPropFileMPIOCollective
(
props
,
&
comm
);
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
source
=
H5OpenFile
(
sourceFileName
.
c_str
(),
H5_O_RDONLY
,
props
);
a
ssert
(
source
!=
(
h5_file_t
)
H5_ERR
);
PA
ssert
(
source
!=
(
h5_file_t
)
H5_ERR
);
H5CloseProp
(
props
);
copyHeader
(
source
);
...
...
@@ -204,9 +207,9 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
#if defined (NDEBUG)
(
void
)
h5err
;
#endif
a
ssert
(
h5err
!=
H5_ERR
);
PA
ssert
(
h5err
!=
H5_ERR
);
h5_file_t
source
=
H5OpenFile
(
sourceFile
.
c_str
(),
H5_O_RDONLY
,
props
);
a
ssert
(
source
!=
(
h5_file_t
)
H5_ERR
);
PA
ssert
(
source
!=
(
h5_file_t
)
H5_ERR
);
H5CloseProp
(
props
);
h5_ssize_t
numStepsInSource
=
H5GetNumSteps
(
source
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment