Skip to content
Snippets Groups Projects
Select Git revision
  • e4c8f816819076455bd2c854fca272550b3e6e04
  • master default protected
  • dof-renumbering
  • test-dof-hash
  • gdemesy-master-patch-30528
  • eval-space-time
  • oscillating_multiharm
  • MH_movement
  • axisqu
  • write_vtu_and_ensight_formats
  • movingband
  • CP_1972_add_vtu_file_writing
  • mortar
  • fast_freq_sweep_Resolution
  • applyresolvent_again
  • marteaua-master-patch-54323
  • patch-1
  • binde-master-patch-08072
  • binde-master-patch-52461
  • BCGSL
  • resolvent
  • getdp_3_5_0
  • getdp_3_4_0
  • getdp_3_3_0
  • getdp_3_2_0
  • getdp_3_1_0
  • getdp_3_0_4
  • getdp_3_0_3
  • getdp_3_0_2
  • getdp_3_0_1
  • getdp_3_0_0
  • onelab_mobile_2.1.0
  • getdp_2_11_3 protected
  • getdp_2_11_2 protected
  • getdp_2_11_1 protected
  • getdp_2_11_0 protected
  • getdp_2_10_0 protected
  • getdp_2_9_2 protected
  • getdp_2_9_1 protected
  • getdp_2_9_0 protected
  • getdp_2_8_0 protected
41 results

Cal_AssembleTerm.cpp

Blame
  • gmshRegion.cpp 1.97 KiB
    // Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
    
    #include <stdlib.h>
    #include "GModel.h"
    #include "gmshRegion.h"
    #include "Geo.h"
    #include "GmshMessage.h"
    
    gmshRegion::gmshRegion(GModel *m, ::Volume *volume) : GRegion(m, volume->Num)
    {
      resetNativePtr(volume);
      resetMeshAttributes();
    }
    
    void gmshRegion::resetNativePtr(::Volume *volume)
    {
      v = volume;
      l_faces.clear();
      l_dirs.clear();
      for(int i = 0; i < List_Nbr(v->Surfaces); i++) {
        Surface *s;
        List_Read(v->Surfaces, i, &s);
        int ori;
        List_Read(v->SurfacesOrientations, i, &ori);
        GFace *f = model()->getFaceByTag(abs(s->Num));
        if(f) {
          l_faces.push_back(f);
          l_dirs.push_back(ori);
          f->addRegion(this);
        }
        else
          Msg::Error("Unknown surface %d", s->Num);
      }
      for(int i = 0; i < List_Nbr(v->SurfacesByTag); i++) {
        int is;
        List_Read(v->SurfacesByTag, i, &is);
        GFace *f = model()->getFaceByTag(abs(is));
        if(f) {
          l_faces.push_back(f);
          l_dirs.push_back(gmsh_sign(is));
          f->addRegion(this);
        }
        else
          Msg::Error("Unknown surface %d", is);
      }
    }
    
    void gmshRegion::resetMeshAttributes()
    {
      meshAttributes.recombine3D = v->Recombine3D;
      meshAttributes.method = v->Method;
      meshAttributes.QuadTri = v->QuadTri;
      meshAttributes.extrude = v->Extrude;
      if(meshAttributes.method == MESH_TRANSFINITE) {
        meshAttributes.corners.clear();
        for(int i = 0; i < List_Nbr(v->TrsfPoints); i++) {
          Vertex *corn;
          List_Read(v->TrsfPoints, i, &corn);
          GVertex *gv = model()->getVertexByTag(corn->Num);
          if(gv)
            meshAttributes.corners.push_back(gv);
          else
            Msg::Error("Unknown vertex %d in transfinite attributes", corn->Num);
        }
      }
    }
    
    GEntity::GeomType gmshRegion::geomType() const
    {
      switch(v->Typ) {
      case MSH_VOLUME_DISCRETE: return DiscreteVolume;
      default: return Volume;
      }
    }