Commit 9db73f52 authored by simone's avatar simone
Browse files

NavierStokesHandler:

Constructor with
DataType& dataNavierStokes
does not need
GetPot&   data_file,

NavierStokesAleHandler:
definting _dw etc...
parent 2e73d25a
......@@ -110,6 +110,7 @@ public:
//! Interpolated mesh velocity
PhysVectUnknown<Vector>& dwInterpolated();
PhysVectUnknown<Vector>& dw();
//! Updating mesh
void updateMesh( const Real& time );
......@@ -156,10 +157,13 @@ protected:
PhysVectUnknown<Vector> _wInterp;
//! The interpolated displacement dervivative (right hand sized linearized)
PhysVectUnknown<Vector> _dInterp;
PhysVectUnknown<Vector> _dx;
//! The interpolated mesh velocity mesh velocity (right hand sized linearized)
PhysVectUnknown<Vector> _dwInterp;
PhysVectUnknown<Vector> _dw;
//! This method interpolates the mesh velocity when necessary (refFE_u.nbNodes > this->_mesh.getRefFE().nbNodes)
......@@ -208,6 +212,7 @@ NavierStokesAleHandler( const GetPot& data_file,
BCh_mesh ),
_dispOld ( M_harmonicExtension.dofMesh().numTotalDof() ),
_w ( M_harmonicExtension.dofMesh().numTotalDof() ),
_dw ( M_harmonicExtension.dofMesh().numTotalDof() ),
_wInterp ( this->_dim_u ),
_dInterp ( this->_dim_u ),
_dwInterp ( this->_dim_u )
......@@ -233,8 +238,7 @@ NavierStokesAleHandler( const GetPot& data_file,
const QuadRule& bdQr_p,
BCHandler& BCh_u,
BCHandler& BCh_mesh ) :
NavierStokesHandler<Mesh>( data_file,
dataNavierStokes,
NavierStokesHandler<Mesh>( dataNavierStokes,
refFE_u,
refFE_p,
Qr_u,
......@@ -249,6 +253,7 @@ NavierStokesAleHandler( const GetPot& data_file,
quadRuleTria3pt,
BCh_mesh ),
_dispOld ( M_harmonicExtension.dofMesh().numTotalDof() ),
_dw ( M_harmonicExtension.dofMesh().numTotalDof() ),
_w ( M_harmonicExtension.dofMesh().numTotalDof() ),
_wInterp ( this->_dim_u ),
_dInterp ( this->_dim_u ),
......@@ -285,6 +290,7 @@ NavierStokesAleHandler( const GetPot& data_file,
quadRuleTetra4pt,
quadRuleTria3pt ),
_dispOld ( M_harmonicExtension.dofMesh().numTotalDof() ),
_dw ( M_harmonicExtension.dofMesh().numTotalDof() ),
_w ( M_harmonicExtension.dofMesh().numTotalDof() ),
_wInterp ( this->_dim_u ),
_dInterp ( this->_dim_u ),
......@@ -342,6 +348,9 @@ updateDispVelo()
std::cout << " max norm dx = " << norm_inf( M_harmonicExtension.getDisplacement() ) << std::endl;
_dx = M_harmonicExtension.getDisplacement();
_dw = _dx*dti;
_interpolate( _w.nbcomp(), M_harmonicExtension.getDisplacement(), _dInterp );
std::cout << " max norm dxInterp = " << norm_inf( _dInterp ) << std::endl;
......@@ -668,6 +677,12 @@ PhysVectUnknown<Vector>& NavierStokesAleHandler<Mesh>::w()
return _w;
}
template <typename Mesh>
PhysVectUnknown<Vector>& NavierStokesAleHandler<Mesh>::dw()
{
return _dw;
}
// This method interpolates the mesh velocity when necessary (refFE_u.nbNodes > this->mesh().getRefFE().nbNodes)
template <typename Mesh>
......
......@@ -74,6 +74,8 @@ class NavierStokesHandler//:
public:
typedef DataType data_type;
typedef Real ( *Function ) ( const Real&, const Real&, const Real&,
const Real&, const ID& );
typedef boost::function<Real ( Real const&, Real const&, Real const&,
......@@ -109,15 +111,14 @@ public:
const QuadRule& bdQr_p,
BCHandler& BCh_u );
NavierStokesHandler( const GetPot& data_file,
const DataNavierStokes<Mesh>& dataNavierStokes,
const RefFE& refFE_u,
const RefFE& refFE_p,
const QuadRule& Qr_u,
const QuadRule& bdQr_u,
const QuadRule& Qr_p,
const QuadRule& bdQr_p,
BCHandler& BCh_u );
NavierStokesHandler( const DataType& dataNavierStokes,
const RefFE& refFE_u,
const RefFE& refFE_p,
const QuadRule& Qr_u,
const QuadRule& bdQr_u,
const QuadRule& Qr_p,
const QuadRule& bdQr_p,
BCHandler& BCh_u );
/*! constructor without BCs */
NavierStokesHandler( const GetPot& data_file,
......@@ -373,16 +374,16 @@ protected:
//! data for NS solvers
DataType M_dataType;
data_type M_dataType;
//! source term for NS
source_type _M_source;
source_type _M_source;
//! Reference FE for the velocity
const RefFE& _refFE_u;
const RefFE& _refFE_u;
//! Reference FE for the pressure
const RefFE& _refFE_p;
const RefFE& _refFE_p;
//! The Dof object associated with the velocity
Dof _dof_u;
......@@ -550,14 +551,13 @@ NavierStokesHandler( const GetPot& data_file, const RefFE& refFE_u,
// Constructors
template <typename Mesh, typename DataType>
NavierStokesHandler<Mesh, DataType>::
NavierStokesHandler( const GetPot& data_file,
const DataNavierStokes<Mesh>& dataNavierStokes,
const RefFE& refFE_u,
const RefFE& refFE_p,
const QuadRule& Qr_u,
const QuadRule& bdQr_u,
const QuadRule& Qr_p,
const QuadRule& bdQr_p,
NavierStokesHandler( const DataType& dataNavierStokes,
const RefFE& refFE_u,
const RefFE& refFE_p,
const QuadRule& Qr_u,
const QuadRule& bdQr_u,
const QuadRule& Qr_p,
const QuadRule& bdQr_p,
BCHandler& BCh_u ) :
M_dataType ( dataNavierStokes ),
_refFE_u ( refFE_u ),
......
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