Skip to content
Snippets Groups Projects
Select Git revision
  • 759f7cfc73ef61a371fcfbe856d3681298df1576
  • master default protected
  • pluginMeshQuality
  • fixBugsAmaury
  • 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
  • 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

MallocUtils.cpp

Blame
  • Field.cpp 62.06 KiB
    // Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    //
    // Contributor(s):
    //   Jonathan Lambrechts
    //
    
    #include <stdlib.h>
    #include <list>
    #include <math.h>
    #include <fstream>
    #include <string>
    #include <string.h>
    #include <sstream>
    #include "GmshConfig.h"
    #include "Context.h"
    #include "Field.h"
    #include "GeoInterpolation.h"
    #include "GModel.h"
    #include "GmshMessage.h"
    #include "Numeric.h"
    #include "mathEvaluator.h"
    #include "BackgroundMesh.h"
    
    #if defined(HAVE_POST)
    #include "OctreePost.h"
    #include "PViewDataList.h"
    #include "MVertex.h"
    #endif
    
    #if defined(HAVE_ANN)
    #include "ANN/ANN.h"
    #endif
    
    class FieldOptionDouble : public FieldOption
    {
     public:
      double &val;
      FieldOptionType getType(){ return FIELD_OPTION_DOUBLE; }
      FieldOptionDouble(double &_val, std::string _help, bool *_status=0)
        : FieldOption(_help, _status), val(_val){}
      double numericalValue() const { return val; }
      void numericalValue(double v){ modified(); val = v; }
      void getTextRepresentation(std::string &v_str)
      {
        std::ostringstream sstream;
        sstream.precision(16);
        sstream << val;
        v_str = sstream.str();
      }
    };
    
    class FieldOptionInt : public FieldOption
    {
     public:
      int &val;
      FieldOptionType getType(){ return FIELD_OPTION_INT; }
      FieldOptionInt(int &_val, std::string _help, bool *_status=0) 
        : FieldOption(_help, _status), val(_val){}
      double numericalValue() const { return val; }
      void numericalValue(double v){ modified(); val = (int)v; }
      void getTextRepresentation(std::string & v_str)
      {
        std::ostringstream sstream;
        sstream << val;
        v_str = sstream.str();
      }
    };