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

GF_LaplacexForm.cpp

Blame
  • GF_LaplacexForm.cpp 24.18 KiB
    // GetDP - Copyright (C) 1997-2018 P. Dular and C. Geuzaine, University of Liege
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to the public mailing list <getdp@onelab.info>.
    //
    // Contributor(s):
    //   Ruth Sabariego
    //
    
    #include <math.h>
    #include "ProData.h"
    #include "ProDefine.h"
    #include "BF.h"
    #include "GF.h"
    #include "GeoData.h"
    #include "Message.h"
    
    #define SQU(a)     ((a)*(a)) 
    #define THESIGN(a) ((a)>=0 ? 1 : -1)
    #define ONE_OVER_TWO_PI    1.5915494309189534E-01
    #define ONE_OVER_FOUR_PI   7.9577471545947668E-02
    
    #define MAX_NODES        6 
    #define EPSILON          1.e-8
    #define EPSILON2         1.e-20
    #define RADIUS           0.154797  /* this is a hack... */
    
    /* ------------------------------------------------------------------------ */
    /*  G F _ L a p l a c e x F o r m                                           */
    /* ------------------------------------------------------------------------ */
    
    void GF_LaplacexForm(GF_ARGX)
    {
      double   xs[MAX_NODES], ys[MAX_NODES], zs[MAX_NODES], u[3], v[3], n[3];
      double   u2=0., v2=0., xl=0., yl=0., zl=0., zl_2=0. ;
      double   Area, m0[3], m1[3], m2[3] ;
      int      Type_Int=0, i, j = 1 ;
      double   a=0., b=0., c=0., d, e, f, i1, I1 = 0., Iua, Iva, r2;
      double   s0m=0., s0p=0., s1m=0., s1p=0., s2m=0., s2p=0., t00, t10, t20, t0m_2, t0p_2, t1p_2;
      double   r00_2=0., r10_2=0., r20_2=0., r00, r10, r20, r0p=0., r0m=0., r1p=0.;
      double   f20=0., f21=0., f22=0., B0, B1, B2 ;
      double   f30, f31, f32, N10, N20, N30 ;
    
      Val->Val[MAX_DIM] = 0.0 ;
      
      switch ((int)Fct->Para[0]) {
        
      case _2D : 
        
        switch (Element->ElementSource->Type) {
          
        case POINT :      
          xs[0] = Element->ElementSource->x[0] ; ys[0] = Element->ElementSource->y[0] ;
    
          r2 = SQU(x-xs[0])+SQU(y-ys[0]) ;
          if (r2 > SQU(RADIUS)){
    	Val->Type = SCALAR ;
    	Val->Val[0] = - ONE_OVER_FOUR_PI * log(r2) ;
          }
          else{
    	Val->Type = SCALAR ;
    	Val->Val[0] = - ONE_OVER_FOUR_PI * log(SQU(RADIUS)) ;
          }
          break ;
         
        case LINE :
          xs[0] = Element->ElementSource->x[0] ; ys[0] = Element->ElementSource->y[0] ;
          xs[1] = Element->ElementSource->x[1] ; ys[1] = Element->ElementSource->y[1] ;
          
          if(xFunctionBF == (void(*)())BF_Volume) {