forked from ClimateGlobalChange/tempestremap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenerateOfflineMap.cpp
722 lines (588 loc) · 18.8 KB
/
GenerateOfflineMap.cpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
///////////////////////////////////////////////////////////////////////////////
///
/// \file gecore2.cpp
/// \author Paul Ullrich
/// \version March 7, 2014
///
/// <remarks>
/// Copyright 2000-2014 Paul Ullrich
///
/// This file is distributed as part of the Tempest source code package.
/// Permission is granted to use, copy, modify and distribute this
/// source code and its documentation under the terms of the GNU General
/// Public License. This software is provided "as is" without express
/// or implied warranty.
/// </remarks>
#include "Announce.h"
#include "CommandLine.h"
#include "Exception.h"
#include "GridElements.h"
#include "OverlapMesh.h"
#include "DataMatrix3D.h"
#include "FiniteElementTools.h"
#include "SparseMatrix.h"
#include "STLStringHelper.h"
#include "OfflineMap.h"
#include "LinearRemapSE0.h"
#include "LinearRemapFV.h"
#include "netcdfcpp.h"
#include <cmath>
using namespace std;
///////////////////////////////////////////////////////////////////////////////
void ParseVariableList(
const std::string & strVariables,
std::vector< std::string > & vecVariableStrings
) {
int iVarBegin = 0;
int iVarCurrent = 0;
// Parse variable name
for (;;) {
if ((iVarCurrent >= strVariables.length()) ||
(strVariables[iVarCurrent] == ',') ||
(strVariables[iVarCurrent] == ' ')
) {
if (iVarCurrent == iVarBegin) {
if (iVarCurrent >= strVariables.length()) {
break;
}
continue;
}
vecVariableStrings.push_back(
strVariables.substr(iVarBegin, iVarCurrent - iVarBegin));
iVarBegin = iVarCurrent + 1;
}
iVarCurrent++;
}
}
///////////////////////////////////////////////////////////////////////////////
void LoadMetaDataFile(
const std::string & strMetaFile,
DataMatrix3D<int> & dataGLLNodes,
DataMatrix3D<double> & dataGLLJacobian
) {
NcFile ncMeta(strMetaFile.c_str(), NcFile::ReadOnly);
NcDim * dimNp = ncMeta.get_dim("np");
if (dimNp == NULL) {
_EXCEPTIONT("Dimension \"np\" missing from metadata file");
}
NcDim * dimNelem = ncMeta.get_dim("nelem");
if (dimNelem == NULL) {
_EXCEPTIONT("Dimension \"nelem\" missing from metadata file");
}
NcVar * varGLLNodes = ncMeta.get_var("GLLnodes");
if (dimNelem == NULL) {
_EXCEPTIONT("Variable \"GLLnodes\" missing from metadata file");
}
NcVar * varGLLJacobian = ncMeta.get_var("J");
if (dimNelem == NULL) {
_EXCEPTIONT("Variable \"J\" missing from metadata file");
}
int nP = dimNp->size();
int nElem = dimNelem->size();
DataMatrix3D<int> dataGLLNodes_tmp;
DataMatrix3D<double> dataGLLJacobian_tmp;
cout << "\n..Initialized temporary arrays." << endl;
dataGLLNodes.Initialize(nP, nP, nElem);
dataGLLJacobian.Initialize(nP, nP, nElem);
dataGLLNodes_tmp.Initialize(nP, nP, nElem);
dataGLLJacobian_tmp.Initialize(nP, nP, nElem);
cout << "..Initialized permanent arrays.\n";
varGLLNodes->get(&(dataGLLNodes_tmp[0][0][0]), nP, nP, nElem);
varGLLJacobian->get(&(dataGLLJacobian[0][0][0]), nP, nP, nElem);
cout << "..Filled temporary arrays.\n";
for (int i = 0; i < nP; i++) {
for (int j = 0; j < nP; j++) {
for (int k = 0; k < nElem; k++) {
dataGLLNodes[i][j][k] = dataGLLNodes_tmp[j][i][k];
}
}
}
}
///////////////////////////////////////////////////////////////////////////////
int main(int argc, char** argv) {
NcError error(NcError::silent_nonfatal);
try {
// Input / Output types
enum DiscretizationType {
DiscretizationType_FV,
DiscretizationType_CGLL,
DiscretizationType_DGLL
};
// Input mesh file
std::string strInputMesh;
// Overlap mesh file
std::string strOverlapMesh;
// Metadata file
std::string strMetaFile;
// Input data type
std::string strInputType;
// Output data type
std::string strOutputType;
// Order of polynomial in each element
int nPin;
// Order of polynomial in each output element
int nPout;
// Use bubble on interior of spectral element nodes
bool fBubble;
// Enforce monotonicity
bool fMonotone;
// Turn off checking for conservation / consistency
bool fNoCheck;
// Output mesh file
std::string strOutputMesh;
// Variable list
std::string strVariables;
// Output map file
std::string strOutputMap;
// Input data file
std::string strInputData;
// Output data file
std::string strOutputData;
// Name of the ncol variable
std::string strNColName;
// Output as double
bool fOutputDouble;
// List of variables to preserve
std::string strPreserveVariables;
// Preserve all non-remapped variables
bool fPreserveAll;
// Fill value override
double dFillValueOverride;
// Parse the command line
BeginCommandLine()
//CommandLineStringD(strMethod, "method", "", "[se]");
CommandLineString(strInputMesh, "in_mesh", "");
CommandLineString(strOutputMesh, "out_mesh", "");
CommandLineString(strOverlapMesh, "ov_mesh", "");
CommandLineString(strMetaFile, "in_meta", "");
CommandLineStringD(strInputType, "in_type", "fv", "[fv|cgll|dgll]");
CommandLineStringD(strOutputType, "out_type", "fv", "[fv|cgll|dgll]");
CommandLineInt(nPin, "in_np", 4);
CommandLineInt(nPout, "out_np", 4);
CommandLineBool(fBubble, "bubble");
CommandLineBool(fMonotone, "mono");
CommandLineBool(fNoCheck, "nocheck");
CommandLineString(strVariables, "var", "");
CommandLineString(strOutputMap, "out_map", "");
CommandLineString(strInputData, "in_data", "");
CommandLineString(strOutputData, "out_data", "");
CommandLineString(strNColName, "ncol_name", "ncol");
CommandLineBool(fOutputDouble, "out_double");
CommandLineString(strPreserveVariables, "preserve", "");
CommandLineBool(fPreserveAll, "preserveall");
CommandLineDouble(dFillValueOverride, "fillvalue", 0.0);
ParseCommandLine(argc, argv);
EndCommandLine(argv)
AnnounceBanner();
// Check command line parameters (mesh arguments)
if (strInputMesh == "") {
_EXCEPTIONT("No input mesh specified");
}
if (strOutputMesh == "") {
_EXCEPTIONT("No output mesh specified");
}
if (strOverlapMesh == "") {
_EXCEPTIONT("No overlap mesh specified");
}
// Check command line parameters (data arguments)
if ((strInputData != "") && (strOutputData == "")) {
_EXCEPTIONT("in_data specified without out_data");
}
if ((strInputData == "") && (strOutputData != "")) {
_EXCEPTIONT("out_data specified without in_data");
}
// Check command line parameters (data type arguments)
STLStringHelper::ToLower(strInputType);
STLStringHelper::ToLower(strOutputType);
DiscretizationType eInputType;
DiscretizationType eOutputType;
if (strInputType == "fv") {
eInputType = DiscretizationType_FV;
} else if (strInputType == "cgll") {
eInputType = DiscretizationType_CGLL;
} else if (strInputType == "dgll") {
eInputType = DiscretizationType_DGLL;
} else {
_EXCEPTION1("Invalid \"in_type\" value (%s), expected [fv|cgll|dgll]",
strInputType.c_str());
}
if (strOutputType == "fv") {
eOutputType = DiscretizationType_FV;
} else if (strOutputType == "cgll") {
eOutputType = DiscretizationType_CGLL;
} else if (strOutputType == "dgll") {
eOutputType = DiscretizationType_DGLL;
} else {
_EXCEPTION1("Invalid \"out_type\" value (%s), expected [fv|cgll|dgll]",
strOutputType.c_str());
}
// Create Offline Map
OfflineMap mapRemap;
// Initialize dimension information from file
AnnounceStartBlock("Initializing dimensions of map");
Announce("Input mesh");
mapRemap.InitializeSourceDimensionsFromFile(strInputMesh);
Announce("Output mesh");
mapRemap.InitializeTargetDimensionsFromFile(strOutputMesh);
AnnounceEndBlock(NULL);
// Parse variable list
std::vector< std::string > vecVariableStrings;
ParseVariableList(strVariables, vecVariableStrings);
// Parse preserve variable list
std::vector< std::string > vecPreserveVariableStrings;
ParseVariableList(strPreserveVariables, vecPreserveVariableStrings);
if (fPreserveAll && (vecPreserveVariableStrings.size() != 0)) {
_EXCEPTIONT("--preserveall and --preserve cannot both be specified");
}
// Load input mesh
AnnounceStartBlock("Loading input mesh");
Mesh meshInput(strInputMesh);
meshInput.RemoveZeroEdges();
AnnounceEndBlock(NULL);
// Calculate Face areas
AnnounceStartBlock("Calculating input mesh Face areas");
double dTotalAreaInput = meshInput.CalculateFaceAreas();
Announce("Input Mesh Geometric Area: %1.15e", dTotalAreaInput);
AnnounceEndBlock(NULL);
// Input mesh areas
if (eInputType == DiscretizationType_FV) {
mapRemap.SetSourceAreas(meshInput.vecFaceArea);
}
// Load output mesh
AnnounceStartBlock("Loading output mesh");
Mesh meshOutput(strOutputMesh);
meshOutput.RemoveZeroEdges();
AnnounceEndBlock(NULL);
// Calculate Face areas
AnnounceStartBlock("Calculating output mesh Face areas");
Real dTotalAreaOutput = meshOutput.CalculateFaceAreas();
Announce("Output Mesh Geometric Area: %1.15e", dTotalAreaOutput);
AnnounceEndBlock(NULL);
// Output mesh areas
if (eOutputType == DiscretizationType_FV) {
mapRemap.SetTargetAreas(meshOutput.vecFaceArea);
}
// Load overlap mesh
AnnounceStartBlock("Loading overlap mesh");
Mesh meshOverlap(strOverlapMesh);
meshOverlap.RemoveZeroEdges();
// Verify that overlap mesh is in the correct order
int ixFirstFaceMax = (-1);
int ixSecondFaceMax = (-1);
if (meshOverlap.vecFirstFaceIx.size() !=
meshOverlap.vecSecondFaceIx.size()
) {
_EXCEPTIONT("Invalid overlap mesh:\n"
" Possible mesh file corruption?");
}
for (int i = 0; i < meshOverlap.vecFirstFaceIx.size(); i++) {
if (meshOverlap.vecFirstFaceIx[i] + 1 > ixFirstFaceMax) {
ixFirstFaceMax = meshOverlap.vecFirstFaceIx[i] + 1;
}
if (meshOverlap.vecSecondFaceIx[i] + 1 > ixSecondFaceMax) {
ixSecondFaceMax = meshOverlap.vecSecondFaceIx[i] + 1;
}
}
// Check for forward correspondence in overlap mesh
if (ixFirstFaceMax == meshInput.faces.size() //&&
//(ixSecondFaceMax == meshOutput.faces.size())
) {
Announce("Overlap mesh forward correspondence found");
// Check for reverse correspondence in overlap mesh
} else if (
ixFirstFaceMax == meshOutput.faces.size() //&&
//(ixSecondFaceMax == meshInput.faces.size())
) {
Announce("Overlap mesh reverse correspondence found (reversing)");
// Reorder overlap mesh
meshOverlap.ExchangeFirstAndSecondMesh();
// No correspondence found
} else {
_EXCEPTION2("Invalid overlap mesh:\n"
" No correspondence found with input and output meshes (%i,%i)",
ixFirstFaceMax, ixSecondFaceMax);
}
AnnounceEndBlock(NULL);
// Calculate Face areas
AnnounceStartBlock("Calculating overlap mesh Face areas");
Real dTotalAreaOverlap = meshOverlap.CalculateFaceAreas();
Announce("Overlap Mesh Area: %1.15e", dTotalAreaOverlap);
AnnounceEndBlock(NULL);
// Partial cover
if (fabs(dTotalAreaOverlap - dTotalAreaInput) > 1.0e-10) {
if (!fNoCheck) {
Announce("WARNING: Significant mismatch between overlap mesh area "
"and input mesh area.\n Automatically enabling --nocheck");
fNoCheck = true;
}
}
/*
// Recalculate input mesh area from overlap mesh
if (fabs(dTotalAreaOverlap - dTotalAreaInput) > 1.0e-10) {
AnnounceStartBlock("Overlap mesh only covers a sub-area of the sphere");
Announce("Recalculating source mesh areas");
dTotalAreaInput = meshInput.CalculateFaceAreasFromOverlap(meshOverlap);
Announce("New Input Mesh Geometric Area: %1.15e", dTotalAreaInput);
AnnounceEndBlock(NULL);
}
*/
// Finite volume input / Finite volume output
if ((eInputType == DiscretizationType_FV) &&
(eOutputType == DiscretizationType_FV)
) {
// Generate reverse node array and edge map
meshInput.ConstructReverseNodeArray();
meshInput.ConstructEdgeMap();
// Initialize coordinates for map
mapRemap.InitializeSourceCoordinatesFromMeshFV(meshInput);
mapRemap.InitializeTargetCoordinatesFromMeshFV(meshOutput);
// Construct OfflineMap
AnnounceStartBlock("Calculating offline map");
LinearRemapFVtoFV(
meshInput, meshOutput, meshOverlap, nPin, mapRemap);
// Finite volume input / Finite element output
} else if (eInputType == DiscretizationType_FV) {
DataMatrix3D<int> dataGLLNodes;
DataMatrix3D<double> dataGLLJacobian;
if (strMetaFile != "") {
AnnounceStartBlock("Loading meta data file");
LoadMetaDataFile(strMetaFile, dataGLLNodes, dataGLLJacobian);
AnnounceEndBlock(NULL);
} else {
AnnounceStartBlock("Generating output mesh meta data");
double dNumericalArea =
GenerateMetaData(
meshOutput,
nPout,
fBubble,
dataGLLNodes,
dataGLLJacobian);
Announce("Output Mesh Numerical Area: %1.15e", dNumericalArea);
AnnounceEndBlock(NULL);
}
// Initialize coordinates for map
mapRemap.InitializeSourceCoordinatesFromMeshFV(meshInput);
mapRemap.InitializeTargetCoordinatesFromMeshFE(
meshOutput, nPout, dataGLLNodes);
// Generate the continuous Jacobian
bool fContinuous = (eOutputType == DiscretizationType_CGLL);
if (eOutputType == DiscretizationType_CGLL) {
GenerateUniqueJacobian(
dataGLLNodes,
dataGLLJacobian,
mapRemap.GetTargetAreas());
} else {
GenerateDiscontinuousJacobian(
dataGLLJacobian,
mapRemap.GetTargetAreas());
}
// Generate reverse node array and edge map
meshInput.ConstructReverseNodeArray();
meshInput.ConstructEdgeMap();
// Generate remap weights
AnnounceStartBlock("Calculating offline map");
//LinearRemapFVtoGLL_Simple(
LinearRemapFVtoGLL(
meshInput,
meshOutput,
meshOverlap,
dataGLLNodes,
dataGLLJacobian,
mapRemap.GetTargetAreas(),
nPin,
mapRemap,
fMonotone,
fContinuous);
// Finite element input / Finite volume output
} else if (
(eInputType != DiscretizationType_FV) &&
(eOutputType == DiscretizationType_FV)
) {
DataMatrix3D<int> dataGLLNodes;
DataMatrix3D<double> dataGLLJacobian;
if (strMetaFile != "") {
AnnounceStartBlock("Loading meta data file");
LoadMetaDataFile(strMetaFile, dataGLLNodes, dataGLLJacobian);
AnnounceEndBlock(NULL);
} else {
AnnounceStartBlock("Generating input mesh meta data");
double dNumericalArea =
GenerateMetaData(
meshInput,
nPin,
fBubble,
dataGLLNodes,
dataGLLJacobian);
Announce("Input Mesh Numerical Area: %1.15e", dNumericalArea);
AnnounceEndBlock(NULL);
if (fabs(dNumericalArea - dTotalAreaInput) > 1.0e-12) {
Announce("WARNING: Significant mismatch between input mesh "
"numerical area and geometric area");
}
}
if (dataGLLNodes.GetSubColumns() != meshInput.faces.size()) {
_EXCEPTIONT("Number of element does not match between metadata and "
"input mesh");
}
// Initialize coordinates for map
mapRemap.InitializeSourceCoordinatesFromMeshFE(
meshInput, nPin, dataGLLNodes);
mapRemap.InitializeTargetCoordinatesFromMeshFV(meshOutput);
// Generate the continuous Jacobian for input mesh
bool fContinuousIn = (eInputType == DiscretizationType_CGLL);
if (eInputType == DiscretizationType_CGLL) {
GenerateUniqueJacobian(
dataGLLNodes,
dataGLLJacobian,
mapRemap.GetSourceAreas());
} else {
GenerateDiscontinuousJacobian(
dataGLLJacobian,
mapRemap.GetSourceAreas());
}
// Generate offline map
AnnounceStartBlock("Calculating offline map");
LinearRemapSE4(
meshInput,
meshOutput,
meshOverlap,
dataGLLNodes,
dataGLLJacobian,
fMonotone,
fContinuousIn,
mapRemap
);
// Finite element input / Finite element output
} else if (
(eInputType != DiscretizationType_FV) &&
(eOutputType != DiscretizationType_FV)
) {
DataMatrix3D<int> dataGLLNodesIn;
DataMatrix3D<double> dataGLLJacobianIn;
DataMatrix3D<int> dataGLLNodesOut;
DataMatrix3D<double> dataGLLJacobianOut;
AnnounceStartBlock("Generating input mesh meta data");
double dNumericalAreaIn =
GenerateMetaData(
meshInput,
nPin,
fBubble,
dataGLLNodesIn,
dataGLLJacobianIn);
Announce("Input Mesh Numerical Area: %1.15e", dNumericalAreaIn);
AnnounceEndBlock(NULL);
AnnounceStartBlock("Generating output mesh meta data");
double dNumericalAreaOut =
GenerateMetaData(
meshOutput,
nPout,
fBubble,
dataGLLNodesOut,
dataGLLJacobianOut);
Announce("Output Mesh Numerical Area: %1.15e", dNumericalAreaOut);
AnnounceEndBlock(NULL);
// Initialize coordinates for map
mapRemap.InitializeSourceCoordinatesFromMeshFE(
meshInput, nPin, dataGLLNodesIn);
mapRemap.InitializeTargetCoordinatesFromMeshFE(
meshOutput, nPout, dataGLLNodesOut);
// Generate the continuous Jacobian for input mesh
bool fContinuousIn = (eInputType == DiscretizationType_CGLL);
if (eInputType == DiscretizationType_CGLL) {
GenerateUniqueJacobian(
dataGLLNodesIn,
dataGLLJacobianIn,
mapRemap.GetSourceAreas());
} else {
GenerateDiscontinuousJacobian(
dataGLLJacobianIn,
mapRemap.GetSourceAreas());
}
// Generate the continuous Jacobian for output mesh
bool fContinuousOut = (eOutputType == DiscretizationType_CGLL);
if (eOutputType == DiscretizationType_CGLL) {
GenerateUniqueJacobian(
dataGLLNodesOut,
dataGLLJacobianOut,
mapRemap.GetTargetAreas());
} else {
GenerateDiscontinuousJacobian(
dataGLLJacobianOut,
mapRemap.GetTargetAreas());
}
// Generate offline map
AnnounceStartBlock("Calculating offline map");
LinearRemapGLLtoGLL_Pointwise(
meshInput,
meshOutput,
meshOverlap,
dataGLLNodesIn,
dataGLLJacobianIn,
dataGLLNodesOut,
dataGLLJacobianOut,
mapRemap.GetTargetAreas(),
nPin,
nPout,
fMonotone,
fContinuousIn,
fContinuousOut,
mapRemap
);
} else {
_EXCEPTIONT("Not implemented");
}
//#pragma warning "NOTE: VERIFICATION DISABLED"
// Verify consistency, conservation and monotonicity
if (!fNoCheck) {
AnnounceStartBlock("Verifying map");
mapRemap.IsConsistent(1.0e-8);
mapRemap.IsConservative(1.0e-8);
if (fMonotone) {
mapRemap.IsMonotone(1.0e-12);
}
AnnounceEndBlock(NULL);
}
AnnounceEndBlock(NULL);
// Initialize element dimensions from input/output Mesh
AnnounceStartBlock("Writing output");
// Output the Offline Map
if (strOutputMap != "") {
AnnounceStartBlock("Writing offline map");
mapRemap.Write(strOutputMap);
AnnounceEndBlock(NULL);
}
// Apply Offline Map to data
if (strInputData != "") {
AnnounceStartBlock("Applying offline map to data");
mapRemap.SetFillValueOverride(static_cast<float>(dFillValueOverride));
mapRemap.Apply(
strInputData,
strOutputData,
vecVariableStrings,
strNColName,
fOutputDouble,
false);
AnnounceEndBlock(NULL);
}
AnnounceEndBlock(NULL);
// Copy variables from input file to output file
if ((strInputData != "") && (strOutputData != "")) {
if (fPreserveAll) {
AnnounceStartBlock("Preserving variables");
mapRemap.PreserveAllVariables(strInputData, strOutputData);
AnnounceEndBlock(NULL);
} else if (vecPreserveVariableStrings.size() != 0) {
AnnounceStartBlock("Preserving variables");
mapRemap.PreserveVariables(
strInputData,
strOutputData,
vecPreserveVariableStrings);
AnnounceEndBlock(NULL);
}
}
AnnounceBanner();
} catch(Exception & e) {
Announce(e.ToString().c_str());
}
}
///////////////////////////////////////////////////////////////////////////////