Skip to content

Commit 0521492

Browse files
committed
Removal of boost/multi_array
1 parent 52cd702 commit 0521492

18 files changed

+249
-246
lines changed

System/compWeights/Mesh.cxx

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <functional>
3434
#include <algorithm>
3535
#include <memory>
36-
#include <boost/multi_array.hpp>
3736

3837
#include "Exception.h"
3938
#include "FileReport.h"
@@ -42,6 +41,8 @@
4241
#include "OutputLog.h"
4342
#include "writeSupport.h"
4443
#include "Vec3D.h"
44+
#include "dataSlice.h"
45+
#include "multiData.h"
4546
#include "Mesh.h"
4647

4748
namespace compSystem

System/compWeightsInc/Mesh.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: compWeightsInc/Mesh.h
55
*
6-
* Copyright (c) 2004-2017 by Stuart Ansell
6+
* Copyright (c) 2004-2023 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
2222
#ifndef compSystem_Mesh_h
2323
#define compSystem_Mesh_h
2424

25-
2625
namespace compSystem
2726
{
2827

@@ -54,7 +53,7 @@ class Mesh
5453
std::vector<double> Z; ///< Z/theta coordinates
5554

5655
/// Mesh values [Note many for different energy arrangements ???]
57-
boost::multi_array<double,3> MData;
56+
multiData<double> MData;
5857

5958
std::string getType() const;
6059

System/modelSupport/DivideGrid.cxx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*********************************************************************
22
CombLayer : MCNP(X) Input builder
33
4-
* File: process/DivideGrid.cxx
4+
* File: modelSupport/DivideGrid.cxx
55
*
6-
* Copyright (c) 2004-2016 by Stuart Ansell
6+
* Copyright (c) 2004-2023 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -31,7 +31,6 @@
3131
#include <vector>
3232
#include <string>
3333
#include <memory>
34-
#include <boost/multi_array.hpp>
3534

3635
#include "Exception.h"
3736
#include "FileReport.h"

System/modelSupportInc/DivideGrid.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*********************************************************************
22
CombLayer : MCNP(X) Input builder
33
4-
* File: processInc/DivideGrid.h
4+
* File: modelSupportInc/DivideGrid.h
55
*
6-
* Copyright (c) 2004-2017 by Stuart Ansell
6+
* Copyright (c) 2004-2023 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by

System/weights/MarkovProcess.cxx

+26-22
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: weight/MarkovProcess.cxx
55
*
6-
* Copyright (c) 2004-2021 by Stuart Ansell
6+
* Copyright (c) 2004-2023 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -31,18 +31,18 @@
3131
#include <string>
3232
#include <algorithm>
3333
#include <memory>
34-
#include <boost/multi_array.hpp>
3534

3635
#include "Exception.h"
3736
#include "FileReport.h"
3837
#include "NameStack.h"
3938
#include "RegMethod.h"
4039
#include "OutputLog.h"
4140
#include "Vec3D.h"
41+
#include "dataSlice.h"
42+
#include "multiData.h"
4243
#include "BasicMesh3D.h"
4344
#include "BaseMap.h"
4445

45-
4646
#include "LineTrack.h"
4747
#include "ObjectTrackAct.h"
4848
#include "ObjectTrackPoint.h"
@@ -111,13 +111,13 @@ MarkovProcess::initializeData(const WWG& wSet,
111111
const WWGWeight& wMesh=wSet.getMesh(meshIndex);
112112
const Geometry::BasicMesh3D& grid=wMesh.getGeomGrid();
113113

114-
WX=static_cast<long int>(grid.getXSize());
115-
WY=static_cast<long int>(grid.getYSize());
116-
WZ=static_cast<long int>(grid.getZSize());
114+
WX=grid.getXSize();
115+
WY=grid.getYSize();
116+
WZ=grid.getZSize();
117117

118118
FSize=WX*WY*WZ;
119119

120-
fluxField.resize(boost::extents[FSize][FSize]);
120+
fluxField.resize(FSize,FSize);
121121

122122
return;
123123
}
@@ -145,29 +145,33 @@ MarkovProcess::computeMatrix(const Simulation& System,
145145
const Geometry::BasicMesh3D& grid=wMesh.getGeomGrid();
146146
const std::vector<Geometry::Vec3D> midPts=grid.midPoints();
147147

148-
if (static_cast<long int>(midPts.size())!=FSize)
149-
throw ColErr::MisMatch<long int>
150-
(static_cast<long int>(midPts.size()),FSize,"MidPts.size != FSize");
148+
if (midPts.size()!=FSize)
149+
throw ColErr::MisMatch<size_t>
150+
(midPts.size(),FSize,"MidPts.size != FSize");
151151

152-
for(long int i=0;i<FSize;i++)
153-
fluxField[i][i]=1.0;
152+
for(size_t i=0;i<FSize;i++)
153+
fluxField.get()[i][i]=1.0;
154154

155-
for(long int i=0;i<FSize;i++)
155+
for(size_t i=0;i<FSize;i++)
156156
{
157-
const size_t uI(static_cast<size_t>(i));
158-
ModelSupport::ObjectTrackPoint OTrack(midPts[uI]);
159-
for(long int j=i+1;j<FSize;j++)
157+
ModelSupport::ObjectTrackPoint OTrack(midPts[i]);
158+
for(size_t j=i+1;j<FSize;j++)
160159
{
161-
const size_t uJ(static_cast<size_t>(i));
162-
OTrack.addUnit(System,j,midPts[uJ]);
163-
double DistT=OTrack.getDistance(j)/r2Length;
160+
OTrack.addUnit(System,j,midPts[j]);
161+
double DistT=OTrack.getDistance(static_cast<long int>(j))/r2Length;
164162
if (DistT<1.0) DistT=1.0;
165-
const double AT=OTrack.getAttnSum(j); // this can take an
163+
const double AT=OTrack.getAttnSum(static_cast<long int>(j)); // this can take an
166164
const double WFactor= -densityFactor*AT-r2Power*log(DistT);
167165
if (WFactor>-20)
168-
fluxField[i][j]=fluxField[j][i]= -WFactor;
166+
{
167+
fluxField.get()[i][j]= -WFactor;
168+
fluxField.get()[j][i]= -WFactor;
169+
}
169170
else
170-
fluxField[i][j]=fluxField[j][i]=0.0;
171+
{
172+
fluxField.get()[i][j]= 0.0;
173+
fluxField.get()[j][i]= 0.0;
174+
}
171175
}
172176
}
173177
return;

System/weights/WCellControl.cxx

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: weights/WCellControl.cxx
55
*
6-
* Copyright (c) 2004-2021 by Stuart Ansell
6+
* Copyright (c) 2004-2023 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -32,7 +32,6 @@
3232
#include <string>
3333
#include <algorithm>
3434
#include <memory>
35-
#include <boost/multi_array.hpp>
3635

3736
#include "Exception.h"
3837
#include "FileReport.h"

System/weights/WItem.cxx

+3-3
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ WItem::write(std::ostream& OX) const
260260
std::ostringstream cx;
261261
cx<<cellN<<" ";
262262

263-
std::vector<double>::const_iterator vc;
264-
for(vc=Val.begin();vc!=Val.end();vc++)
265-
cx<<FMT % (*vc);
263+
for(const double V : Val)
264+
cx<<FMT % V;
265+
266266

267267
StrFunc::writeMCNPX(cx.str(),OX);
268268
return;

System/weights/WWG.cxx

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: weights/WWG.cxx
55
*
6-
* Copyright (c) 2004-2022 by Stuart Ansell
6+
* Copyright (c) 2004-2023 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -32,7 +32,6 @@
3232
#include <string>
3333
#include <algorithm>
3434
#include <memory>
35-
#include <boost/multi_array.hpp>
3635
#include <boost/format.hpp>
3736

3837
#include "Exception.h"
@@ -41,6 +40,8 @@
4140
#include "RegMethod.h"
4241
#include "OutputLog.h"
4342
#include "Vec3D.h"
43+
#include "dataSlice.h"
44+
#include "multiData.h"
4445
#include "support.h"
4546
#include "writeSupport.h"
4647
#include "phitsWriteSupport.h"
@@ -284,11 +285,7 @@ WWG::scaleMeshItem(const std::string& meshIndex,
284285

285286
WWGWeight& WMesh=getMesh(meshIndex);
286287

287-
WMesh.scaleMeshItem(static_cast<long int>(I),
288-
static_cast<long int>(J),
289-
static_cast<long int>(K),
290-
static_cast<long int>(EI),
291-
W);
288+
WMesh.scaleMeshItem(I,J,K,EI,W);
292289
return;
293290
}
294291

@@ -371,7 +368,7 @@ void
371368
WWG::writeVTK(const std::string& FName,
372369
const bool logFlag,
373370
const std::string& meshName,
374-
const long int EIndex) const
371+
const size_t EIndex) const
375372
/*!
376373
Write out a VTK file
377374
\param FName :: filename

System/weights/WWGControl.cxx

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <string>
3333
#include <algorithm>
3434
#include <memory>
35-
#include <boost/multi_array.hpp>
35+
#include <array>
3636

3737
#include "Exception.h"
3838
#include "FileReport.h"
@@ -42,6 +42,8 @@
4242
#include "BaseVisit.h"
4343
#include "BaseModVisit.h"
4444
#include "Vec3D.h"
45+
#include "dataSlice.h"
46+
#include "multiData.h"
4547
#include "Surface.h"
4648
#include "Quadratic.h"
4749
#include "Plane.h"
@@ -639,7 +641,7 @@ WWGControl::wwgVTK(const mainSystem::inputParam& IParam)
639641
std::string meshUnit=
640642
IParam.getValueError<std::string>("wwgVTK",i,1,"MeshUnit not given");
641643

642-
long int eIndex(0);
644+
size_t eIndex(0);
643645
StrFunc::convertNameWithIndex(meshUnit,eIndex); // no need to check
644646
const std::string logFlagName=
645647
IParam.getDefValue<std::string>("Normal","wwgVTK",i,2);
@@ -695,7 +697,7 @@ WWGControl::wwgCADIS(const Simulation& System,
695697
IParam.getDefValue<double>(2.0,wKey,iSet,itemCnt++);
696698

697699

698-
long int mIndex(0),sIndex(0),aIndex(0);
700+
size_t mIndex(0),sIndex(0),aIndex(0);
699701
StrFunc::convertNameWithIndex(meshUnit,mIndex);
700702
StrFunc::convertNameWithIndex(SUnit,sIndex);
701703
StrFunc::convertNameWithIndex(TUnit,aIndex);

0 commit comments

Comments
 (0)