16,8 → 16,12 |
nqs = 0; |
// number of nodes with defined source |
nnqs = 0; |
// number of nodes with defined point source |
nnpqs = 0; |
// list of nodes with defined source |
lnqs = NULL; |
// list of nodes with defined point source |
lnpqs = NULL; |
// number of elements with defined source |
neqs = 0; |
// list of elements with defined source |
75,6 → 79,12 |
delete [] lnqs[i]; |
} |
delete [] lnqs; |
|
// list of nodes with defined point source |
for (i=0;i<nnpqs;i++){ |
delete [] lnpqs[i]; |
} |
delete [] lnpqs; |
|
// list of elements with defined source |
for (i=0;i<neqs;i++){ |
162,6 → 172,9 |
|
// list of nodes with defined source |
xfscanf (in,"%ld",&nnqs); |
if (Mesprt==1) |
fprintf (stdout,"\n the number of nodes with source %ld",nnqs); |
|
if (nnqs<0) |
print_err("negative number of nodes with defined source",__FILE__,__LINE__,__func__); |
|
175,12 → 188,12 |
|
// list of elements with defined source |
xfscanf (in,"%ld",&neqs); |
if (Mesprt==1) |
fprintf (stdout,"\n the number of elements with source %ld",neqs); |
|
if (neqs<0) |
print_err("negative number of elements with defined source",__FILE__,__LINE__,__func__); |
|
if (Mesprt==1) |
fprintf (stdout,"\n number of defined sources %ld",neqs); |
|
leqs = new long* [neqs]; |
for (i=0;i<neqs;i++){ |
leqs[i] = new long [2]; |
188,6 → 201,22 |
leqs[i][0]--; |
leqs[i][1]--; |
} |
|
// list of nodes with defined point source |
xfscanf (in,"%ld",&nnpqs); |
if (Mesprt==1) |
fprintf (stdout,"\n the number of point sources %ld",nnpqs); |
|
if (nnpqs<0) |
print_err("negative number of nodes with defined point source",__FILE__,__LINE__,__func__); |
|
lnpqs = new long* [nnpqs]; |
for (i=0;i<nnpqs;i++){ |
lnpqs[i] = new long [2]; |
xfscanf (in,"%ld %ld",&lnpqs[i][0],&lnpqs[i][1]); |
lnpqs[i][0]--; |
lnpqs[i][1]--; |
} |
} |
|
// ********************************************** |
440,6 → 469,13 |
for (i=0;i<neqs;i++){ |
fprintf (out,"\n %ld %ld",leqs[i][0]+1,leqs[i][1]+1); |
} |
|
// list of nodes with defined point source |
fprintf (out,"\n\n %ld",nnpqs); |
for (i=0;i<nnpqs;i++){ |
fprintf (out,"\n %ld %ld",lnpqs[i][0]+1,lnpqs[i][1]+1); |
} |
|
} |
|
// ********************************************** |
1103,5 → 1139,43 |
} |
} |
} |
|
if (nnpqs>0){ |
long ndofn,nid,sid,*cnn; |
double s; |
|
cnn = new long [1]; |
for (i=0;i<nnpqs;i++){ |
// loop over nodes with prescribed point source |
|
// node id |
nid=lnpqs[i][0]; |
// number of DOFs in the node |
ndofn = Tt->give_ndofn (nid); |
|
if (ndofn!=1){ |
print_err("the number of DOFs in nodes in point sources is not 1", __FILE__, __LINE__, __func__); |
abort (); |
} |
|
// DOF id |
Tt->give_node_code_numbers (nid,cnn); |
|
// point source id |
sid = lnpqs[i][1]; |
|
// there should be element id as an argument of the function giveval |
// in the case of source described by a mathematical function, the argument |
// is not used inside |
s = sour[sid].giveval (0); |
|
if (cnn[0]>0){ |
rhs[cnn[0]-1]+=s; |
} |
|
} |
|
delete [] cnn; |
} |
} |
|