7 #include "OGFunction.h"
9 #include "PlotStuffParameters.h"
11 #include "ShowFileParameter.h"
14 #include OV_STD_INCLUDE(map)
15 #include "ParallelOverlappingGridInterpolator.h"
16 #include "ArraySimple.h"
20 using namespace DBase;
23 class GenericGraphicsInterface;
28 class InterpolateRefinements;
38 class BodyForceRegionParameters;
41 addPrefix(
const aString label[],
const aString & prefix, aString cmd[],
const int maxCommands);
61 defaultValue=-12345678,
62 maximumNumberOfOutputFiles=10
75 LargeEddySimulation=5,
76 numberOfTurbulenceModels
79 static aString turbulenceModelName[numberOfTurbulenceModels+1];
100 numberOfTimeSteppingMethods
104 static aString timeSteppingName[numberOfTimeSteppingMethods+1];
114 interfaceBoundaryCondition=17,
115 neumannBoundaryCondition=18,
116 dirichletInterface=21,
123 noSlipWallInterface=19,
124 slipWallInterface=20,
127 penaltyBoundaryCondition=100,
136 tractionAndHeatFluxInterface
143 heatFluxInterfaceData = 1 ,
144 positionInterfaceData = heatFluxInterfaceData << 1,
145 velocityInterfaceData = positionInterfaceData << 1,
146 accelerationInterfaceData = velocityInterfaceData << 1,
147 tractionInterfaceData = accelerationInterfaceData << 1,
148 tractionRateInterfaceData = tractionInterfaceData << 1
175 numberOfPredefinedBoundaryConditionTypes
187 approximateFactorization
195 computeAllWithWeightedImplicitTerms
198 std::map<int,aString> bcNames,
icNames, bcmNames;
201 bool registerBC(
int id,
const aString & name,
bool replace=
false );
203 bool registerInterfaceType(
int id,
const aString & name,
bool replace=
false );
212 virtual const bool isPenaltyBC()
const;
214 virtual bool inputFromGI(GenericGraphicsInterface &gi)=0;
216 const real & t,
const real &dt,
217 realMappedGridFunction &
u,
221 realMappedGridFunction *gridVelocity = 0)=0;
223 virtual bool setBCCoefficients(
Parameters ¶meters,
224 const real & t,
const real &dt,
225 realMappedGridFunction &
u,
226 realMappedGridFunction &
coeff,
230 realMappedGridFunction *gridVelocity = 0)=0;
233 virtual bool addPenaltyForcing(
Parameters ¶meters,
234 const real & t,
const real &dt,
235 const realMappedGridFunction &
u,
236 realMappedGridFunction &dudt,
240 const realMappedGridFunction *gridVelocity = 0)=0;
247 typedef BCModifier*(*CreateBCModifierFromName)(
const aString &name);
267 knownSolutionInitialCondition
289 ignitionPressureReactionRate
297 interpolatePrimitiveAndPressure
307 fixedReferenceFrame=0,
309 specifiedReferenceFrame
318 knownSolutionFromAShowFile
324 Parameters(
const int & numberOfDimensions0=3);
330 int addShowVariable(
const aString & name,
int component,
bool variableIsOn = TRUE );
332 int addTiming(
const aString & timeVariableName,
const aString & timeLabel );
335 int assignParameterValues(
const aString & label, RealArray & values,
336 const int & numRead, aString *c, real val[],
337 char *extraName1 = 0,
const int & extraValue1Location = 0,
338 char *extraName2 = 0,
const int & extraValue2Location = 0,
339 char *extraName3 = 0,
const int & extraValue3Location = 0 );
341 int assignParameterValues(
const aString & label, RealArray & values,
342 const int & numRead,
char c[][10], real val[],
343 char *extraName1 = 0,
const int & extraValue1Location = 0,
344 char *extraName2 = 0,
const int & extraValue2Location = 0,
345 char *extraName3 = 0,
const int & extraValue3Location = 0 );
348 int bcIsAnInterface(
int bc)
const;
351 int bcIsTimeDependent(
int side,
int axis,
int grid)
const;
357 int bcVariesInSpace(
int side,
int axis,
int grid)
const;
360 int bcVariesInSpace(
const Index &
side = nullIndex,
361 const Index &
axis = nullIndex,
362 const Index &
grid = nullIndex )
const;
365 buildBodyForceRegionsDialog(DialogData & dialog, BodyForceRegionParameters & regionPar );
368 int buildErrorEstimator();
371 buildForcingProfilesDialog(DialogData & dialog, BodyForceRegionParameters & regionPar );
374 buildMaterialParametersDialog(DialogData & dialog, BodyForceRegionParameters & regionPar );
377 int buildReactions();
380 buildTemperatureBoundaryConditionsDialog(DialogData & dialog, BodyForceRegionParameters & regionPar );
383 int checkForValidBoundaryCondition(
const int & bc,
bool reportErrors=
true );
386 int chooseUserDefinedBoundaryValues(
int side,
int axis,
int grid, CompositeGrid &
cg);
389 conservativeToPrimitive(
GridFunction & gf,
int gridToConvert=-1,
int fixupUnsedPoints=
false);
392 int defineBoundaryConditions(CompositeGrid &
cg,
393 const IntegerArray & originalBoundaryCondition,
394 const aString & command =nullString,
395 DialogData *interface=NULL);
398 int defineVariableBoundaryValues(
int side,
int axis,
int grid, CompositeGrid &
cg);
401 int displayPdeParameters(FILE *file = stdout );
404 void displayPolynomialCoefficients(RealArray & cx, RealArray & ct, aString * componentName,
405 int numberOfComponents, FILE *file);
407 int get(
const GenericDataBase &
dir,
const aString & name);
410 getBodyForceRegionsOption(
const aString & answer,
411 BodyForceRegionParameters & regionPar,
412 DialogData & dialog );
423 getForcingProfilesOption(
const aString & answer,
424 BodyForceRegionParameters & regionPar,
425 DialogData & dialog );
427 int getComponents( IntegerArray &
components );
430 getDerivedFunction(
const aString & name,
const realCompositeGridFunction &
u,
431 realCompositeGridFunction &
v,
const int component,
const real t,
434 getDerivedFunction(
const aString & name,
const realMappedGridFunction &
u,
435 realMappedGridFunction &
v,
436 const int component,
const int grid,
const real t,
Parameters & parameters);
447 int getGridIsImplicit(
int grid)
const;
451 realCompositeGridFunction& getKnownSolution( CompositeGrid &
cg, real t );
453 realMappedGridFunction& getKnownSolution(real t,
int grid,
454 const Index &
I1,
const Index &
I2,
const Index &
I3,
455 bool initialCall=
false );
458 getMaterialParametersOption(
const aString & answer,
459 BodyForceRegionParameters & regionPar,
460 DialogData & dialog );
464 int getNormalForce( realCompositeGridFunction &
u, realSerialArray & normalForce,
int *ipar, real *rpar );
466 const ReferenceFrameEnum
470 getShowVariable(
const aString & name,
int & component,
bool & variableIsOn )
const;
473 getTemperatureBoundaryConditionsOption(
const aString & answer,
474 BodyForceRegionParameters & regionPar,
475 DialogData & dialog );
477 int getTimeDependenceBoundaryConditionParameters(
int side,
int axis,
int grid, RealArray & values)
const;
480 aString getTimeSteppingName()
const;
483 int getUserBoundaryConditionParameters(
int side,
int axis,
int grid, RealArray & values)
const;
486 int getUserDefinedKnownSolution(real t, CompositeGrid &
cg,
int grid, realArray & ua,
487 const Index &
I1,
const Index &
I2,
const Index &
I3 );
489 bool gridIsMoving(
int grid)
const;
492 int howManyBcTypes(
const Index &
side,
495 BoundaryConditionType bc)
const;
498 int initializeTimings();
501 int inputParameterValues(
const aString & answer,
const aString & label, RealArray & values );
506 bool isAxisymmetric()
const;
509 bool isMixedBC(
int bc );
512 bool isMovingGridProblem()
const;
515 bool isSteadyStateSolver()
const;
519 int numberOfGhostPointsNeeded()
const;
522 int numberOfGhostPointsNeededForImplicitMatrix()
const;
525 int openLogFiles(
const aString & name);
528 int parseValues(
const aString & answer, aString *name, real *value,
int maxNumber );
531 primitiveToConservative(
GridFunction & gf,
int gridToConvert=-1,
int fixupUnsedPoints=
false);
534 int put( GenericDataBase &
dir,
const aString & name)
const;
538 readFromAShowFile(ShowFileReader & showFileReader,
539 CompositeGrid & cgRef,
541 realCompositeGridFunction &
u,
542 int & solutionNumber );
546 bool saveLinearizedSolution();
549 int saveParametersToShowFile();
552 int setBcIsTimeDependent(
int side,
int axis,
int grid,
bool trueOrFalse=
true);
555 int setBcType(
int side,
int axis,
int grid, BoundaryConditionType bc);
558 int setBcModifier(
int side,
int axis,
int grid,
int bcm);
561 int setBcVariesInSpace(
int side,
int axis,
int grid,
bool trueOrFalse=
true);
565 setBoundaryConditionValues(
const aString & answer,
566 const IntegerArray & originalBoundaryCondition,
569 int setDefaultDataForABoundaryCondition(
const int &
side,
574 int setGridIsImplicit(
int grid=-1,
int value=1 );
577 setInfoFile(FILE *file);
580 int setParameters(
const int & numberOfDimensions0=2,
581 const aString & reactionName =nullString);
584 int setPdeParameters(CompositeGrid &
cg,
585 const aString & command =nullString,
586 DialogData *interface=NULL);
589 setShowVariable(
const aString & name,
const bool variableIsOn );
592 int setUserDefinedParameters();
595 int setTimeDependenceBoundaryConditionParameters(
int side,
int axis,
int grid, RealArray & values);
598 int setTwilightZoneFunction(
const TwilightZoneChoice & choice,
599 const int & degreeSpace=2,
600 const int & degreeTime=2 );
603 int setTwilightZoneParameters(CompositeGrid &
cg,
604 const aString & command =nullString,
605 DialogData *interface=NULL );
611 int thereAreTimeDependentUserBoundaryConditions(
const Index &
side,
613 const Index &
grid)
const;
616 setupBodyForcing(CompositeGrid &
cg);
620 int setUserBoundaryConditionParameters(
int side,
int axis,
int grid, RealArray & values);
623 int updateKnownSolutionToMatchGrid( CompositeGrid &
cg );
626 int updatePDEparameters();
629 int updateShowFile(
const aString & command = nullString,
630 DialogData *interface=NULL);
633 int updateToMatchGrid( CompositeGrid &
cg,
634 IntegerArray & sharedBoundaryCondition = Overture::nullIntArray() );
637 int updateTurbulenceModels(CompositeGrid & cg);
640 updateUserDefinedEOS(GenericGraphicsInterface & gi);
643 int updateUserDefinedKnownSolution(GenericGraphicsInterface & gi);
646 bool useConservativeVariables(
int grid=-1)
const;