/[escript]/trunk/esys2/finley/src/finleyC/System_setValues.c
ViewVC logotype

Annotation of /trunk/esys2/finley/src/finleyC/System_setValues.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 100 - (hide annotations)
Wed Dec 15 03:48:48 2004 UTC (15 years, 5 months ago) by jgs
File MIME type: text/plain
File size: 1483 byte(s)
*** empty log message ***

1 jgs 82 /* $Id$ */
2    
3     /**************************************************************/
4    
5     /* Finley: SystemMatrix : */
6     /* sets the values of the system matrix to a value */
7    
8     /**************************************************************/
9    
10     /* Copyrights by ACcESS Australia 2003 */
11     /* Author: gross@access.edu.au */
12    
13     /**************************************************************/
14    
15     #include "Finley.h"
16     #include "System.h"
17    
18    
19     /**************************************************************/
20    
21     void Finley_SystemMatrix_setValues(Finley_SystemMatrix* in,double value) {
22 jgs 100 maybelong i,j,iptr,len_index_list=0;
23     maybelong block_size=in->row_block_size*in->col_block_size;
24     switch(in->type) {
25     case CSR:
26     len_index_list=in->num_rows;
27     break;
28     case CSC:
29     len_index_list=in->num_cols;
30     break;
31     default:
32     Finley_ErrorCode = TYPE_ERROR;
33     sprintf(Finley_ErrorMsg, "Unknown matrix type.");
34     return;
35     }
36 jgs 82 #pragma omp parallel for private(i,iptr,j) schedule(static)
37 jgs 100 for (i=0;i< len_index_list;i++) {
38     for (iptr=in->ptr[i]-PTR_OFFSET;iptr<in->ptr[i+1]-PTR_OFFSET; iptr++) {
39     for (j=0;j<block_size;j++) in->val[iptr*block_size+j]=value;
40 jgs 82 }
41     }
42     }
43     /*
44     * $Log$
45 jgs 100 * Revision 1.3 2004/12/15 03:48:47 jgs
46 jgs 97 * *** empty log message ***
47 jgs 82 *
48 jgs 97 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
49     * initial import of project esys2
50     *
51 jgs 82 * Revision 1.1 2004/07/02 04:21:13 gross
52     * Finley C code has been included
53     *
54     *
55     */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26