Skip to content
Snippets Groups Projects
Select Git revision
  • 1da70a8bb99b3a1a5a66fe64b67b43976c455246
  • master default protected
  • overlaps_tags_and_distributed_export
  • overlaps_tags_and_distributed_export_rebased
  • relaying
  • alphashapes
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 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

GModelVertexArrays.cpp

Blame
  • Operation_Vector.cpp 5.60 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>.
    
    #include <map>
    #include <string>
    #include <vector>
    #include "ProData.h"
    #include "ProParser.h"
    #include "DofData.h"
    #include "Message.h"
    
    /* TODO:
    
          Copy[ x() , y() ];
          Copy[ "x" , "y" ];
          Copy[ "x" , y() ];
          Copy[ x() , "y" ];
          AXPY[ a, x() , y() ]; // urgent
          AXPY[ a , "x", "y" ];// urgent
          Norm2[ x(), $nrm2 ]; // urgent
          Norm2[ "x", $nrm2 ];
          Dot[ "x", "y", $dot ];
          Dot[ x(), y(), $dot ]; // urgent
    
    +
    
    1) clarify "from" and "to" in Operation_P->Case.Copy
    2) change "Operation_CopyVector" -> "Operation_CopySystemVector"
    
    */
    
    void Operation_CopyVector(struct Operation *Operation_P,
                              struct DofData *DofData_P)
    {
      // this global map is never freed for now
      static std::map<std::string, gVector> vectorMap;
    
      gVector *from = 0, *to = 0, tmp;
    
      if(Operation_P->Case.Copy.useList)
        LinAlg_CreateVector(&tmp, &DofData_P->Solver, DofData_P->NbrDof) ;
    
      if(Operation_P->Type == OPERATION_COPYSOLUTION){
        if(DofData_P->CurrentSolution){
          if(Operation_P->Case.Copy.from)
            to = &DofData_P->CurrentSolution->x;
          else
            from = &DofData_P->CurrentSolution->x;
        }
        else
          Message::Error("No current solution available to copy");
      }
      else if(Operation_P->Type == OPERATION_COPYRHS){
        if(Operation_P->Case.Copy.from)
          to = &DofData_P->b;
        else
          from = &DofData_P->b;
      }
      else if(Operation_P->Type == OPERATION_COPYRESIDUAL){
        if(Operation_P->Case.Copy.from)
          to = &DofData_P->res;
        else
          from = &DofData_P->res;
      }
      else if(Operation_P->Type == OPERATION_COPYINCREMENT){
        if(Operation_P->Case.Copy.from)
          to = &DofData_P->dx;
        else