Commit b2b972ab authored by Spencer Sherwin's avatar Spencer Sherwin

Merge branch 'fix/time-int-tests' into 'master'

Fix Windows runtime error due to long-option formatting.

See merge request !986
parents 5a6669a1 5b41dc29
Pipeline #513 passed with stage
in 0 seconds
......@@ -162,7 +162,8 @@ v4.4.2
- Fix deadlock in DiffusionLDG (!885)
- Fix uninitialised coefficients in DirectFull solver (!898)
- Updated PETSc to 3.7.7 (!916)
- Fix typcase to an integer which set Lz < 1 to zero when postprocess hdf5 output (!9922)
- Fix typecase to an integer which set Lz < 1 to zero when postprocess hdf5 output (!922)
- Fix program options errors on Windows in debug mode (!986)
**IncNavierStokesSolver**
- Add a test for imaginary shift to be only used with Homogenous and SingleMode on. (!928)
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 7</parameters>
<parameters>--points 100 --timesteps 100 --method 7</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.10135</value>
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 4</parameters>
<parameters>--points 100 --timesteps 100 --method 4</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.0616905</value>
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 5</parameters>
<parameters>--points 100 --timesteps 100 --method 5</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.061634</value>
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 6</parameters>
<parameters>--points 100 --timesteps 100 --method 6</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.315262</value>
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 1</parameters>
<parameters>--points 100 --timesteps 100 --method 1</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.224678</value>
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 2</parameters>
<parameters>--points 100 --timesteps 100 --method 2</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.0798986</value>
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 3</parameters>
<parameters>--points 100 --timesteps 100 --method 3</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.0610636</value>
......
......@@ -2,7 +2,7 @@
<test>
<description>Test for time integration schemes</description>
<executable>TimeIntegrationDemo</executable>
<parameters>--Npoints 100 --Ntimesteps 100 --NTimeIntegrationMethod 8</parameters>
<parameters>--points 100 --timesteps 100 --method 8</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">0.134315</value>
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description:
// Description: Example of using time-integration schemes.
//
///////////////////////////////////////////////////////////////////////////////
......@@ -181,20 +181,25 @@ int main(int argc, char *argv[])
{
po::options_description desc("Available options");
desc.add_options()
("help, h", "Produce this help message.")
("Npoints, np", po::value<int>(),
"the number of grid points to be used.")
("Ntimesteps, nt", po::value<int>(),
"the number of timesteps to be used.")
("NTimeIntegrationMethod, nm", po::value<int>(),
"TimeIntegrationMethod is a number in the range [1,5]."
"and defines the time-integration method to be used, i.e"
"- 1: 1st order multi-step IMEX scheme (Euler Backwards/Euler Forwards)"
"- 2: 2nd order multi-step IMEX scheme"
"- 3: 3rd order multi-step IMEX scheme"
"- 4: 2nd order multi-stage DIRK IMEX scheme"
"- 5: 3nd order multi-stage DIRK IMEX scheme"
"- 6: 2nd order IMEX Gear (Extrapolated Gear/SBDF-2)");
("help,h", "Produce this help message.")
("points,p", po::value<int>(),
"Number of grid points to be used.")
("timesteps,t", po::value<int>(),
"Number of timesteps to be used.")
("method,m", po::value<int>(),
"TimeIntegrationMethod is a number in the range [1,8].\n"
"It defines the time-integration method to be used:\n"
"- 1: 1st order multi-step IMEX scheme\n"
" (Euler Backwards/Euler Forwards)\n"
"- 2: 2nd order multi-step IMEX scheme\n"
"- 3: 3rd order multi-step IMEX scheme\n"
"- 4: 2nd order multi-stage DIRK IMEX scheme\n"
"- 5: 3nd order multi-stage DIRK IMEX scheme\n"
"- 6: 2nd order IMEX Gear (Extrapolated Gear/SBDF-2)\n"
"- 7: 2nd order Crank-Nicolson/Adams-Bashforth (CNAB)\n"
"- 8: 2nd order Modified Crank-Nicolson/Adams-Bashforth\n"
" (MCNAB)"
);
po::variables_map vm;
try
{
......@@ -209,29 +214,17 @@ int main(int argc, char *argv[])
return 1;
}
if (!vm.count("Npoints") || !vm.count("Ntimesteps") || !vm.count("NTimeIntegrationMethod"))
if (!vm.count("points") || !vm.count("timesteps") || !vm.count("method")
|| vm.count("help"))
{
cerr << "Usage: Project1D --Npoints nPoints --Ntimesteps nTimesteps --TimeIntegrationMethod nMethod" << endl;
cerr << "Where - Npoints is the number of grid points to be used" << endl;
cerr << " for the finite difference discretisation" << endl;
cerr << " - Ntimesteps is the number of timesteps to be used" << endl;
cerr << " for the time-integration method" << endl;
cerr << " - TimeIntegrationMethod is a number in the range [1,8]" << endl;
cerr << " and defines the time-integration method to be used, i.e." << endl;
cerr << " - 1: 1st order multi-step IMEX scheme (Euler Backwards/Euler Forwards)" << endl;
cerr << " - 2: 2nd order multi-step IMEX scheme" << endl;
cerr << " - 3: 3rd order multi-step IMEX scheme" << endl;
cerr << " - 4: 2nd order multi-stage DIRK IMEX scheme" << endl;
cerr << " - 5: 3nd order multi-stage DIRK IMEX scheme" << endl;
cerr << " - 6: 2nd order IMEX Gear (Extrapolated Gear/SBDF-2)" << endl;
cerr << " - 7: 2nd order Crank-Nicolson/Adams-Bashforth (CNAB)" << endl;
cerr << " - 8: 2nd order Modified Crank-Nicolson/Adams-Bashforth (MCNAB)" << endl;
cout << "Please specify points, timesteps and method." << endl << endl;
cout << desc;
return 1;
}
int nPoints = vm["Npoints"].as<int>();
int nTimesteps = vm["Ntimesteps"].as<int>();
int nMethod = vm["NTimeIntegrationMethod"].as<int>();
int nPoints = vm["points"].as<int>();
int nTimesteps = vm["timesteps"].as<int>();
int nMethod = vm["method"].as<int>();
// Open a file for writing the solution
ofstream outfile;
......@@ -340,16 +333,8 @@ int main(int argc, char *argv[])
break;
default :
{
cerr << "The third argument defines the time-integration method to be used" << endl;
cerr << "and should be a number in the range [1,6], i.e." << endl;
cerr << " - 1: 1st order multi-step IMEX scheme (Euler Backwards/Euler Forwards)" << endl;
cerr << " - 2: 2nd order multi-step IMEX scheme" << endl;
cerr << " - 3: 3rd order multi-step IMEX scheme" << endl;
cerr << " - 4: 2nd order multi-stage DIRK IMEX scheme" << endl;
cerr << " - 5: 3rd order multi-stage DIRK IMEX scheme" << endl;
cerr << " - 6: 2nd order IMEX Gear (Extrapolated Gear/SBDF-2)" << endl;
cerr << " - 7: 2nd order Crank-Nicolson/Adams-Bashforth (CNAB)" << endl;
cerr << " - 8: 2nd order Modified Crank-Nicolson/Adams-Bashforth (MCNAB)" << endl;
cout << "Invalid method." << endl << endl;
cout << desc;
exit(1);
}
}
......
......@@ -259,10 +259,11 @@ void InputSemtex::Process(po::variables_map &vm)
swap_endian(tmp);
}
double* x = &tmp[0];
for (int k = 0; k < nelmt; ++k)
{
std::copy(&tmp[k * elmtSize], &tmp[(k+1) * elmtSize],
data + k * offset + elSizeJ);
std::copy(x, x + elmtSize, data + k * offset + elSizeJ);
x += elmtSize;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment