VectorPetsc ( datamap_ptrtype const& dm, bool doInit=true ) : super( dm ), M_destroy_vec_on_exit( true ) { if ( doInit ) this->init( dm->nDof(), dm->nLocalDofWithoutGhost(), false ); }
sparse_matrix_ptrtype newZeroMatrix( datamap_ptrtype const& d1, datamap_ptrtype const& d2 ) { auto A = sparse_matrix_ptrtype( new eigen_sparse_matrix_type( d1->nGlobalElements(), d2->nGlobalElements() ) ); //A->setMatrixProperties( matrix_properties ); return A; }
sparse_matrix_ptrtype newMatrix( datamap_ptrtype const& d1, datamap_ptrtype const& d2, size_type matrix_properties = NON_HERMITIAN, bool init = true ) { auto A = sparse_matrix_ptrtype( new eigen_sparse_matrix_type( d1->nGlobalElements(), d2->nGlobalElements() ) ); A->setMatrixProperties( matrix_properties ); return A; }
sparse_matrix_ptrtype newZeroMatrix( datamap_ptrtype const& domainmap, datamap_ptrtype const& imagemap ) { graph_ptrtype sparsity_graph( new graph_type( imagemap, domainmap ) ); sparsity_graph->zero(); sparsity_graph->close(); sparse_matrix_ptrtype mat; if ( imagemap->worldComm().globalSize()>1 ) mat = sparse_matrix_ptrtype( new petscMPI_sparse_matrix_type( imagemap,domainmap,imagemap->worldComm() ) ); else mat = sparse_matrix_ptrtype( new petsc_sparse_matrix_type( imagemap,domainmap,imagemap->worldComm() ) ); mat->init( imagemap->nDof(), domainmap->nDof(), imagemap->nLocalDofWithoutGhost(), domainmap->nLocalDofWithoutGhost(), sparsity_graph ); return mat; }
sparse_matrix_ptrtype newMatrix( datamap_ptrtype const& domainmap, datamap_ptrtype const& imagemap, size_type matrix_properties = NON_HERMITIAN, bool init = true ) { sparse_matrix_ptrtype mat; if ( imagemap->worldComm().globalSize()>1 ) mat = sparse_matrix_ptrtype( new petscMPI_sparse_matrix_type( imagemap,domainmap,imagemap->worldComm() ) ); else mat = sparse_matrix_ptrtype( new petsc_sparse_matrix_type( imagemap,domainmap,imagemap->worldComm() ) ); mat->setMatrixProperties( matrix_properties ); if ( init ) { mat->init( imagemap->nDof(), domainmap->nDof(), imagemap->nLocalDofWithoutGhost(), domainmap->nLocalDofWithoutGhost() ); } return mat; }
vector_ptrtype newVector( datamap_ptrtype const& d ) { return vector_ptrtype( new eigen_vector_type( d->nGlobalElements() ) ); }