case 'e':
cap.type|=CHAATTR_ELEMENT;
break;
+ case 'n':
+ cap.type|=CHAATTR_NUMBER;
default:
break;
}
cap.element=atoi(word[i]);
i+=1;
}
+ if(cap.type&CHAATTR_NUMBER) {
+ cap.element=atoi(word[i]);
+ i+=1;
+ }
for(o=0;o<strlen(word[i]);o++) {
switch(word[i][o]) {
case 'b':
iap.y0=atof(word[9]);
iap.z0=atof(word[10]);
break;
+ case 'P':
+ iap.type=INS_RELPOS;
+ iap.x0=atof(word[8]);
+ iap.y0=atof(word[9]);
+ iap.z0=atof(word[10]);
+ break;
case 'r':
switch(word[8][0]) {
cr_check=TRUE;
break;
case INS_POS:
+ case INS_RELPOS:
x0=iap->x0;
y0=iap->y0;
z0=iap->z0;
while(cnt<iap->ins_atoms) {
run=1;
while(run) {
- if(iap->type!=INS_POS) {
+ if((iap->type!=INS_POS)&&(iap->type!=INS_RELPOS)) {
r.x=rand_get_double(&(moldyn->random))*x;
r.y=rand_get_double(&(moldyn->random))*y;
r.z=rand_get_double(&(moldyn->random))*z;
r.y=0.0;
r.z=0.0;
}
- r.x+=x0;
- r.y+=y0;
- r.z+=z0;
+ if(iap->type==INS_RELPOS) {
+ r.x+=x0*mdrun->lc;
+ r.y+=y0*mdrun->lc;
+ r.z+=z0*mdrun->lc;
+ }
+ else {
+ r.x+=x0;
+ r.y+=y0;
+ r.z+=z0;
+ }
// offset
if(iap->type!=INS_TOTAL) {
r.x+=o;
if(cap->element!=atom->element)
continue;
}
+ if(cap->type&CHAATTR_NUMBER) {
+ if(cap->element!=atom->tag)
+ continue;
+ }
if(cap->type&CHAATTR_REGION) {
if(cap->x0>atom->r.x)
continue;
#define INS_RECT 0x02
#define INS_SPHERE 0x03
#define INS_POS 0x04
+#define INS_RELPOS 0x05
typedef struct s_continue_params {
int runs;
#define CHAATTR_TOTALV 0x01
#define CHAATTR_REGION 0x02
#define CHAATTR_ELEMENT 0x04
+#define CHAATTR_NUMBER 0x08
typedef struct s_chsattr_params {
u8 type;