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

Scal2Vec.cpp

Blame
  • Cal_AssembleTerm.cpp 31.15 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):
    //   Johan Gyselinck
    //
    
    #include "ProData.h"
    #include "DofData.h"
    #include "Message.h"
    #include <math.h>
    
    #define SQU(a)     ((a)*(a))
    
    extern struct CurrentData Current ;
    
    static int Warning_Dt = 0, Warning_DtStatic = 0 ;
    static int Warning_DtDt = 0, Warning_DtDtStatic = 0, Warning_DtDtFirstOrder = 0 ;
    
    /* ------------------------------------------------------------------------ */
    /*  No Time Derivative                                                      */
    /* ------------------------------------------------------------------------ */
    
    void Cal_AssembleTerm_NoDt(struct Dof * Equ, struct Dof * Dof, double Val[])
    {
      int     k ;
      double  tmp[2] ;
    
      if(Current.TypeAssembly == ASSEMBLY_SEPARATE){
        if (!Current.DofData->Flag_Init[1]) {
          Current.DofData->Flag_Init[1] = 1 ;
          LinAlg_CreateMatrix(&Current.DofData->M1, &Current.DofData->Solver,
    			  Current.DofData->NbrDof, Current.DofData->NbrDof) ;
          LinAlg_CreateVector(&Current.DofData->m1, &Current.DofData->Solver,
    			  Current.DofData->NbrDof) ;
          LinAlg_ZeroMatrix(&Current.DofData->M1);
          LinAlg_ZeroVector(&Current.DofData->m1);
          Current.DofData->m1s = List_Create(10, 10, sizeof(gVector));
          for(int i = 0; i < List_Nbr(Current.DofData->TimeFunctionIndex); i++){
            gVector m;
            LinAlg_CreateVector(&m, &Current.DofData->Solver,
                                Current.DofData->NbrDof) ;
            LinAlg_ZeroVector(&m);
            List_Add(Current.DofData->m1s, &m);
          }
        }
        for (k = 0 ; k < Current.NbrHar ; k += 2){
          int incr = (gSCALAR_SIZE == 2) ? k / 2 : k;
          Dof_AssembleInMat(Equ + incr, Dof + incr, Current.NbrHar, &Val[k],
    			&Current.DofData->M1, &Current.DofData->m1,
                            Current.DofData->m1s) ;
        }
      }
      else {
        if (Current.NbrHar == 1) {
          switch (Current.TypeTime) {
          case TIME_STATIC :
    	Dof_AssembleInMat(Equ, Dof, Current.NbrHar, &Val[0],
    			  &Current.DofData->A, &Current.DofData->b) ;
    	break ;
          case TIME_THETA :
    	tmp[0] = Val[0]*Current.Theta ;
    	Dof_AssembleInMat(Equ, Dof, Current.NbrHar, tmp,
    			  &Current.DofData->A, &Current.DofData->b) ;
    	tmp[0] = Val[0]*(Current.Theta-1.) ;
    	Dof_AssembleInVec(Equ, Dof, Current.NbrHar, tmp,
    			  Current.DofData->CurrentSolution-1,
    			  &(Current.DofData->CurrentSolution-1)->x,