github.com/archlabjp/eeslism-go@v0.0.0-20231109122333-4bb7bfcdf292/eeslism/MAT_INIT.go (about) 1 //This file is part of EESLISM. 2 // 3 //Foobar is free software : you can redistribute itand /or modify 4 //it under the terms of the GNU General Public License as published by 5 //the Free Software Foundation, either version 3 of the License, or 6 //(at your option) any later version. 7 // 8 //Foobar is distributed in the hope that it will be useful, 9 //but WITHOUT ANY WARRANTY; without even the implied warranty of 10 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 11 //GNU General Public License for more details. 12 // 13 //You should have received a copy of the GNU General Public License 14 //along with Foobar.If not, see < https://www.gnu.org/licenses/>. 15 16 /* 17 18 構造体LP、OP`の初期化 19 FILE=MAT_INIT.c 20 Create Date=1999.5.25 21 22 */ 23 24 package eeslism 25 26 func MATINIT(q []*P_MENN, n int) { 27 for i := 0; i < n; i++ { 28 q[i].e.X = 0.0 29 q[i].e.Y = 0.0 30 q[i].e.Z = 0.0 31 for j := 0; j < q[i].polyd; j++ { 32 q[i].P[j].X = 0.0 33 q[i].P[j].Y = 0.0 34 q[i].P[j].Z = 0.0 35 } 36 } 37 } 38 39 func MATINIT_sum(opn int, op []P_MENN) { 40 for j := 0; j < opn; j++ { 41 op[j].sum = 0.0 42 for i := 0; i < op[j].wd; i++ { 43 op[j].opw[i].sumw = 0.0 44 } 45 } 46 } 47 48 func MATINIT_sdstr(mpn, mtb int, Sdstr []SHADSTR) { 49 for j := 0; j < mpn; j++ { 50 for i := 0; i < mtb; i++ { 51 Sdstr[j].sdsum[i] = 0.0 52 } 53 } 54 }