Saturday, November 2, 2013

Abaqus.rpy - Human readable writing

In Abaqus.rpy file, the commands performed in the CAE are recorded. But sometimes the transcription is not easily understandable, like:
faces1 = f1.getSequenceFromMask(mask=('[#50 ]', ), )
which could be expressed as well by:
faces1 = f1.findAt(((0.0, 3.0, 1.0), ), ((0.0, 3.0, 3.0), ))

To force the transcription in the 2nd format, one should execute the command:
session.journalOptions.setValues(replayGeometry=COORDINATE,recoverGeometry=COORDINATE)

Saturday, October 26, 2013

Tuesday, March 19, 2013

[Abaqus] job options

A list of possible options and their values may be found in the .com file:

options = {
    'ams':OFF,
    'analysisType':STANDARD,
    'applicationName':'analysis',
    'aqua':OFF,
    'ask_delete':OFF,
    'background':None,
    'beamSectGen':OFF,
    'biorid':OFF,
    'complexFrequency':OFF,
    'contact':OFF,
    'cosimulation':OFF,
    'coupledProcedure':OFF,
    'cpus':6,
    'cse':OFF,
    'cyclicSymmetryModel':OFF,
    'directCyclic':OFF,
    'direct_port':'XXX',
    'direct_solver':DMP,
    'domains':'6',
    'dsa':OFF,
    'dynamic':OFF,
    'filPrt':[],
    'fils':[],
    'finitesliding':OFF,
    'foundation':ON,
    'geostatic':OFF,
    'heatTransfer':OFF,
    'importer':OFF,
    'importerParts':OFF,
    'includes':[],
    'initialConditionsFile':OFF,
    'input':'D:\\TEMP\\Abaqus\\XXX',
    'job':'XXX',
    'lanczos':OFF,
    'libs':[],
    'listener_name':'XXX',
    'listener_resource':'XXX',
    'massDiffusion':OFF,
    'memory':'13GB',
    'message':None,
    'messaging_mechanism':'DIRECT',
    'moldflowFiles':[],
    'moldflowMaterial':OFF,
    'mp_file_system':(DETECT, DETECT),
    'mp_head_node':('XXX',),
    'mp_host_list':(('XXX', 6),),
    'mp_mode':MPI,
    'mp_mode_requested':MPI,
    'mp_mpi_validate':OFF,
    'mp_mpirun_path':'C:\\Program Files\\Microsoft HPC Pack 2008\\Bin\\mpiexec.EXE',
    'mp_rsh_command':'dummy %H -l user1 -n %C',
    'multiphysics':OFF,
    'noDmpDirect':[],
    'noMultiHost':[],
    'no_domain_check':ON,
    'outputKeywords':ON,
    'parameterized':OFF,
    'partsAndAssemblies':ON,
    'parval':OFF,
    'postOutput':OFF,
    'publicSim':OFF,
    'restart':OFF,
    'restartEndStep':OFF,
    'restartIncrement':0,
    'restartStep':0,
    'restartWrite':OFF,
    'rezone':OFF,
    'runCalculator':OFF,
    'soils':OFF,
    'soliter':OFF,
    'solverTypes':['DIRECT'],
    'standard_parallel':ALL,
    'staticNonlinear':OFF,
    'steadyStateTransport':OFF,
    'step':ON,
    'subGen':OFF,
    'subGenLibs':[],
    'subGenTypes':[],
    'submodel':OFF,
    'substrLibDefs':OFF,
    'substructure':OFF,
    'symmetricModelGeneration':OFF,
    'tmpdir':'C:\\Users\\user1\\AppData\\Local\\Temp',
    'tracer':OFF,
    'visco':OFF,
}

Monday, March 18, 2013

[abaqus] automatically overwrite existing files

When a job is launched, Abaqus checks if there are pre-existing files with the same names as those it wants to write. If it's the case, the user is asked whether he wants to overwrite them or not. To overwrite without questions, just have to add "ask_delete=OFF" in the command line.

For instance:
abq6101 job=myJob cpus=8 memory=14GB interactive ask_delete=OFF

Tuesday, February 26, 2013

[windows] Retrieving the IP address of a web server with windows

just have to launch the command window:
cmd /k

and then ping the server:
ping the_server_name.net

Wednesday, January 23, 2013

[Matlab] Dealing with apostrophe ' in strings

Defining a figure title as E' (E prime), the apostrophe ' has to be enterred twice :
title('E''');

Monday, November 19, 2012

[.eps] bitmap -> .eps for several files at once

The automatic conversion of several bitmap files (.png for instance) to their .eps counterparts may be performed very efficiently using a linux OS. Just have to type in a terminal the command "mogrify -format eps *.png" !

Wednesday, October 3, 2012

[PDF] Modification of a .pdf file

The direct edition of the text included in a .pdf file does appear to be straightforward. If the modification only concerns a few words (misprints,...), Inkscape may be used efficiently for that purpose.

Just open the .pdf file and modify the text where you want. This strategy generally works well but somefimes fails for a .pdf generated with MS Word.

Monday, August 27, 2012

[Matlab] fast reading of huge ASCII input files

The following code provides a rather fast way to deal with large ASCII data files containing groups of sub-data with different numbers of columns. For N=1E6 (leading to a ~2 M lines input file), the reading takes ~5 sec while the data reconstruction in matrix form lasts ~55 sec (on a 2012 laptop PC).

% Cleansing
clear all;
clc;

% Input Data
N=1E6;
x = 0:pi/N:pi;
y = [x; cos(x)];            %2 columns
xx= pi:pi/N:2*pi;
yy = [xx;cos(xx);sin(xx)];  %3 columns

