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

orthogonalBasis.cpp

Blame
  • OnelabParser.cpp 52.18 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 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, false);
    	    if(rhost.compare("localhost")){
    	      OLMsg::SetOnelabString(name + "/HostName", rhost, false);
    	      if(rdir.size())
    		OLMsg::SetOnelabString(name + "/RemoteDir", rdir, false);
    	    }
    	    //std::cout << "FHF found cmdl: " << cmdl << "," << rhost << std::endl;
    	    return true;
    	  }
    	}
          }
        }
      }
      infile.close();
      return false;
    }