1616//
1717// You should have received a copy of the GNU Lesser General Public
1818// License along with this library; if not, write to the Free Software
19- // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020
2121#ifndef CARTBLOCK_H
2222#define CARTBLOCK_H
2323
24+ #include " codetypes.h"
2425#include < cassert>
2526#include < cstdlib>
26- #include " codetypes.h"
2727
2828struct INTERPLIST2 ;
2929struct DONORLIST ;
@@ -34,63 +34,76 @@ struct AMRMeshInfo;
3434}
3535
3636class CartGrid ;
37- class CartBlock
38- {
39- private:
37+ class CartBlock {
38+ private:
4039 int local_id;
4140 int global_id;
42- int dims[3 ],nf,ncell,ncell_nf,nnode,nnode_nf;
43- int nvar_cell,nvar_node;
41+ int dims[3 ], nf, ncell, ncell_nf, nnode, nnode_nf;
42+ int nvar_cell, nvar_node;
4443 int myid;
45- int *ibl_cell, *ibl_node;;
44+ int *ibl_cell, *ibl_node;
45+ ;
4646 double *qcell, *qnode;
47- double xlo[3 ];
47+ double xlo[3 ];
4848 double dx[3 ];
4949 int ndonors;
5050 int interpListSize;
51- INTERPLIST2 *interpList,*listptr;
51+ INTERPLIST2 *interpList, *listptr;
5252 DONORLIST **donorList;
53- void (*donor_frac) (int *,double *,int *,double *);
54- public:
55- CartBlock () { global_id=0 ;dims[0 ]=dims[1 ]=dims[2 ]=0 ;ibl_cell=NULL ;ibl_node=NULL ;qcell=NULL ;qnode=NULL ;interpListSize=0 ;donorList=NULL ;interpList=NULL ;
56- donor_frac=nullptr ;nvar_cell=0 ;nvar_node=0 ;};
57- ~CartBlock () { clearLists ();};
53+ void (*donor_frac)(int *, double *, int *, double *);
5854
59- void registerData (int lid, TIOGA::AMRMeshInfo* minfo);
60- void registerSolution (int lid, TIOGA::AMRMeshInfo* minfo);
55+ public:
56+ CartBlock () {
57+ global_id = 0 ;
58+ dims[0 ] = dims[1 ] = dims[2 ] = 0 ;
59+ ibl_cell = NULL ;
60+ ibl_node = NULL ;
61+ qcell = NULL ;
62+ qnode = NULL ;
63+ interpListSize = 0 ;
64+ donorList = NULL ;
65+ interpList = NULL ;
66+ donor_frac = nullptr ;
67+ nvar_cell = 0 ;
68+ nvar_node = 0 ;
69+ };
70+ ~CartBlock () { clearLists (); };
6171
62- void registerData (int local_id_in,int global_id_in,int *iblankin,int *iblanknin)
63- {
64- local_id=local_id_in;
65- global_id=global_id_in;
66- ibl_cell=iblankin;
67- ibl_node=iblanknin;
72+ void registerData (int lid, TIOGA::AMRMeshInfo *minfo);
73+ void registerSolution (int lid, TIOGA::AMRMeshInfo *minfo);
74+
75+ void registerData (int local_id_in, int global_id_in, int *iblankin,
76+ int *iblanknin) {
77+ local_id = local_id_in;
78+ global_id = global_id_in;
79+ ibl_cell = iblankin;
80+ ibl_node = iblanknin;
6881 };
69- void registerSolution (double *qin,int nq_cell,int nq_node) {
70- assert ((nq_cell+nq_node > 0 )
71- && !((nq_cell > 0 ) && (nq_node > 0 )));
82+ void registerSolution (double *qin, int nq_cell, int nq_node) {
83+ assert ((nq_cell + nq_node > 0 ) && !((nq_cell > 0 ) && (nq_node > 0 )));
7284 if (nq_node > 0 ) {
7385 nvar_node = nq_node;
7486 qnode = qin;
75- }
76- else if (nq_cell > 0 ){
87+ } else if (nq_cell > 0 ) {
7788 nvar_cell = nq_cell;
7889 qcell = qin;
7990 }
8091 };
8192 int num_cell_var () const { return nvar_cell; }
8293 int num_node_var () const { return nvar_node; }
8394 void preprocess (CartGrid *cg);
84- void getInterpolatedData (int *nints,int *nreals,int **intData,
85- double **realData);
86- void update (double *qval,int index);
95+ void getInterpolatedData (int *nints, int *nreals, int **intData,
96+ double **realData);
97+ void update (double *qval, int index);
8798 void getCancellationData (int *cancelledData, int *ncancel);
8899 void processDonors (HOLEMAP *holemap, int nmesh);
89100 void processDonors (ADAPTIVE_HOLEMAP *holemap, int nmesh);
90101 void processIblank (HOLEMAP *holemap, int nmesh, bool isNodal);
91102 void processIblank (ADAPTIVE_HOLEMAP *holemap, int nmesh, bool isNodal);
92- void insertInDonorList (int senderid,int index,int meshtagdonor,int remoteid,int remoteblockid,double cellRes);
93- void insertInInterpList (int procid,int remoteid,int remoteblockid,double *xtmp);
103+ void insertInDonorList (int senderid, int index, int meshtagdonor,
104+ int remoteid, int remoteblockid, double cellRes);
105+ void insertInInterpList (int procid, int remoteid, int remoteblockid,
106+ double *xtmp);
94107 void writeCellFile (int bid);
95108 void clearLists (void );
96109 void initializeLists (void );
0 commit comments