Jump to content
b.fabritius

General: Changing the default decimal point character

Recommended Posts

Hello all,


 


how can I change the character used to represent the decimal point in acuConsole? The problem is, for example, when I run Generate Mesh from acuConsole and create the files in CAD.DIR, the non-manifold model file is created, but all coordinates in there use a comma "," as decimal point symbol. Starting acuMeshSim afterwards leads to an error:


acuMeshSim: <SIMM_ERR_MSG>:Code: 104 String: Bad data encountered in file unknown


 


When I manually change all the commas to points in the .smd file, I get a non-matching checksum error (obviously).


 


Anyone had that problem or know how to solve it? I am running under Linux (english).


 


Thanks,


Bjoern


Share this post


Link to post
Share on other sites

Hi Bjoern,


 


     The data present in the CAD.DIR is written by AcuConsole and is in the native CAD kernel's format (i.e. Parasolid, ACIS, etc.) so you should never have a need to modify that.  It sounds like that file either isn't being written properly, or there are non-english characters in the filename or file itself that are causing a problem.  Can you post the full log file from AcuMeshSim as well as the full .ams file?  That may help to identify the problem better.


Share this post


Link to post
Share on other sites

Thanks for the reply. I've attached the log-file as well as my .ams and .smd file (where the commas are. I also had to add a txt extension to fool the uploader). I am running the W1_Demo_Pipe_Flow case, following the instructions from the accompanying pdf.


 


To prove my theory: When I tried the W6_Flow_Over_Rigid_Cylinder I encountered a similar problem. In that case, though, the corrupt file was rigid1.crd and I was able to run the case by manually replacing all , by . in that file.


 


If the underlying Python program to read/write the files uses the locale module, could it make a difference, that our licence server has a german linux installation (using , as a dec point)? just guessing here.


 


EDIT: I checked with our admin. The locale on both the licence server and the machine I'm running acuConsole on is "en_US.UTF-8"


 


Any help is appreciated.


 


Thanks,


 Bjoern


demo.2.MeshSim.txt

demo.ams.txt

pipenm.smd.txt

Share this post


Link to post
Share on other sites

This is really odd.  I am guessing it is picking up something from your locale settings as you mentioned.  All of the file I/O is handled by python wrapped C functions, so I am not sure how the locale settings would be making their way into those functions.  Please post the output of the following command (executed on the local machine that you are running acuConsole on):

$> locale

 

That may give us some more hints.

Share this post


Link to post
Share on other sites

I've been fiddling with these settings, but even using "export LC_ALL="en_US.UTF-8" does not change anything. Nevertheless, here is the output from locale:



$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Share this post


Link to post
Share on other sites

OK.  These settings should be sufficient to force the decimals to be written.  Can you try another test?  Unpack the attached zip file, then execute "acuPrep" from within the channel directory.  Once it completes, have a look at ACUSIM.DIR/channel.0.slv.  See if this contains commas or periods for the decimals.


channel.zip

Share this post


Link to post
Share on other sites

Ok.  Thanks for doing the test.  This narrows the problem down.  acuPrep's file I/O functions are direct C calls whereas acuConsole's I/O relies on a python wrapper to the C functions.


 


Are you seeing this on any other systems or just this one machine?

Share this post


Link to post
Share on other sites

I am currently running tests on a completely different system (different linux distro, different licence server, different network). So far I am running into the same problems.


 


I found a solution, yet not the cause of the problem: If I change the locale settings by



export LC_ALL=en_US.UTF-8

first thing after logging into the machine, it works. As soon as I do anything Acusolve related, it breaks. Even when changing the locale afterwards. Maybe there is a problem in acusim.sh?


If I can help in any way by running more tests, please let me know. I am just starting to use the software and I would like to see it working ;)


Share this post


Link to post
Share on other sites

Can you tell me the exact steps that produce a successful result (i.e. log-in, open terminal, launch AcuConsole using the full path, etc.)?  Then let me know what steps cause the failure (log-in, open terminal, source acusim.sh, launch AcuConsole, etc.)?  Do you have any references to locale settings in your .login or .bashrc files?  Also, are you sourcing the acusim.sh file in your .login or .bashrc files?


 


Lastly, what Linux distro and desktop environment are you running?

Share this post


Link to post
Share on other sites

Here is what DOES NOT work:

 

- log in to new terminal

- locales:

LANG=en_US.UTF-8LANGUAGE=en_USLC_CTYPE="en_US.UTF-8"LC_NUMERIC=de_DE.UTF-8LC_TIME=de_DE.UTF-8LC_COLLATE="en_US.UTF-8"LC_MONETARY=de_DE.UTF-8LC_MESSAGES="en_US.UTF-8"LC_PAPER=de_DE.UTF-8LC_NAME=de_DE.UTF-8LC_ADDRESS=de_DE.UTF-8LC_TELEPHONE=de_DE.UTF-8LC_MEASUREMENT=de_DE.UTF-8LC_IDENTIFICATION=de_DE.UTF-8LC_ALL=

- go to <INSTALL_DIR>/acusolve/linux64/examples/pipe:

1 - start acuConsole

2 - open pipe.acs

3 - Tools -> Generate Mesh

=> acuMeshSim: <SIMM_ERR_MSG>:Code: 104 String: Bad data encountered in file unknown
 

 

Here is what WORKS:

- log in to new terminal

- export LC_NUMERIC=en_US.UTF-8

1 - start acuConsole

2 - open pipe.acs

3 - Tools -> Generate Mesh

 

I've now added the appropriate line to ~/.profile . Note that I never manually sourced acusim.sh at this point

 

The systems I tried this on were my desktop machine with Ubuntu 13.10 Kernel 3.11.0-17-generic, and our HPC cluster with SUSE Linux Enterprise Server 11 and Kernel version 3.0.101-0.7.15-default

 

Thanks for your help!

Bjoern

Share this post


Link to post
Share on other sites

Ahhh....ok.  I see what is happening.  The only solution I can come up with for now is exactly what you are doing (i.e. set LC_NUMERIC=en_US.UTF-8 in your ~/.profile).


 


I was able to reproduce the behavior by setting my LC_NUMERIC=de_DE.UTF-8.  I'll look into this further to see if we can figure out why python is picking up the locale.  To the best of my knowledge, it shouldn't be.


 


Thanks for reporting this and sorry for the hassle!


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...