39class AdaptiveMeshRefinement {
44 typedef Teuchos::RCP<MeshUnstructured<SC,LO,GO,NO> > MeshUnstrPtr_Type;
46 typedef std::vector<MeshUnstrPtr_Type> MeshUnstrPtrArray_Type;
48 typedef typename Mesh_Type::CommPtr_Type CommPtr_Type;
49 typedef typename Mesh_Type::CommConstPtr_Type CommConstPtr_Type;
52 typedef Teuchos::RCP<Elements_Type> ElementsPtr_Type;
54 typedef Teuchos::RCP<SurfaceElements_Type> SurfaceElementsPtr_Type;
56 typedef Teuchos::RCP<EdgeElements_Type> EdgeElementsPtr_Type;
59 typedef typename Map_Type::MapPtr_Type MapPtr_Type;
60 typedef typename Map_Type::MapConstPtr_Type MapConstPtr_Type;
63 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
65 typedef Teuchos::RCP<MultiVectorLO_Type> MultiVectorLOPtr_Type;
67 typedef Teuchos::RCP<MultiVectorGO_Type> MultiVectorGOPtr_Type;
68 typedef Teuchos::RCP<const MultiVector_Type> MultiVectorConstPtr_Type;
69 typedef Teuchos::OrdinalTraits<LO> OTLO;
72 typedef Teuchos::RCP<Matrix_Type> MatrixPtr_Type;
75 typedef Teuchos::RCP<Exporter_Type> ExporterPtr_Type;
76 typedef Teuchos::RCP<ExporterTxt> ExporterTxtPtr_Type;
79 typedef Teuchos::RCP<Problem_Type> ProblemPtr_Type;
82 typedef Teuchos::RCP<Domain_Type> DomainPtr_Type;
83 typedef std::vector<DomainPtr_Type> DomainPtrArray_Type;
85 typedef std::vector<MultiVectorPtr_Type> MultiVectorPtrArray_Type;
88 typedef Teuchos::RCP<BlockMultiVector_Type> BlockMultiVectorPtr_Type;
89 typedef Teuchos::RCP<const BlockMultiVector_Type> BlockMultiVectorConstPtr_Type;
91 AdaptiveMeshRefinement();
93 AdaptiveMeshRefinement(ParameterListPtr_Type parameterListAll);
95 AdaptiveMeshRefinement(std::string problemType, ParameterListPtr_Type parameterListAll);
97 AdaptiveMeshRefinement(std::string problemType, ParameterListPtr_Type parameterListAll , Func_Type exactSolFunc );
98 AdaptiveMeshRefinement(std::string problemType, ParameterListPtr_Type parameterListAll , Func_Type exactSolFuncU,Func_Type exactSolFuncP );
100 ~AdaptiveMeshRefinement();
102 DomainPtr_Type
globalAlgorithm(DomainPtr_Type domainP1, DomainPtr_Type domainP12, BlockMultiVectorConstPtr_Type solution,ProblemPtr_Type problem, RhsFunc_Type rhsFunc );
104 DomainPtr_Type
refineArea(DomainPtr_Type domainP1, vec2D_dbl_Type area,
int level);
106 DomainPtr_Type
refineUniform(DomainPtr_Type domainP1,
int level);
108 DomainPtr_Type refineFlag(DomainPtr_Type domainP1,
int level ,
int flag);
116 void calcErrorNorms(MultiVectorConstPtr_Type exactSolution, MultiVectorConstPtr_Type solutionP12,MultiVectorConstPtr_Type exactSolutionP);
118 void initExporter( ParameterListPtr_Type parameterListAll);
120 void exportSolution(MeshUnstrPtr_Type mesh, MultiVectorConstPtr_Type exportSolutionMv, MultiVectorConstPtr_Type errorValues, MultiVectorConstPtr_Type exactSolutionMv,MultiVectorConstPtr_Type exportSolutionPMv, MultiVectorConstPtr_Type exactSolutionPMv);
122 void exportError(MeshUnstrPtr_Type mesh, MultiVectorConstPtr_Type errorElConst, MultiVectorConstPtr_Type errorElConstH1 , MultiVectorConstPtr_Type difH1Eta ,MultiVectorConstPtr_Type vecDecompositionConst );
126 void buildSurfaceTriangleElements(ElementsPtr_Type elements, EdgeElementsPtr_Type edgeElements, SurfaceElementsPtr_Type surfaceTriangleElements );
128 vec_bool_Type checkInterfaceSurface( EdgeElementsPtr_Type edgeElements,vec_int_Type originFlag, vec_int_Type edgeNumbers,
int indexElement);
136 RhsFunc_Type rhsFunc_;
137 Func_Type exactSolFunc_;
139 Func_Type exactSolPFunc_;
141 MeshUnstrPtr_Type inputMeshP1_;
142 MeshUnstrPtr_Type inputMeshP12_;
143 MeshUnstrPtr_Type outputMesh_;
145 MultiVectorPtrArray_Type errorEstimationMv_;
147 MultiVectorPtr_Type errorElementsMv_;
148 MultiVectorPtr_Type errorH1ElementsMv_;
149 MultiVectorPtr_Type difH1EtaElementsMv_;
151 MultiVectorConstPtr_Type errorNodesMv_;
152 MultiVectorConstPtr_Type errorNodesPMv_;
154 BlockMultiVectorConstPtr_Type solution_;
156 CommConstPtr_Type comm_;
158 bool exportWithParaview_ =
true;
159 bool initExporter_=
false;
161 ExporterPtr_Type exporterSol_;
162 ExporterPtr_Type exporterSolP_;
163 ExporterPtr_Type exporterError_;
165 DomainPtrArray_Type domainsP1_;
166 DomainPtrArray_Type domainsP12_;
168 DomainPtr_Type domainP1_;
169 DomainPtr_Type domainP12_;
171 ProblemPtr_Type problem_;
173 std::string refinementRestriction_ =
"keepRegularity";
174 std::string markingStrategy_ =
"Maximum";
179 bool meshQualityPrint_ =
"false";
180 bool timeTablePrint_ =
"false";
181 int refinement3DDiagonal_ = 0;
183 std::string problemType_;
190 std::string FEType1_;
191 std::string FEType2_;
193 vec_dbl_Type maxErrorEl;
194 vec_dbl_Type maxErrorKn;
195 vec_int_Type numElements;
196 vec_int_Type numElementsProc;
197 vec_dbl_Type relError;
198 vec_dbl_Type eRelError;
199 vec_dbl_Type errorH1;
200 vec_dbl_Type errorL2;
201 vec_dbl_Type errorL2P;
202 vec_int_Type numNodes;
204 bool writeRefinementTime_ = true ;
205 bool writeRefinementInfo_ = true ;
206 bool writeMeshQuality_ = true ;
208 bool hasProblemType_=
true;
210 ParameterListPtr_Type parameterListAll_ ;
215 bool exactSolInput_ = false ;
216 bool exactSolPInput_ = false ;
218 bool calculatePressure_=
false;
220 int restrictionLayer_=2;
222 int coarseningCycle_=0 ;
223 int coarseningM_ = 1;
224 int coarseningN_ = 1;
226 std::string refinementMode_ =
"Regular";