% ASCII file writing
fprintf('* writing\n');
tic;
pfile = fopen('data.txt', 'w');
fprintf(pfile, '%12.8f %12.8f\n', y);
fprintf(pfile, '%12.8f %12.8f %12.8f\n', yy);
fclose(pfile);
toc;

% ASCII file reading
fprintf('\n* reading\n');
tic;
pfile=fopen('data.txt');
InputText=textscan(pfile,'%s','delimiter','\n');
fclose(pfile);
NN=length(InputText{1,1});
toc;

% Data matrix creation
fprintf('\n* matrix creation\n');
tic;
A=zeros(NN,3);
for i=1:NN
    line=InputText{1,1}{i,1};
    [str,count] = sscanf(line, '%s');
    if count == 2
        A(i,1:2)= sscanf(line, '%f %f');
    elseif count == 3
        A(i,1:3)= sscanf(line, '%f %f %f');
    end
end
toc;

Friday, June 8, 2012

[Abaqus] launching abaqus in command line

an example handling: the number of cpus involved, the memory allocation, the scratch directory :

abq610 job=MyJob cpus=12 memory=150GB scratch=/home/AbqScratch

Abaqus Finite Element Software:
http://www.simulia.com/

[Linux] permissions modification

When working on a server shared with other users, it seems suitable to restrict the access to personal files/directories.

The use of the command "chmod" can trigger rights for execution (+1), writing (+2) and reading (+4). Three perimeters are considered: the user (1st digit) , the usersgroup (2nd), everybody (3rd).

If one wants to restrict the access to his directory /home/MyRep for himself only, the command is then "chmod -R 700 /home/MyRep".

Ubuntu Linux distribution:
http://www.ubuntu.com/

Tuesday, April 3, 2012

[Abaqus] edition of viewport parameters

if one wants to modify the size/color/font/activation... of the written data displayed in the viewport, that's the place :

viewport/viewport annotation options (CAE 6.10-1)

Abaqus Finite Element Software:
http://www.simulia.com/

Sunday, November 6, 2011

[Maths] Series convergence tests

Usually d'Alembert's ratio test is easier to perform than Cauchy's root test but it is less powerful (-> book Advanced mathematics for applications, Andrea Prosperetti, Cambridge University press).

On Amazon:
http://www.amazon.com/Advanced-Mathematics-Applications-Andrea-Prosperetti/dp/0521735874
On Google Books:
http://books.google.com/books?id=yQejXXN8zdoC

Wednesday, November 2, 2011

[LATEX] Re-installation

A far more tedious task than I remembered...

With a few blocking points:

* Installation of miktex:
configuration of the proxy : proxyweb.xxx.xx + port 3128 (not 8080 for me !!!)

* Compilation issue with an old miktex version :
error message:
! You are attempting to make a LaTeX format from a source file
! That is more than five years old.
solution:
edit \MiKTeX 2.8\tex\latex\base\latex.ltx
and change \ifnum\count@65 to \ifnum\count@165

* TexnicCenter tex=>pdf (with .eps images)
copy the basic tex=>.ps profile and add a postprocessor:
gs\gs9.04\bin\gswin64.exe
-sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="%bm.pdf" -c save pop -f "%bm.ps"

Miktex (Latex for Windows):
http://miktex.org/
Texniccenter (Latex environment for Windows):
http://www.texniccenter.org/
Latex softwares (including the all-in-one solution Protext for Windows)
http://tug.org/texcollection/

Thursday, October 27, 2011

[Abaqus] - Hidding elements' edges

* with the mouse:
view/part display options/show edges in shaded render style

* with python:
session.viewports['Viewport:1'].partDisplay.meshOptions.setValues(meshEdgesInShaded=OFF)

Abaqus Finite Element Software:
http://www.simulia.com/

Thursday, September 15, 2011

[Matlab] Generation of nice and light .eps from matlab figures

*From matlab:
-> generate a bitmap file with a good resolution
hX=figure(X)
...
print(hX,'-dtiffn','-r500','name_of_the_output_file');

*In inkscape (in French !):
-fichier/importer -> name_of_the_output_file.tif
-fichier/propriétés du document -> ajuster la page à la sélection
-define the quadrangle that will be the frame of the final image
-select the imported image and the frame
-object/découpe/définir
-fichier/propriétés du document -> ajuster la page à la sélection
-fichier/save as -> .eps

Matlab:
http://www.mathworks.com/
Inkscape:
http://inkscape.org/

Wednesday, September 14, 2011

[Bibtex] Respecting capital letters in an article title

Just have to change in the .bib file:

title = {Bla Bla Bla},

by

title = {{Bla Bla Bla}},

in order to disable bibtex re-interpretation

Jabref bibliography manager:
http://jabref.sourceforge.net/

Saturday, August 13, 2011

[Fun] Maths Jokes !

* Why do the mathematicians name their dog "Cauchy" ?
Because he leaves a residue at every pole.

* You know what's odd to me ?
Numbers that are not divisible by two.

* A pair of discrete mathematicians are in a field. One asks: "I wonder how many sheeps there are in this field ?"
The second replies: "There are 200."
Astonished, the first asks: "How do you manage to count that fast ?"
"That's simple, I counted the legs and divided by four."

source (in french): Blagues mathématiques et autres curiosités, Bruno Winkler, Editions ellipse.

Tuesday, July 26, 2011

[C/C++] Formatting today's date in C/C++

struct tm Today;
time_t Now;

time(&Now);
Today = *localtime(&Now);

printf("%4.4d/%2.2d/%2.2d\n",Today.tm_year+1900
                            ,Today.tm_mon+1
                            ,Today.tm_mday);