Skip to content
Snippets Groups Projects
Select Git revision
  • 36f63032053b2484148e53742c20a98a2827dc52
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

FunctionSpaceVector.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    ChainComplex.cpp 18.98 KiB
    // Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to the public mailing list <gmsh@onelab.info>.
    //
    // Contributed by Matti Pellikka <matti.pellikka@gmail.com>.
    
    #include "GmshConfig.h"
    #if defined(HAVE_KBIPACK)
    
    #include "ChainComplex.h"
    
    ChainComplex::ChainComplex(CellComplex* cellComplex, int domain)
    {
      _dim = cellComplex->getDim();
      _cellComplex = cellComplex;
    
      for(int i = 0; i < 5; i++){
        _HMatrix[i] = NULL;
        _kerH[i] = NULL;
        _codH[i] = NULL;
        _JMatrix[i] = NULL;
        _QMatrix[i] = NULL;
        _Hbasis[i] = NULL;
      }
    
      int lastCols = 0;
      for(int dim = 0; dim < 4; dim++){
        unsigned int cols = cellComplex->getSize(dim);
        unsigned int rows = 0;
    
        int index = 1;
        // ignore cells depending on domain
        for(CellComplex::citer cit = cellComplex->firstCell(dim);
    	cit != cellComplex->lastCell(dim); cit++){
          Cell* cell = *cit;
          cols--;
          if((domain == 0 && !cell->inSubdomain()) || domain == 1
    	 || (domain == 2 && cell->inSubdomain()) ){
            cols++;
            _cellIndices[dim][cell] = index;
            index++;
          }
          else _cellIndices[dim][cell] = 0;
        }
    
        if(dim > 0) rows = lastCols;
        lastCols = cols;
    
        if(cols == 0){ // no dim-cells, no map
          _HMatrix[dim] = NULL;
        }
        else if(rows == 0){ // no dim-1-cells, maps everything to zero
          _HMatrix[dim] = create_gmp_matrix_zero(1, cols);
        }
        else{
          mpz_t elem;
          mpz_init(elem);
          _HMatrix[dim] = create_gmp_matrix_zero(rows, cols);
          for( std::set<Cell*, Less_Cell>::iterator cit =
    	     cellComplex->firstCell(dim);
    	   cit != cellComplex->lastCell(dim); cit++){
            Cell* cell = *cit;
            if( (domain == 0 && !cell->inSubdomain()) || domain == 1
    	    || (domain == 2 && cell->inSubdomain()) ){
              for(Cell::biter it = cell->firstBoundary();
    	      it != cell->lastBoundary(); it++){
                Cell* bdCell = it->first;
    	    if(it->second.get() == 0) continue;
                if((domain == 0 && !bdCell->inSubdomain()) || domain == 1