Commit d8bb07d3 authored by Markus Wolff's avatar Markus Wolff
Browse files

some changes in update and output functions



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4159 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent fa1a8a57
......@@ -143,7 +143,6 @@ public:
void initialize(bool solveTwice = true)
{
updateMaterialLaws();
assemble(true);
......@@ -188,6 +187,15 @@ public:
return;
}
void update()
{
updateMaterialLaws();
pressure(false);
return;
}
// serialization methods
template<class Restarter>
void serialize(Restarter &res)
......@@ -246,6 +254,12 @@ public:
*viscosityNonwetting = problem_.variables().viscosityNonwetting();
writer.addCellData(viscosityNonwetting, "nonwetting viscosity");
// typename Variables::ScalarSolutionType *saturation = writer.template createField<Scalar, 1> (problem_.gridView().size(0));
//
// *saturation = problem_.variables().saturation();
//
// writer.addCellData(saturation, "wetting saturation");
return;
}
......
......@@ -50,6 +50,7 @@ template<class TypeTag>
class FVVelocity2P: public FVPressure2P<TypeTag>
{
typedef FVVelocity2P<TypeTag> ThisType;
typedef FVPressure2P<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem;
......@@ -151,6 +152,15 @@ public:
*/
void calculateVelocity();
void update()
{
ParentType::update();
calculateVelocity();
return;
}
private:
static const int velocityType_ = GET_PROP_VALUE(TypeTag, PTAG(VelocityFormulation)); //!< gives kind of velocity used (\f$ 0 = v_w\f$, \f$ 1 = v_n\f$, \f$ 2 = v_t\f$)
};
......
......@@ -57,12 +57,13 @@ namespace Dumux
template<class TypeTag>
class FVSaturation2P
{
typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem;
typedef typename GET_PROP(TypeTag, PTAG(ReferenceElements)) ReferenceElements;
typedef typename ReferenceElements::Container ReferenceElementContainer;
typedef typename ReferenceElements::ContainerFaces ReferenceElementFaceContainer;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Variables)) Variables;
typedef typename GET_PROP(TypeTag, PTAG(ReferenceElements)) ReferenceElements;
typedef typename ReferenceElements::Container ReferenceElementContainer;
typedef typename ReferenceElements::ContainerFaces ReferenceElementFaceContainer;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(DiffusivePart)) DiffusivePart;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(ConvectivePart)) ConvectivePart;
......@@ -164,12 +165,26 @@ public:
*/
void updateMaterialLaws(RepresentationType& saturation, bool iterate);
template<class MultiWriter>
void addOutputVtkFields(MultiWriter &writer)
{
problem_.variables().addOutputVtkFields(writer);
return;
}
//! \brief Write data files
/* \param name file name */
template<class MultiWriter>
void addOutputVtkFields(MultiWriter &writer)
{
typename Variables::ScalarSolutionType *saturation = writer.template createField<Scalar, 1> (problem_.gridView().size(0));
*saturation = problem_.variables().saturation();
if (saturationType_ == Sw)
{
writer.addCellData(saturation, "wetting saturation");
}
if (saturationType_ == Sn)
{
writer.addCellData(saturation, "nonwetting saturation");
}
return;
}
// serialization methods
template<class Restarter>
......
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