1#ifndef ExporterParaViewAMR_def_hpp
2#define ExporterParaViewAMR_def_hpp
14template<
class SC,
class LO,
class GO,
class NO>
15ExporterParaViewAMR<SC,LO,GO,NO>::ExporterParaViewAMR():
21template<
class SC,
class LO,
class GO,
class NO>
22void ExporterParaViewAMR<SC,LO,GO,NO>::reSetup(MeshPtr_Type mesh){
25 this->nmbElementsGlob_ = this->mesh_->getNumElementsGlobal();
26 this->pointsUnique_ = this->mesh_->getPointsUnique();
27 this->nmbPointsGlob_ = this->mesh_->getMapUnique()->getGlobalNumElements();
35 MapConstPtr_Type elementMap = this->mesh_->getElementMap();
36 Teuchos::ArrayView<const GO> nodeElementList = elementMap->getNodeElementList();
37 vec_GO_Type nodeElementListInteger( this->nmbPointsPerElement_ * nodeElementList.size() );
39 for (
int i=0; i<nodeElementList.size(); i++) {
40 for (
int j=0; j<this->nmbPointsPerElement_; j++){
41 nodeElementListInteger[counter] = (int) this->nmbPointsPerElement_*nodeElementList[i] + j;
45 Teuchos::ArrayView<GO> globalMapIDs = Teuchos::arrayViewFromVector( nodeElementListInteger);
46 MapPtr_Type mapElements = Teuchos::rcp(
new Map_Type((
int) (this->nmbPointsPerElement_*this->nmbElementsGlob_), globalMapIDs,elementMap->getIndexBase()*this->nmbPointsPerElement_, this->comm_));
49 this->elementsHDF_.reset(
new MultiVector_Type(mapElements,1));
51 ElementsPtr_Type elements = this->mesh_->getElementsC();
53 for (
int i=0; i<elements->numberElements(); i++) {
54 for (
int j=0; j<this->nmbPointsPerElement_; j++) {
55 int globalIndex = (int) this->mesh_->getMapRepeated()->getGlobalElement( elements->getElement(i).getNode(j) );
56 (this->elementsHDF_->getDataNonConst(0))[counter] = globalIndex;
61 this->pointsHDF_.reset(
new MultiVector_Type(this->mesh_->getMapUnique(),this->dim_));
66 std::string nameConn =
"Connections" + std::to_string(this->timeIndex_);
67 this->writeMeshElements(nameConn);
71template<
class SC,
class LO,
class GO,
class NO>
72void ExporterParaViewAMR<SC,LO,GO,NO>::updateVariables(MultiVectorConstPtr_Type &u, std::string varName){
74 for (
int i=0; i<this->variables_.size(); i++) {
75 if(this->varNames_[i] == varName){
76 this->variables_[i] = u;
77 if (this->FEType_ ==
"P0") {
78 this->mapUniqueVariables_ = this->mesh_->getElementMap();
81 this->mapUniqueVariables_= this->mesh_->getMapUnique();
83 this->nmbExportValuesGlob_ = this->mapUniqueVariables_->getGlobalNumElements();
85 this->uniqueMaps_[i] =this->mapUniqueVariables_;
Definition ExporterParaView_decl.hpp:30
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36