Skip to content

Commit 52cd702

Browse files
committed
Update of stuff for softimax
1 parent 3e089d5 commit 52cd702

23 files changed

+427
-103
lines changed

Model/MaxIV/commonGenerator/M1DetailGenerator.cxx

+5-1
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ M1DetailGenerator::M1DetailGenerator() :
100100
eEdge(2.20),eHoleRadius(1.18),
101101
eConnectLength(1.5),eConnectGap(1.3),
102102
eConnectThick(0.35),
103+
eNCut(9),eCutRadius(1.4),eCutGap(3.7),
103104
eBlockOffset(0.5),eBlockWidth(1.2),
104105
ePlateOffset(2.1),ePlateThick(0.2),
105106
ePlateHeight(5.2),ePipeRadius(0.2),
106107
ePipeThick(0.15),
107108

108-
109109
fBladeInRad(0.0),fBladeOutRad(2.0),
110110
fBladeThick(1.0),fBladeTopAngle(40.0),
111111
fBladeBaseAngle(60.0),fBladeBaseWidth(22.0),
@@ -354,6 +354,10 @@ M1DetailGenerator::makeElectronShield(FuncDataBase& Control,
354354
Control.addVariable(keyName+"ConnectGap",eConnectGap);
355355
Control.addVariable(keyName+"ConnectThick",eConnectThick);
356356

357+
Control.addVariable(keyName+"NCut",eNCut);
358+
Control.addVariable(keyName+"CutRadius",eCutRadius);
359+
Control.addVariable(keyName+"CutGap",eCutGap);
360+
357361
Control.addVariable(keyName+"BlockOffset",eBlockOffset);
358362
Control.addVariable(keyName+"BlockWidth",eBlockWidth);
359363
Control.addVariable(keyName+"PlateThick",ePlateThick);

Model/MaxIV/commonGeneratorInc/M1DetailGenerator.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,13 @@ class M1DetailGenerator
141141
double eEdge; ///< Internal step (10.3)
142142
double eHoleRadius; ///< Hole in centre (2.36/2)
143143

144-
double eConnectLength; ///< External Length
145-
double eConnectGap; ///< thickness of gap
146-
double eConnectThick; ///< thickness of strips
144+
double eConnectLength; ///< External Length
145+
double eConnectGap; ///< thickness of gap
146+
double eConnectThick; ///< thickness of strips
147+
148+
double eNCut; ///< Number of cut hole
149+
double eCutRadius; ///< Radius of cuts
150+
double eCutGap; ///< size of gaps
147151

148152
double eBlockOffset; ///< Offset of block from wall
149153
double eBlockWidth; ///< Width of block Outward to plate
@@ -152,9 +156,8 @@ class M1DetailGenerator
152156
double ePlateThick; ///< Thickness of plate
153157
double ePlateHeight; ///< Extent up / down of plate
154158

155-
double ePipeRadius; ///< Radius of long pipe
156-
double ePipeThick; ///< Thickenss of pipe
157-
159+
double ePipeRadius; ///< Radius of long pipe
160+
double ePipeThick; ///< Thickenss of pipe
158161

159162
//
160163
double fBladeInRad; ///< Increase in radius

Model/MaxIV/softimax/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
set (softimaxSources
22
BiPortTube.cxx BremOpticsColl.cxx M1BackPlate.cxx
33
M1Connectors.cxx M1Detail.cxx M1ElectronShield.cxx
4-
M1FrontShield.cxx M1Mirror.cxx M1Ring.cxx
5-
M1Support.cxx
4+
M1FrontShield.cxx M1Mirror.cxx M1Pipe.cxx
5+
M1Ring.cxx M1Support.cxx
66
SOFTIMAX.cxx softimaxFrontEnd.cxx softimaxOpticsLine.cxx
77
softimaxVariables.cxx
88
)

Model/MaxIV/softimax/M1Detail.cxx

+4-23
Original file line numberDiff line numberDiff line change
@@ -240,30 +240,11 @@ M1Detail::createObjects(Simulation& System)
240240

241241
elecShield->addInsertCell(getCells("MainVoid"));
242242
elecShield->createAll(System,*mirror,0);
243-
// elecShield->joinRing(System,ringB->getRule("RingGap"),
244-
// ringB->getFullRule("InnerRing"));
245-
246-
247-
// frame->setCell("BackCVoid",*cClamp,"CVoid");
248-
// frame->setCell("LowCVoid",*cClamp,"CVoid",1);
249-
// frame->setCell("TopCVoid",*cClamp,"CVoid",2);
250-
// frame->setCell("PlateVoid",*cClamp,"PlateVoid");
251-
// frame->setCell("OuterVoid",*cClamp,"OuterVoid",1);
252-
// frame->setCell("FaceVoid",*cClamp,"FaceVoid");
253-
254-
// frame->setSurf("InnerRadius",*cClamp,"CylRadius");
255-
// frame->setSurf("RingRadius",*cClamp,"RingRadius");
256-
// frame->setSurf("FSurf",*cClamp,"FCylInner");
257-
// frame->setSurf("BSurf",*cClamp,"BCylInner");
258-
// frame->setSurf("BeamEdge",*cClamp,"BeamEdge");
259-
// frame->setSurf("FarEdge",*cClamp,"FarEdge");
260-
261-
// frame->createAll(System,*mirror,"centreAxis");
262243

263-
// cClamp->adjustExtraVoids(System,
264-
// frame->getSurf("mirrorVoid"),
265-
// frame->getSurf("outVoid"),
266-
// frame->getSurf("baseVoid"));
244+
245+
ELog::EM<<"MPipe A == "<<mirror->getLinkPt("downPipeA")<<ELog::endDiag;
246+
ELog::EM<<"MPipe B == "<<mirror->getLinkPt("downPipeB")<<ELog::endDiag;
247+
267248
cClamp->insertInCell(System,getCells("MainVoid"));
268249

269250
return;

Model/MaxIV/softimax/M1ElectronShield.cxx

+28-6
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ M1ElectronShield::populate(const FuncDataBase& Control)
110110
connectGap=Control.EvalVar<double>(keyName+"ConnectGap");
111111
connectThick=Control.EvalVar<double>(keyName+"ConnectThick");
112112

113+
nCut=Control.EvalVar<size_t>(keyName+"NCut");
114+
cutRadius=Control.EvalVar<double>(keyName+"CutRadius");
115+
cutGap=Control.EvalVar<double>(keyName+"CutGap");
116+
113117
blockOffset=Control.EvalVar<double>(keyName+"BlockOffset");
114118
blockWidth=Control.EvalVar<double>(keyName+"BlockWidth");
115119

@@ -119,7 +123,7 @@ M1ElectronShield::populate(const FuncDataBase& Control)
119123

120124
pipeRadius=Control.EvalVar<double>(keyName+"PipeRadius");
121125
pipeThick=Control.EvalVar<double>(keyName+"PipeThick");
122-
126+
123127
voidMat=ModelSupport::EvalMat<int>(Control,keyName+"VoidMat");
124128
electronMat=ModelSupport::EvalMat<int>(Control,keyName+"ElectronMat");
125129
waterMat=ModelSupport::EvalMat<int>(Control,keyName+"WaterMat");
@@ -134,7 +138,6 @@ M1ElectronShield::createSurfaces()
134138
*/
135139
{
136140
ELog::RegMethod RegA("M1ElectronShield","createSurfaces");
137-
138141

139142
// ELECTRON shield
140143
ModelSupport::buildPlane(SMap,buildIndex+1,Origin-Y*(elecLength/2.0),Y);
@@ -189,6 +192,15 @@ M1ElectronShield::createSurfaces()
189192
ModelSupport::buildPlane
190193
(SMap,buildIndex+416,pOrg+Z*(plateHeight/2.0-plateThick),Z);
191194

195+
Geometry::Vec3D cMid=pOrg-Y*(static_cast<double>(nCut/2)*cutGap);
196+
int BI(buildIndex+400);
197+
for(size_t i=0;i<nCut;i++)
198+
{
199+
ModelSupport::buildCylinder(SMap,BI+7,cMid,X,cutRadius);
200+
cMid+=Y*cutGap;
201+
BI+=10;
202+
}
203+
192204
ModelSupport::buildPlane
193205
(SMap,buildIndex+503,pOrg+X*(blockOffset+blockWidth),X);
194206

@@ -250,11 +262,23 @@ M1ElectronShield::createObjects(Simulation& System)
250262
HR=ModelSupport::getHeadRule
251263
(SMap,buildIndex,"1 -2 314 -403 205 -206");
252264
makeCell("EHeatVoid",System,cellIndex++,voidMat,0.0,HR);
253-
265+
266+
const HeadRule mainCutHR=
267+
ModelSupport::getHeadRule(SMap,buildIndex,"403 -404");
268+
HeadRule cutHR;
269+
int BI(buildIndex+400);
270+
for(size_t i=0;i<nCut;i++)
271+
{
272+
HR=mainCutHR*HeadRule(SMap,BI,-7);
273+
makeCell("PlateHole",System,cellIndex++,voidMat,0.0,HR);
274+
cutHR*=HeadRule(SMap,BI,7);
275+
BI+=10;
276+
}
254277
HR=ModelSupport::getHeadRule
255278
(SMap,buildIndex,"1 -2 403 -404 405 -406");
256-
makeCell("Plate",System,cellIndex++,electronMat,0.0,HR);
279+
makeCell("Plate",System,cellIndex++,electronMat,0.0,HR*cutHR);
257280

281+
258282
HR=ModelSupport::getHeadRule
259283
(SMap,buildIndex,"1 -2 303 -403 405 -415");
260284
makeCell("PlateEnd",System,cellIndex++,electronMat,0.0,HR);
@@ -319,7 +343,6 @@ M1ElectronShield::createVoidObjects(Simulation& System)
319343
ELog::RegMethod RegA("M1ElectronShield","createObjects");
320344

321345
const HeadRule tubeHR=getRule("TubeRadius");
322-
323346

324347
const HeadRule ACylHR=getRule("ringACyl");
325348
const HeadRule AFrontHR=getRule("ringAFront");
@@ -432,7 +455,6 @@ M1ElectronShield::createAll(Simulation& System,
432455

433456
createVoidObjects(System);
434457
addExternal(System);
435-
436458

437459
return;
438460
}

Model/MaxIV/softimax/M1Mirror.cxx

+10-6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "OutputLog.h"
4040
#include "surfRegister.h"
4141
#include "BaseVisit.h"
42+
#include "BaseModVisit.h"
4243
#include "Vec3D.h"
4344
#include "Quaternion.h"
4445
#include "varList.h"
@@ -48,6 +49,8 @@
4849
#include "groupRange.h"
4950
#include "objectGroups.h"
5051
#include "Simulation.h"
52+
#include "Surface.h"
53+
#include "SurInter.h"
5154
#include "ModelSupport.h"
5255
#include "MaterialSupport.h"
5356
#include "generateSurf.h"
@@ -173,9 +176,6 @@ M1Mirror::createSurfaces()
173176

174177
ModelSupport::buildCylinder(SMap,buildIndex+107,pBaseA,Z,pipeBaseRadius);
175178
ModelSupport::buildCylinder(SMap,buildIndex+207,pBaseB,Z,pipeBaseRadius);
176-
177-
178-
179179

180180
ModelSupport::buildCylinder
181181
(SMap,buildIndex+117,pBaseA,Z,pipeBaseRadius+pipeWallThick);
@@ -232,8 +232,13 @@ M1Mirror::createSurfaces()
232232
}
233233

234234
// Point for pipework connection
235-
FixedComp::setConnect(7,pBaseA,-Z);
236-
FixedComp::setConnect(8,pBaseB,-Z);
235+
const Geometry::Vec3D pipePtA=
236+
SurInter::getLinePoint(pBaseA,-Z,buildIndex+5);
237+
const Geometry::Vec3D pipePtB=
238+
SurInter::getLinePoint(pBaseB,-Z,buildIndex+5);
239+
240+
FixedComp::setConnect(7,pipePtA,-Z);
241+
FixedComp::setConnect(8,pipePtB,-Z);
237242
FixedComp::setLinkSurf(7,-SMap.realSurf(buildIndex+5));
238243
FixedComp::setLinkSurf(8,-SMap.realSurf(buildIndex+5));
239244

@@ -323,7 +328,6 @@ M1Mirror::createObjects(Simulation& System)
323328
HR=ModelSupport::getHeadRule(SMap,buildIndex,"5 -111 -227 217");
324329
makeCell("pipe",System,cellIndex++,outerMat,0.0,HR);
325330

326-
327331
// skip first gap
328332
if (nWaterChannel)
329333
{

0 commit comments

Comments
 (0)