Skip to content
Snippets Groups Projects
Select Git revision
  • 1da70a8bb99b3a1a5a66fe64b67b43976c455246
  • master default protected
  • hierarchical-basis
  • alphashapes
  • bl
  • relaying
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • 3023-Fillet2D-Update
  • convert_fdivs
  • tmp_jcjc24
  • fixedMeshIF
  • save_edges
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

statisticsWindow.cpp

Blame
  • 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