Skip to content
Snippets Groups Projects
Select Git revision
  • fb3251cd5f312f9512fff4ada6ad60f02b1a0c0a
  • 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

Views.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    gmshTermOfFormulation.cpp 2.77 KiB
    // Gmsh - Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    
    #include "Gmsh.h"
    #include "GModel.h"
    #include "MElement.h"
    #include "GmshMatrix.h"
    #include "gmshTermOfFormulation.h"
    #include "gmshFunction.h"
    #include "gmshLinearSystem.h"
    #include "gmshAssembler.h"
    
    gmshNodalFemTerm::~gmshNodalFemTerm ()
    {
    }
    
    void gmshNodalFemTerm::addDirichlet(int physical, 
    				    int dim, 
    				    int comp, 
    				    int field, 
    				    const gmshFunction & e,
    				    gmshAssembler &lsys)
    {
    }
    
    void gmshNodalFemTerm::addNeumann(int physical, 
    				  int dim, 
    				  int comp, 
    				  int field, 
    				  const gmshFunction & fct, 
    				  gmshAssembler &lsys)
    {
    }
    
    void gmshNodalFemTerm::addToMatrix(gmshAssembler &lsys) const
    {
      if (_gm->getNumRegions()){
        for(GModel::riter it = _gm->firstRegion(); it != _gm->lastRegion(); ++it){
          addToMatrix(lsys, *it);
        }
      }
      else if(_gm->getNumFaces()){
        for(GModel::fiter it = _gm->firstFace(); it != _gm->lastFace(); ++it){
          addToMatrix(lsys, *it);
        }
      }  
    }
    
    void gmshNodalFemTerm::addToMatrix(gmshAssembler &lsys,const std::vector<MElement*> &v) const
    {
      for (unsigned int i = 0; i < v.size(); i++)
        addToMatrix(lsys, v[i]);
    }
    
    void gmshNodalFemTerm::addToMatrix(gmshAssembler &lsys, 
                                       Double_Matrix &localMatrix, 
                                       MElement *e) const
    {
      const int nbR = sizeOfR(e);
      const int nbC = sizeOfC(e);
      for (int j = 0; j < nbR; j++){
        MVertex *vR;int iCompR,iFieldR;
        getLocalDofR (e, j, &vR, &iCompR, &iFieldR);
        for (int k = 0; k < nbC; k++){
          MVertex *vC;
          int iCompC, iFieldC;
          getLocalDofC(e, k, &vC, &iCompC, &iFieldC);
          lsys.assemble(vR, iCompR, iFieldR,
    		    vC, iCompC, iFieldC,
    		    localMatrix(j, k));
        }
      }
    }
    
    void gmshNodalFemTerm::addToMatrix(gmshAssembler &lsys, MElement *e) const
    {
      const int nbR = sizeOfR(e);
      const int nbC = sizeOfC(e);
      Double_Matrix localMatrix (nbR, nbC);
      elementMatrix(e, localMatrix);
      addToMatrix(lsys, localMatrix, e);
    }
    
    void gmshNodalFemTerm::addToMatrix(gmshAssembler &lsys, GEntity *ge) const
    {
      for(unsigned int i = 0; i < ge->getNumMeshElements(); i++){
        MElement *e = ge->getMeshElement(i);
        addToMatrix(lsys, e);
      }
    }
    
    void gmshNodalFemTerm::addToRightHandSide(gmshAssembler &lsys) const
    {
      if (_gm->getNumRegions()){
        for(GModel::riter it = _gm->firstRegion(); it != _gm->lastRegion(); ++it){
          addToRightHandSide(lsys, *it);
        }
      }
      else if(_gm->getNumFaces()){
        for(GModel::fiter it = _gm->firstFace(); it != _gm->lastFace(); ++it){
          addToRightHandSide(lsys, *it);
        }
      }  
    }
    
    void gmshNodalFemTerm::addToRightHandSide(gmshAssembler &lsys, GEntity *ge) const
    {
      throw;
    }