5 #include "ArraySimple.h"
6 #include "UnstructuredMapping.h"
12 using namespace DBase;
15 class GL_GraphicsInterface;
17 class MappedGridOperators;
76 static aString bcName[numberOfBCNames];
80 useAllPeriodicBoundaryConditions=0,
83 useGeneralBoundaryConditions
89 defaultInitialCondition=0,
101 numberOfInitialConditionNames
122 } twilightZoneOption;
140 eigenfunctionsOfASphereKnownSolution
141 } knownSolutionOption;
172 defaultTimeStepping=0,
176 modifiedEquationTimeStepping
177 } timeSteppingMethod;
185 int addDissipation(
int current, real t, real dt, realMappedGridFunction *fields,
const Range & C );
187 void addFilter(
int current, real t, real dt );
189 static int addPrefix(
const aString label[],
const aString & prefix, aString cmd[],
const int maxCommands);
191 bool adjustBoundsForPML( MappedGrid &
mg, Index Iv[3],
int extra=0 );
193 void advanceC(
int current, real t, real dt, realMappedGridFunction *fields );
195 void advanceDSI(
int current, real t, real dt);
197 void advanceFDTD(
int numberOfStepsTaken,
int current, real t, real dt );
200 void advanceNew(
int current, real t, real dt, realMappedGridFunction *fields );
202 void advanceNFDTD(
int numberOfStepsTaken,
int current, real t, real dt );
204 void advanceSOSUP(
int numberOfStepsTaken,
int current, real t, real dt );
206 void advanceUnstructuredDSI(
int current, real t, real dt, realMappedGridFunction *fields );
208 void advanceUnstructuredDSIMV(
int current, real t, real dt, realMappedGridFunction *fields );
210 void assignBoundaryConditions(
int option,
int grid, real t, real dt, realMappedGridFunction &
u,
211 realMappedGridFunction & uOld,
int current );
213 void assignInitialConditions(
int current, real t, real dt);
215 void assignInterfaceBoundaryConditions(
int current, real t, real dt );
218 int buildRunTimeDialog();
220 int buildVariableDissipation();
223 void checkArrays(
const aString & label);
225 void computeDissipation(
int current, real t, real dt );
227 int computeIntensity(
int current, real t, real dt,
int stepNumber, real nextTimeToPlot);
229 void computeNumberOfStepsAndAdjustTheTimeStep(
const real & t,
231 const real & nextTimeToPlot,
232 int & numberOfSubSteps,
234 const bool & adjustTimeStep =
true );
236 int computeTimeStep();
239 int defineRegionsAndBodies();
241 void displayBoundaryConditions(FILE *file = stdout);
243 realCompositeGridFunction& getAugmentedSolution(
int current, realCompositeGridFunction &
v,
const real t);
245 bool getBoundsForPML( MappedGrid &
mg, Index Iv[3],
int extra=0 );
247 void getChargeDensity(
int current, real t, realCompositeGridFunction &
u,
int component=0 );
249 void getChargeDensity( real t, realMappedGridFunction &
u,
int component =0 );
251 void getEnergy(
int current, real t, real dt );
253 void getErrors(
int current, real t, real dt );
255 void getField( real
x, real
y, real t, real *eField );
257 int getForcing(
int current,
int grid, realArray &
u , real t, real dt,
int option=0 );
259 void getMaxDivergence(
const int current, real t,
260 realCompositeGridFunction *pu=NULL,
int component=0,
261 realCompositeGridFunction *pDensity=NULL,
int rhoComponent=0,
262 bool computeMaxNorms=
true );
264 static real getMaxValue(real value,
int processor=-1);
265 static int getMaxValue(
int value,
int processor=-1);
267 static real getMinValue(real value,
int processor=-1);
268 static int getMinValue(
int value,
int processor=-1);
270 int getValuesFDTD(
int option,
int *iparam,
int current, real t, real dt, realCompositeGridFunction *
v= NULL );
272 void initializeKnownSolution();
274 void initializeInterfaces();
276 int initializePlaneMaterialInterface();
278 int initializeRadiationBoundaryConditions();
280 int interactiveUpdate(GL_GraphicsInterface &gi );
284 int outputResults(
int current, real t, real dt );
286 int outputResultsAfterEachTimeStep(
int current, real t, real dt,
int stepNumber, real nextTimeToPlot );
288 int plot(
int current, real t, real dt );
290 int printMemoryUsage(FILE *file = stdout );
292 int printStatistics(FILE *file = stdout);
295 int project(
int numberOfStepsTaken,
int current, real t, real dt );
298 int projectInterpolationPoints(
int numberOfStepsTaken,
int current, real t, real dt );
300 void saveShow(
int current, real t, real dt );
302 int saveParametersToShowFile();
304 int setBoundaryCondition( aString & answer, GL_GraphicsInterface & gi, IntegerArray & originalBoundaryCondition );
307 int setupGridFunctions();
309 int setupUserDefinedForcing();
311 int setupUserDefinedInitialConditions();
313 void smoothDivergence(realCompositeGridFunction &
u,
const int numberOfSmooths );
315 int solve(GL_GraphicsInterface &gi );
317 int updateProjectionEquation();
319 bool usingPMLBoundaryConditions()
const;
321 int updateShowFile(
const aString & command= nullString, DialogData *interface =NULL );
324 int userDefinedForcing( realArray &
f,
int iparam[], real rparam[] );
326 void userDefinedForcingCleanup();
328 int userDefinedInitialConditions(
int current, real t, real dt );
330 void userDefinedInitialConditionsCleanup();
333 int buildTimeSteppingOptionsDialog(DialogData & dialog );
334 int buildForcingOptionsDialog(DialogData & dialog );
335 int buildPlotOptionsDialog(DialogData & dialog );
336 int buildInputOutputOptionsDialog(DialogData & dialog );
337 int buildPdeParametersDialog(DialogData & dialog);
339 int buildParametersDialog(DialogData & dialog );
341 int saveSequenceInfo( real t0, RealArray & sequenceData );
342 int saveSequencesToShowFile();
356 int ext,eyt,ezt,hxt,hyt,
hzt;
384 numberOfPlaneMaterialInterfaceCoefficients=33
386 real pmc[numberOfPlaneMaterialInterfaceCoefficients];
395 real gaussianSourceParameters[5];
397 enum { maxNumberOfGaussianPulses=20};
399 real gaussianPulseParameters[maxNumberOfGaussianPulses][6];
401 enum { maxNumberOfGaussianChargeSources=10};
403 real gaussianChargeSourceParameters[maxNumberOfGaussianChargeSources][9];
430 realCompositeGridFunction *
pRho;
431 realCompositeGridFunction *
pPhi,*pF;
449 bool plotDivergence, plotErrors, plotDissipation, plotScatteredField,
plotTotalField, plotRho, plotEnergyDensity;
481 MappedGridOperators *
op;
496 int degreeSpace,degreeSpaceX,degreeSpaceY,degreeSpaceZ,
degreeTime;
499 real initialConditionParameters[10];
511 real normalPlaneMaterialInterface[3], x0PlaneMaterialInterface[3];
514 int radbcGrid[2], radbcSide[2], radbcAxis[2];
537 ArraySimple<ArraySimple<int> > ulinksE,
ulinksH;
538 ArraySimple<ArraySimple<UnstructuredMappingAdjacencyIterator> >
ulinks;
541 void setupDSICoefficients();
542 void reconstructDSIField( real t,
FieldEnum field, realMappedGridFunction &from, realMappedGridFunction &to );
543 bool reconstructDSIAtEntities( real t,
FieldEnum field, IntegerArray &entities, realMappedGridFunction &from, RealArray &to);
549 zeroBC=forceExtrap<<1,
551 curlcurlHBC=curlHBC<<1,
552 curlcurlcurlHBC=curlcurlHBC<<1,
553 forcedBC = curlHBC|curlcurlHBC|curlcurlcurlHBC
556 void applyDSIBC( realMappedGridFunction &gf, real t,
bool isEField,
bool isProjection=
true,
int bcopt = defaultDSIBC );
557 void applyDSIForcing( realMappedGridFunction &gf, real t, real dt,
bool isEField,
bool isProjection=
true );
558 int getCenters( MappedGrid &
mg, UnstructuredMapping::EntityTypeEnum cent, realArray &
xe );
563 ArraySimple<int> Eindex, Eoffset, Hindex,
Hoffset;
566 ArraySimple< ArraySimple<real> > REcoeff,
RHcoeff;
567 ArraySimple< ArraySimple<int> > REindex, RHindex, SEindex,
SHindex;
573 ArraySimple<real> A,
As;
588 realCompositeGridFunction *
cgfn;
590 GenericGraphicsInterface *
gip;
649 maximumNumberOfTimings
652 aString timingName[maximumNumberOfTimings];