Commit cf3b993b authored by steffen.schotthoefer's avatar steffen.schotthoefer
Browse files

repaired test cases (fix IC)


Former-commit-id: bbcf5de2
parent 6b1c082a
......@@ -89,24 +89,29 @@ VectorVector LineSource_PN::SetupIC() {
VectorVector cellMids = _mesh->GetCellMidPoints();
// Initial condition is dirac impulse at (x,y) = (0,0) ==> constant in angle ==> all moments are zero.
double t = 3.2e-4; // pseudo time for gaussian smoothing (Approx to dirac impulse)
double offset = 0.099;
double t = 3.2e-4; // pseudo time for gaussian smoothing (Approx to dirac git impulse)
double offset = 0.0;
for( unsigned j = 0; j < cellMids.size(); ++j ) {
double x = cellMids[j][0];
double y = cellMids[j][1]; // (x- 0.5) * (x- 0.5)
psi[j][0] =
1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x - offset ) * ( x - offset ) + ( y - offset ) * ( y - offset ) ) / ( 4 * t ) ) +
1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x + offset ) * ( x + offset ) + ( y - offset ) * ( y - offset ) ) / ( 4 * t ) ) +
1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x - offset ) * ( x - offset ) + ( y + offset ) * ( y + offset ) ) / ( 4 * t ) ) +
1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x + offset ) * ( x + offset ) + ( y + offset ) * ( y + offset ) ) / ( 4 * t ) ) +
1.0 / ( 4.0 * M_PI * t ) *
std::exp( -( ( x - 2 * offset ) * ( x - 2 * offset ) + ( y - 2 * offset ) * ( y - 2 * offset ) ) / ( 4 * t ) ) +
1.0 / ( 4.0 * M_PI * t ) *
std::exp( -( ( x + 2 * offset ) * ( x + 2 * offset ) + ( y - 2 * offset ) * ( y - 2 * offset ) ) / ( 4 * t ) ) +
1.0 / ( 4.0 * M_PI * t ) *
std::exp( -( ( x - 2 * offset ) * ( x - 2 * offset ) + ( y + 2 * offset ) * ( y + 2 * offset ) ) / ( 4 * t ) ) +
1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x + 2 * offset ) * ( x + 2 * offset ) + ( y + 2 * offset ) * ( y + 2 * offset ) ) / ( 4 * t ) );
std::exp(
-( ( x - offset ) * ( x - offset ) + ( y - offset ) * ( y - offset ) ) /
( 4 * t ) ); // +
// 1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x - offset ) * ( x - offset ) + ( y - offset ) * ( y - offset ) ) / ( 4 *
// t ) ) + 1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x + offset ) * ( x + offset ) + ( y - offset ) * ( y - offset ) )
// / ( 4 * t ) ) + 1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x - offset ) * ( x - offset ) + ( y + offset ) * ( y +
// offset ) ) / ( 4 * t ) ) + 1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x + offset ) * ( x + offset ) + ( y + offset )
// * ( y + offset ) ) / ( 4 * t ) ) + 1.0 / ( 4.0 * M_PI * t ) *
// std::exp( -( ( x - 2 * offset ) * ( x - 2 * offset ) + ( y - 2 * offset ) * ( y - 2 * offset ) ) / ( 4 * t ) ) +
// 1.0 / ( 4.0 * M_PI * t ) *
// std::exp( -( ( x + 2 * offset ) * ( x + 2 * offset ) + ( y - 2 * offset ) * ( y - 2 * offset ) ) / ( 4 * t ) ) +
// 1.0 / ( 4.0 * M_PI * t ) *
// std::exp( -( ( x - 2 * offset ) * ( x - 2 * offset ) + ( y + 2 * offset ) * ( y + 2 * offset ) ) / ( 4 * t ) ) +
// 1.0 / ( 4.0 * M_PI * t ) * std::exp( -( ( x + 2 * offset ) * ( x + 2 * offset ) + ( y + 2 * offset ) * ( y + 2 *
// offset ) ) / ( 4 * t ) );
}
// Debugging jump test case
......
......@@ -58,31 +58,6 @@ MNSolver::MNSolver( Config* settings ) : Solver( settings ) {
// Solver output
_outputFields = std::vector( _nTotalEntries, std::vector( _nCells, 0.0 ) );
// Delete that
/*
std::string filename = "obFunc.csv";
std::ofstream myfile;
myfile.open( filename );
NewtonOptimizer* optimizer = new NewtonOptimizer( settings );
Vector alpha( 4, 0.0 );
Vector u( 4, 0.0 );
u[0] = -1.11;
u[1] = 0;
u[2] = 0;
u[4] = 0;
for( double a1 = -1000; a1 <= 100; a1 += 10.0 / 100.0 ) {
for( double a2 = -60; a2 <= 100; a2 += 60.0 / 40.0 ) {
alpha[0] = a1;
alpha[1] = a2;
myfile << a1 << ", " << a2 << ", " << optimizer->ComputeObjFunc( alpha, u, _moments ) << "\n";
}
}
myfile.close();
*/
}
MNSolver::~MNSolver() {
......
Supports Markdown
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