00001 #ifndef SUNDANCE_RIVARADRIVER_HPP
00002 #define SUNDANCE_RIVARADRIVER_HPP
00003
00004
00005 #include "SundanceMeshType.hpp"
00006 #include "SundanceMeshTransformationBase.hpp"
00007 #include "SundanceRivaraMesh.hpp"
00008 #include "SundanceExpr.hpp"
00009
00010 namespace Sundance
00011 {
00012
00013 class Mesh;
00014 using Sundance::Expr;
00015
00016 class RefinementTransformation : public MeshTransformationBase
00017 {
00018 public:
00019
00020 RefinementTransformation(const MeshType& meshType, const Expr& errExpr,
00021 const double& reqErr, const double& minArea)
00022 : MeshTransformationBase(meshType), meshType_(meshType),
00023 errExpr_(errExpr), reqErr_(reqErr), minArea_(minArea),
00024 numRefined_(-1) {}
00025
00026
00027 Mesh apply(const Mesh& inputMesh) const ;
00028
00029
00030 int numRefined() const {return numRefined_;}
00031
00032
00033 GET_RCP(MeshTransformationBase);
00034 private:
00035
00036 void meshToRivara(
00037 const Mesh& mesh,
00038 Array<int>& lidMap,
00039 RCP<Rivara::RivaraMesh>& rivMesh) const ;
00040
00041
00042 Mesh rivaraToMesh(const RCP<Rivara::RivaraMesh>& rivMesh,
00043 const MPIComm& comm) const ;
00044
00045 MeshType meshType_;
00046 Expr errExpr_;
00047 double reqErr_;
00048 double minArea_;
00049 mutable int numRefined_;
00050 };
00051
00052
00053 }
00054
00055
00056 #endif