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.
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;
% 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/
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/
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/
viewport/viewport annotation options (CAE 6.10-1)
Abaqus Finite Element Software:
http://www.simulia.com/
Subscribe to:
Posts (Atom)