0

On assignment, they gave me a step-by-step example from this article http://wiki.octave.org/Bim_package.

The example was typed manually, without copy-paste.I already install this packages- fpl, bim,msh, image. Octave example:

pkg load bim
pkg load msh
pkg load fpl


[mesh]=msh2m_gmsh("fuime","scale",1,"clscale",.1); – Error
[mesh]=bim2c_mesh_properties(mesh);

pdemesh(mesh.p,mesh.e,mesh.t);
view(2)

xu=mesh.p(1,:).';
yu=mesh.p(2,:).';

nelems=columns(mesh.t);
nnodes=columns(mesh.p);

epsilon=.1;
phi=xu+yu;

AdvDiff=bim2a_advaction_diffusion(mesh,epsilon,1,1,phi);
Mass=bim2a_reaction(mesh,1,1);
b=bim2a_rhs(mesh,f,g);
A=AdvDiff+Mass;

GammaD=bim2c_unknowns_on_side(mesh,[1 2]);
GammaN=bim2c_unknowns_on_side(mesh,[3 4]);
GammaN=setdiff(GammaN,GammaD);

jn=zeros(length(GammaN),1);
ud=3*xu;
Omega=setdiff(1:nnodes,union(GammaD,GammaN));

Add=A(GammaD,GammaD);
Adn=A(GammaD,GammaN);
Adi=A(GammaD,Omega);

And=A(GammaN,GammaD);
Ann=A(GammaN,GammaN);
Ani=A(GammaN,Omega);

Aid=A(Omega,GammaD);
Ain=A(Omega,GammaN);
Aii=A(Omega,Omega);

bd=b(GammaD);
bn=b(GammaN);
bi=b(Omega);

temp=[Ann Ani;Ain Aii]\[jn+bn-And*ud(GammaD); bi-Aid*ud(GammaD)];
u=ud;
u(GammaN)=temp(1:numel(GammaN));
u(Omega)=temp(length(GammaN)+1:end);

jd=[Add Adi Adn]*u([GammaD;Omega;GammaN])-bd;

[gx,gy]=bim2c_pde_gradient(mesh,u);
[jxglob,jyglob]=bim2c_global_flux(mesh,u,epsilon*ones(nelems,1),ones(nnodes,1),ones(nnodes,1),phi);

fpl_vtk_write_field("vtkdata",mesh,{u,"Solution"},{[gx:gy]',"Gradient"},1);
pdesurf(mesh.p,mesh.t,u);

In this - [mesh]=msh2m_gmsh("fuime","scale",1,"clscale",.1);Error

Generating mesh...
error: 'tmpnam' undefined near line 78, column 78
error: called from
    msh2m_gmsh at line 78 column 12
>>

WHAT HAVE I TAKEN TO FIX THE ERROR

I decided that the problem is in uninstalled packages. According to the answer I was given in this thread Error,when installing a new package in Octave.

I started to install the package mesh, but here another error came out.

error: get_forge_pkg: package not found: "mesh".  Maybe you meant "lssa?"
error: called from
    get_forge_pkg at line 90 column 5
    get_forge_download at line 32 column 14
    pkg at line 500 column 31

But the mesh package not found.The package msh already installed. How I can fixed my problem?

beginner
  • 183
  • 2
  • 12
  • 1
    Without checking more deeply, just pointing out that `tmpnam` was an old command to create a filename for a temporary file. This was octave-specific, and was later changed to `tempname` for compatibility with an equivalent function introduced in matlab. If you're lucky it may simply be the case that you should replace `tmpnam` with `tempname` in the package's code and that's it ... (though if the package is really that old, there's probably going to be more problems with it...) – Tasos Papastylianou May 20 '21 at 09:27
  • 1
    Also, the bim package seems to expect a linux environment, as it calls system functions under the hood. It also seems to expect the `gmsh` linux package (not octave package) installed on the system. – Tasos Papastylianou May 20 '21 at 10:16
  • I tried running your example but it seemed to end after creating a mesh with 0 nodes. Not sure if this is more to do with how you called this or not. – Tasos Papastylianou May 20 '21 at 10:16

0 Answers0