Skip to content
Snippets Groups Projects
Commit 008574dd authored by Francois Henrotte's avatar Francois Henrotte
Browse files

corrections

parent 0b5ecde4
No related branches found
No related tags found
No related merge requests found
......@@ -395,8 +395,16 @@ bool gmshLocalNetworkClient::receiveMessage(gmshLocalNetworkClient *master)
master->addClient(subClient);
}
}
else
Msg::Error("Redefinition of existing client <%s>",clientName.c_str());
else{
std::string reply = "";
for(onelab::server::citer it = onelab::server::instance()->firstClient();
it != onelab::server::instance()->lastClient(); it++){
reply.append(it->second->getName() + " ");
}
Msg::Error("Skipping already existing client < %s> - Registered clients are <%s>",clientName.c_str(),reply.c_str());
getGmshServer()->SendMessage
(GmshSocket::GMSH_STOP, reply.size(), &reply[0]); // reply is dummy
}
}
break;
case GmshSocket::GMSH_OLPARSE:
......@@ -411,8 +419,9 @@ bool gmshLocalNetworkClient::receiveMessage(gmshLocalNetworkClient *master)
Msg::Info("Preprocess file <%s> done", fullName.c_str());
reply = onelab::server::instance()->getChanged(clientName) ? "true" : "false";
}
else
Msg::Error("Redefinition of existing client <%s>",clientName.c_str());
else{
Msg::Error("Skipping client with already existing name <%s>",clientName.c_str());
}
#endif
getGmshServer()->SendMessage
(GmshSocket::GMSH_OLPARSE, reply.size(), &reply[0]);
......@@ -424,8 +433,7 @@ bool gmshLocalNetworkClient::receiveMessage(gmshLocalNetworkClient *master)
std::string command = onelab::parameter::getNextToken(message, first);
std::string name = onelab::parameter::getNextToken(message, first);
if(command == "get"){
std::string reply = onelab::server::instance()->getChanged(name) ?
"true" : "false";
std::string reply = onelab::server::instance()->getChanged(name) ? "true" : "false";
getGmshServer()->SendMessage
(GmshSocket::GMSH_CLIENT_CHANGED, reply.size(), &reply[0]);
}
......
......@@ -39,7 +39,7 @@ def file_exist(filename):
def path(dirname, inp):
# dirname is a directory, can be empty
# inp is an aptional file or subdirectory name
# inp is an optional file or subdirectory name
# returns the path to 'inp' in the same directory as 'ref'
if not inp:
return dirname
......
......@@ -10,14 +10,14 @@ import math, os
c = onelab.client(__file__)
def exportMsh(le1,le2):
mshFile = open(c.cpath("pend.msh"),'w')
mshFile = open(c.checkPath("pend.msh"), 'w')
mshFile.write('$MeshFormat\n2.2 0 8\n$EndMeshFormat\n')
mshFile.write('$Nodes\n3\n1 0 0 0\n2 0 %s 0\n3 0 %s 0\n$EndNodes\n' %(-le1, -le1-le2))
mshFile.write('$Elements\n3\n1 1 2 0 1 1 2\n2 1 2 0 1 2 3\n3 15 2 0 2 3\n$EndElements\n')
mshFile.close()
def exportMshOpt():
optFile = open(c.cpath("pend.msh.opt"),'w')
optFile = open(c.checkPath("pend.msh.opt"),'w')
optFile.write('n = PostProcessing.NbViews - 1;\n')
optFile.write('If(n >= 0)\nView[n].ShowScale = 0;\nView[n].VectorType = 5;\n')
optFile.write('View[n].ExternalView = 0;\nView[n].DisplacementFactor = 1 ;\n')
......@@ -26,7 +26,7 @@ def exportMshOpt():
optFile.close()
def exportIter(iter,t,x1,y1,x2,y2):
mshFile = open(c.cpath("pend.msh"),'a')
mshFile = open(c.checkPath("pend.msh"),'a')
mshFile.write('$NodeData\n1\n"motion"\n1\n\t%f\n3\n\t%d\n3\n' % (t, iter))
mshFile.write('\t3\n\t1 0 0 0\n\t2 %f %f 0\n\t3 %f %f 0\n$EndNodeData\n' %(x1,y1,x2,y2))
mshFile.close()
......@@ -114,7 +114,7 @@ while (time < tmax):
exportMsh(l1, l2)
exportIter(iter, time, x1, y1+l1, x2, y2+l1+l2)
c.mergeFile(c.cpath('pend.msh'))
c.mergeFile(c.checkPath('pend.msh'))
iter += 1
c.setNumber(c.name + '/Progress', value=0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment