Skip to content
Snippets Groups Projects
Commit 1fda0c35 authored by Robert K's avatar Robert K
Browse files

[bugfix] make pulse work on unit square.

parent a4fc75d0
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ namespace Fem
AdvectionLimiter::Enum::unlimited,
Matrix::Enum::matrixfree,
AdvectionFlux::Enum::upwind,
PrimalDiffusionFlux::Enum::general > AC;
PrimalDiffusionFlux::Enum::cdg2 > AC;
typedef typename AC::GridType GridType;
typedef typename AC::GridParts HostGridPartType;
......
......@@ -48,11 +48,11 @@ namespace Fem
startTime_( ParameterType::getValue<double>("femdg.stepper.starttime",0.0) ),
epsilon_( ParameterType::getValue<double>("epsilon",0.1) ),
spotmid_( 0 ),
myName_("AdvDiff")
center_( 0.5 ), // assume unit square
myName_("pulse")
{
spotmid_[0] = -0.25;
std::cout <<"Problem: "<<myName_<< ", epsilon " << epsilon_ << "\n";
//std::cout <<"Problem: HeatEqnWithAdvection, epsilon_" << epsilon_ << "\n";
}
//! this problem has no source term
......@@ -92,8 +92,8 @@ namespace Fem
void velocity(const DomainType& x, DomainType& v) const
{
// rotation in 2d
v[0] = -4.0*x[1];
v[1] = 4.0*x[0];
v[0] = -4.0*(x[1] - center_[ 1 ]);
v[1] = 4.0*(x[0] - center_[ 0 ]);
for(int i=2; i<DomainType :: dimension; ++i) v[i] = 0;
}
......@@ -110,8 +110,8 @@ namespace Fem
*/
void evaluate(const DomainType& arg, const double t, RangeType& res) const
{
const double x = arg[0];// - center_[ 0 ];
const double y = arg[1];// - center_[ 1 ];
const double x = arg[0] - center_[ 0 ];
const double y = arg[1] - center_[ 1 ];
const double sig2 = 0.004; /* Siehe Paper P.Bastian Gl. 30 */
const double sig2PlusDt4 = sig2+(4.0*epsilon_*t);
......@@ -136,6 +136,13 @@ namespace Fem
return ofs.str();
}
// return prefix for data loops
virtual std::string dataPrefix() const
{
return myName_;
}
/* \brief finalize the simulation using the calculated numerical
* solution u for this problem
*
......@@ -151,6 +158,7 @@ namespace Fem
const double startTime_;
const double epsilon_;
DomainType spotmid_;
DomainType center_;
std::string myName_;
};
......
# DATA WRITER
#------------
fem.io.datafileprefix: heat # prefix data data files
fem.io.datafileprefix: advdiff # prefix data data files
fem.io.savestep: 0.1 # save data every time interval
fem.io.savecount: -1 # save every i-th step
......@@ -17,21 +17,20 @@ gridsol.filename: heat-checkpoint
#--------
paramfile: ../../parameter/paramBase
# PROBLEM SETUP
#--------------
# problem: heat, quasi, plaplace
#problem: deformational
problem: pulse
fem.eoc.steps: 5
femdg.stepper.endtime: 1.0
femdg.stepper.diffusiontimestep: 1
epsilon: 1.0
plaplace: 3.0
xvelocity: 1. # the only advection part for the linear heat eqn
yvelocity: 3. # the only advection part for the linear heat eqn
zvelocity: 0. # the only advection part for the linear heat eqn
epsilon: 0.001
#plaplace: 3.0
#xvelocity: 1. # the only advection part for the linear heat eqn
#yvelocity: 3. # the only advection part for the linear heat eqn
#zvelocity: 0. # the only advection part for the linear heat eqn
# DOMAIN
......@@ -39,6 +38,7 @@ zvelocity: 0. # the only advection part for the linear heat eqn
fem.io.macroGridFile_1d: ../../grids/unitcube1.dgf
fem.io.macroGridFile_2d: ../../grids/unitcube2.dgf
#fem.io.macroGridFile_2d: ../../grids/square2d.dgf
fem.io.macroGridFile_3d: ../../grids/unitcube3.dgf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment