With only one atom type, I used:
pair_style eam/fs
pair_coeff * * /potentials/Zr_#2.eam.fs Zr
But I keep getting the error: Incorrect args for pair coefficients. I am also sure that the path to the potential file is correct. How can I fix this?
You're potential file is incorrectly named. LAMMPS will interpret the '#' in:
pair_coeff * * /potentials/Zr_#2.eam.fs Zr
as the start of a comment.
Rename your potential file and it should work.
Related
After running the following code, I got this error. But I don't know what the error means and how to solve it?
code with the error :
you missed multiplying (*) after (h), which python is considering as function which is obviously not found. Change the code in line number to below code
volume = 1/3 * 22/7 * h * (R1*R1 +R2*R2 +R1*R2)
I have a simple FMU file which contains a sine block that takes u as input and outputs y. In this case, u is set to equal to time. In my C++ code I have loaded the FMI library from FMILibrary and had done all the necessary steps up to a point where I want to give my input u a new value of pi(as 3.14). So I went:
fmistatus = fmi2_import_set_real(fmu, &uRef, 1, &pi);
while (timeCurrent < timeEnd){
fmistatus = fmi2_import_do_step(fmu, timeCurrent , stepSize, fmi2_true);
timeCurrent += stepSize;
}
u was still set to time even though I tried to give it a new value. Did I miss something?
PS. Is there anywhere I can find a more detailed description on the FMI library functions? Currently I can only find input output descriptions or did I miss something again.
UPDATE: After a few trials, I think this issue might be because I was trying to redefine my equation u = time. In other words when I change my u variable into RealInput block in openmodelica everything goes fine. So what if I really wants to redefine a certain equation? what do I have to do?
You shall not be able to set any variable in FMI - and especially not a variable with a binding equation - and I assume your Modelica model has "u=time;". Instead of having "u=time" you need to add a top-level input without any equation (so that the exported FMI has it as an input) - and then connect that to the sine-block.
Details:
For a co-simulation FMI the restriction on what you can set are in the state-diagram in section 4.2.4 of FMI2 specification.
Between fmi2DoStep you can only set Real variables that have causality="input" or causality="parameter" and variability="tunable" - and an input with an equation doesn't qualify.
Before starting the integration you could set it for other variables as well, but that is only guess-values for the initialization - and should not over-write the "u=time" equation.
I am try to compile FORTRAN 77 code and I have problems like this.
integer row(nnzmax+nszero),column(nnzmax+nszero),
+ ireg(nximax),florsm(nzimax)/nzimax*2/
real lambda,imodel(nximax,nzimax),dm(nmmax),
+ dum1(nmmax),dum2(nmmax),data(ndmax+nsconst),
+ anz(nnzmax+nszero),ibmodel(nximax,nzimax),
+ smwz(nzimax)/nzimax*-1./,spwz(nzimax)/nzimax*-1./
Error on line 50: attempt to give DATA in type-declaration
Error on line 52: attempt to give DATA in type-declaration
I used to work with this code,but it has been compiled with Intel Fotran Compiler. I have moved to other country so I do not have ifort installed here. I am using fort77 now. Should I try with some compilation options or?I have used this script to compile app .f from this folder.
#! /bin/csh -f
set list=`ls *.f`
set FLAG="-o"
echo $list
foreach file (${list})
echo $file
f77 ${file} ${FLAG} ${file:r}
mv ${file:r} ../bin/.
end
I have changed declarations like this:
integer row(nnzmax+nszero),column(nnzmax+nszero),
+ ireg(nximax),florsm(nzimax),
+ data florsm /nzimax*2/
real lambda,imodel(nximax,nzimax),dm(nmmax),
+ dum1(nmmax),dum2(nmmax),data(ndmax+nsconst),
+ anz(nnzmax+nszero),ibmodel(nximax,nzimax),
+ data smwz /nzimax*-1./,
+ data spwz /nzimax*-1./
But still I got
Error on line 50: attempt to give DATA in type-declaration
Error on line 53: attempt to give DATA in type-declaration
Error on line 385: Declaration error for smwz: used as variable
Error on line 385: Declaration error for smwz: may not appear in namelist
Error on line 385: Declaration error for spwz: used as variable
Error on line 385: Declaration error for spwz: may not appear in namelist
This fragment, and the later similar ones
florsm(nzimax)/nzimax*2/
looks like a non-standard way of initialising a variable with a sort-of data statement merged into the declaration. A more standard approach would separate the two, something like
florsm(nzimax)
...
data florsm /nzimax*2/
One of the beauties of working with the Intel Fortran compiler is its long history; along the way it has picked up, and continues to accept, all sorts of non-standard features. I'm guessing that this is one of those and is not acceptable to the other compiler you mention.
Of course, this seems to be what the error statement seems to be telling us.
A standard replacement might be
florsm(nzimax) = 2
but that takes advantage of a Fortran 90 feature which something called fort77 might not understand either.
In the code I maintain I run across:
from win32com.shell import shell, shellcon
# ...
result,nAborted,mapping = shell.SHFileOperation(
(parent,operation,source,target,flags,None,None))
In Python27\Lib\site-packages\win32comext\shell\ (note win32comext) I just have a shell.pyd binary.
What is the return value of shell.SHFileOperation for a deletion (operation=FO_DELETE in the call above) ? Where is the code for the shell.pyd ?
Can I get the list of files actually deleted from this return value or do I have to manually check afterwards ?
EDIT: accepted answer answers Q1 - having a look at the source of pywin32-219\com\win32comext\shell\src\shell.cpp I see that static PyObject *PySHFileOperation() delegates to SHFileOperation which does not seem to return any info on which files failed to be deleted - so I guess answer to Q2 is "no".
ActiveState Python help contains SHFileOperation description:
shell.SHFileOperation
int, int = SHFileOperation(operation)
Copies, moves, renames, or deletes a file system object.
Parameters
operation : SHFILEOPSTRUCT
Defines the operation to perform.
Return Value
The result is a tuple containing int result of the
function itself, and the result of the fAnyOperationsAborted member
after the operation. If Flags contains FOF_WANTMAPPINGHANDLE, returned
tuple will have a 3rd member containing a sequence of 2-tuples with
the old and new file names of renamed files. This will only have any
content if FOF_RENAMEONCOLLISION was specified, and some filename
conflicts actually occurred.
Source code can be downloaded here: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/ (pywin32-219.zip)
Just unpack and go to .\pywin32-219\com\win32comext\shell\src\
While compiling an OCaml application I get the following error:
File "/tmp/ocamlpp466ee0", line 308, characters 34-233:
Error: Signature mismatch:
...
The field `unlock' is required but not provided
The field `lock' is required but not provided
Command exited with code 2.
My guess is that the error is releated with the OCaml library Datalog (I've installed the version 0.3 from here) because the line 308 in the file is /tmp/ocamlpp466ee0 the first one in the following code
module Logic = Datalog.Logic.Make(struct
type t = atom
let equal = eq_atom
let hash = hash_atom
let to_string a = Utils.sprintf "%a" pp_atom a
let of_string s = atom_of_json (Json.from_string s)
end)
I would really appreciate if someone could help me to know what I am doing wrong.
Moreover, I would like to undestand why the file /tmp/ocamlpp466ee0 is generated each time I execute 'make'? I tried to understand by reading the Makefile but I did not succeed.
I think that something have changed in Datalog library and in some version > 0.3 functor Datalog.Logic.Make requires module argument with values lock and unlock declared. So, it's version problem.
About temporary file. As you can see, its name consists of ocaml literal, pp which means preprocessor and some number. Preprocessors in OCaml usually work this way: they read input source file and write output source files. That's why some temporary files are created.