Skip to content
Snippets Groups Projects
Select Git revision
  • a62f61c77d29a2cea9d701ca05d51b4e93c21c9d
  • master default protected
  • alphashapes
  • quadMeshingTools
  • cygwin_conv_path
  • macos_arm64
  • add-transfiniteautomatic-to-geo
  • patch_releases_4_10
  • HierarchicalHDiv
  • isuruf-master-patch-63355
  • hyperbolic
  • hexdom
  • hxt_update
  • jf
  • 1618-pythonocc-and-gmsh-api-integration
  • octreeSizeField
  • hexbl
  • alignIrregularVertices
  • getEdges
  • patch_releases_4_8
  • isuruf-master-patch-51992
  • 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
  • gmsh_4_8_4
  • gmsh_4_8_3
  • gmsh_4_8_2
  • gmsh_4_8_1
  • gmsh_4_8_0
  • gmsh_4_7_1
  • gmsh_4_7_0
41 results

linearSystemPETSc.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    OnelabParser.cpp 52.26 KiB
    #include "OnelabClients.h"
    #include <algorithm>
    #include "mathex.h"
    
    // reserved keywords for the onelab parser
    
    namespace olkey{ 
      static std::string deflabel("onelab.tags");
      static std::string label("OL."), comment("#"), separator(";");
      static std::string line(label+"line");
      static std::string begin(label+"block");
      static std::string end(label+"endblock");
      static std::string include(label+"include");
      static std::string loader(label+"loaderName");
      static std::string message(label+"msg");
      static std::string showParam(label+"show");
      static std::string showGmsh(label+"merge");
      static std::string dump(label+"dump");
      static std::string ifcond(label+"if");
      static std::string iftrue(label+"iftrue"), ifntrue(label+"ifntrue");
      static std::string olelse(label+"else"), olendif(label+"endif");
      static std::string getValue(label+"get");
      static std::string mathex(label+"eval");
      static std::string getRegion(label+"region");
    }
    
    // Client member functions defined here because they use parser commands 
    
    bool MetaModel::findCommandLine(const std::string &client, const std::string &host){
      std::string fileName;
      size_t pos;
    
      //std::cout << "FHF search cmdl: " << client << " , " << host << std::endl; 
    
      fileName = getWorkingDir() + genericNameFromArgs + onelabExtension + ".save";
    
      std::ifstream infile(fileName.c_str());
      if(infile.is_open()){
        while(infile.good()){
          std::string line;
          getline(infile,line);
          if( (pos=line.find(olkey::separator)) != std::string::npos){
    	std::string name, action;
    	std::vector<std::string> args;
    	extract(line.substr(0,pos),name,action,args);
    	// (name, action, args) = client.commandLine(cmdl{,rhost{,rdir}})
    	std::string cmdl="", rhost="localhost", rdir="";
    	cmdl = args[0];
    	if(args.size() > 1) rhost= args[1]; 
    	if(args.size() > 2) rdir = args[2];
    
    	if(name == client){
    	  if( (host.empty() && (rhost != "localhost" )) ||
    	      (host.size() && (rhost == host)) ) {
    	    OLMsg::SetOnelabString(name + "/CommandLine", cmdl);
    	    if(rhost.compare("localhost")){
    	      OLMsg::SetOnelabString(name + "/HostName", rhost);
    	      if(rdir.size())
    		OLMsg::SetOnelabString(name + "/RemoteDir", rdir);
    	    }
    	    //std::cout << "FHF found cmdl: " << cmdl << "," << rhost << std::endl;
    	    return true;
    	  }
    	}
          }
        }
      }
      infile.close();
      return false;
    }