-
Notifications
You must be signed in to change notification settings - Fork 1
/
autoReconstructParDict
56 lines (52 loc) · 2.19 KB
/
autoReconstructParDict
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
autoReconstructPar
{
type coded;
redirectType autoReconstructPar;
functionObjectLibs ("libutilityFunctionObjects.so");
writeControl outputTime;
deleteAfterReconstruct true;
reconstructParFields "all";//"(p U)";//"all"
codeData
#{
bool deleteAfterReconstruct_;
string reconstructParFields_;
string runTimeThisTime_;
string runTimeLastTme_;
#};
codeRead
#{
deleteAfterReconstruct_ = dict.lookupOrDefault<Switch>("deleteAfterReconstruct", false);
reconstructParFields_ = dict.lookupOrDefault<string>("reconstructParFields", "all");
runTimeThisTime_ = "empty";
runTimeLastTme_ = "empty";
mkDir("postProcessing/autoReconstructPar");
#};
codeWrite
#{
Info<< "Execute reconstructPar." << endl << endl;
runTimeLastTme_ = runTimeThisTime_;
runTimeThisTime_ = mesh().time().timeName();
if( reconstructParFields_ == "all")
{
if (deleteAfterReconstruct_)
{
system("(reconstructPar -time " + runTimeThisTime_ + " && rm -rf processor*\/" + runTimeLastTme_ + " ) > postProcessing/autoReconstructPar/log.rec" + runTimeThisTime_ + "&" );
}
else
{
system("reconstructPar -time " + runTimeThisTime_ + " > postProcessing/autoReconstructPar/log.rec" + runTimeThisTime_ + "&" );
}
}
else
{
system("reconstructPar -time " + runTimeThisTime_ +" -fields \'" + reconstructParFields_ +"\'> postProcessing/autoReconstructPar/log.rec" + runTimeThisTime_ + "&" );
}
#};
}