Commit d790322a authored by Dan Wu's avatar Dan Wu
Browse files

Fixed some cppcheck warnings on unread variables (variable is assigned a value that is never used).

parent 37def48e
......@@ -510,7 +510,7 @@ bool gentityset_test(FBiGeom_Instance geom, bool /*multiset*/, bool /*ordered*/)
int num_type = 4;
iBase_EntitySetHandle ges_array[4];
int number_array[4];
int num_all_gentities_super = 0;
//int num_all_gentities_super = 0;
int ent_type = iBase_VERTEX;
int err;
......@@ -553,7 +553,7 @@ bool gentityset_test(FBiGeom_Instance geom, bool /*multiset*/, bool /*ordered*/)
}
// add to number of all entities in super set
num_all_gentities_super += num_type_gentity;
//num_all_gentities_super += num_type_gentity;
}
// make a super set having all entitysets
......
......@@ -540,7 +540,7 @@ bool gentityset_test(FBiGeom_Instance geom, bool /*multiset*/, bool /*ordered*/)
int num_type = 4;
iBase_EntitySetHandle ges_array[4];
int number_array[4];
int num_all_gentities_super = 0;
//int num_all_gentities_super = 0;
int ent_type = iBase_VERTEX;
int err;
......@@ -583,7 +583,7 @@ bool gentityset_test(FBiGeom_Instance geom, bool /*multiset*/, bool /*ordered*/)
}
// add to number of all entities in super set
num_all_gentities_super += num_type_gentity;
//num_all_gentities_super += num_type_gentity;
}
// make a super set having all entitysets
......
......@@ -482,7 +482,7 @@ bool gentityset_test(FBiGeom_Instance geom, bool /*multiset*/, bool /*ordered*/)
int num_type = 4;
iBase_EntitySetHandle ges_array[4];
int number_array[4];
int num_all_gentities_super = 0;
//int num_all_gentities_super = 0;
int ent_type = iBase_VERTEX;
int err;
......@@ -525,7 +525,7 @@ bool gentityset_test(FBiGeom_Instance geom, bool /*multiset*/, bool /*ordered*/)
}
// add to number of all entities in super set
num_all_gentities_super += num_type_gentity;
//num_all_gentities_super += num_type_gentity;
}
// make a super set having all entitysets
......
......@@ -289,6 +289,7 @@ extern "C" {
// mpi not initialized yet - initialize here
retval = MPI_Init(&argc, &argv);
assert(MPI_SUCCESS == retval);
}
*mbi = new MBiMesh(NULL);
#else
......
......@@ -712,7 +712,7 @@ int entity_sets_subtest(iMesh_Instance mesh, int is_list,
int /*num_iter*/)
{
int i, num_type = iBase_ALL_TYPES - iBase_VERTEX;
int num_all_entities_super = 0;
//int num_all_entities_super = 0;
iBase_EntitySetHandle es_array[iBase_ALL_TYPES - iBase_VERTEX];
int number_array[iBase_ALL_TYPES - iBase_VERTEX];
int ent_type = iBase_VERTEX;
......@@ -808,7 +808,7 @@ int entity_sets_subtest(iMesh_Instance mesh, int is_list,
}
/* add to number of all entities in super set */
num_all_entities_super += entities_size;
//num_all_entities_super += entities_size;
free(entities);
}
......@@ -1373,7 +1373,7 @@ int entity_sets_subtest(iMesh_Instance mesh, int is_list,
/* return FALSE; */
/* } */
/* test add, remove and get all entitiy sets using super set */
/* test add, remove and get all entity sets using super set */
/* check GetAllEntitySets works recursively and dosen't return */
/* multi sets */
for (k = 0; k < num_super; k++) {
......
......@@ -2063,7 +2063,6 @@ namespace moab {
while (MB_SUCCESS == iter.step()) {
int temp = 0;
moab()->get_number_entities_by_handle( iter.handle(), temp);
num_of_elements += temp;
max = std::max( max, temp);
min = std::min( min, temp);
if (iter.depth() > max_depth)
......
......@@ -2198,12 +2198,12 @@ ErrorCode OrientedBoxTreeTool::stats( EntityHandle set,
unsigned min_leaf_depth = tree_height;
num_leaves = 0;
unsigned max_leaf_per_depth = 0;
double sum_leaf_depth = 0, sqr_leaf_depth = 0;
//double sum_leaf_depth = 0, sqr_leaf_depth = 0;
for (i = 0; i < d.leaf_depth.size(); ++i) {
unsigned val = d.leaf_depth[i];
num_leaves += val;
sum_leaf_depth += (double)val*i;
sqr_leaf_depth += (double)val*i*i;
//sum_leaf_depth += (double)val*i;
//sqr_leaf_depth += (double)val*i*i;
if (val && i < min_leaf_depth)
min_leaf_depth = i;
if (max_leaf_per_depth < val)
......
......@@ -436,10 +436,10 @@ ErrorCode SmoothFace::init_edge_control_points(CartVect &P0, CartVect &P3,
/ 18.0e0));
Vi[2] = Vi[3] - (di * (((6.0e0 * T3) + (row * N0) - ((2.0e0 * omega) * N3))
/ 18.0e0));
CartVect Wi[3];
Wi[0] = Vi[1] - Vi[0];
Wi[1] = Vi[2] - Vi[1];
Wi[2] = Vi[3] - Vi[2];
//CartVect Wi[3];
//Wi[0] = Vi[1] - Vi[0];
//Wi[1] = Vi[2] - Vi[1];
//Wi[2] = Vi[3] - Vi[2];
Pi[0] = 0.25 * Vi[0] + 0.75 * Vi[1];
Pi[1] = 0.50 * Vi[1] + 0.50 * Vi[2];
......@@ -1870,54 +1870,54 @@ ErrorCode SmoothFace::eval_bezier_patch_normal(EntityHandle facet,
normal = CartVect(0.0e0, 0.0e0, 0.0e0);
//i=3; j=0; k=0;
double Bsum = 0.0;
//double Bsum = 0.0;
double B = cube(areacoord[0]);
Bsum += B;
//Bsum += B;
normal += B * Nijk[0];
//i=2; j=1; k=0;
B = 3.0 * sqr(areacoord[0]) * areacoord[1];
Bsum += B;
//Bsum += B;
normal += B * Nijk[1];
//i=1; j=2; k=0;
B = 3.0 * areacoord[0] * sqr(areacoord[1]);
Bsum += B;
//Bsum += B;
normal += B * Nijk[2];
//i=0; j=3; k=0;
B = cube(areacoord[1]);
Bsum += B;
//Bsum += B;
normal += B * Nijk[3];
//i=2; j=0; k=1;
B = 3.0 * sqr(areacoord[0]) * areacoord[2];
Bsum += B;
//Bsum += B;
normal += B * Nijk[4];
//i=1; j=1; k=1;
B = 6.0 * areacoord[0] * areacoord[1] * areacoord[2];
Bsum += B;
//Bsum += B;
normal += B * Nijk[5];
//i=0; j=2; k=1;
B = 3.0 * sqr(areacoord[1]) * areacoord[2];
Bsum += B;
//Bsum += B;
normal += B * Nijk[6];
//i=1; j=0; k=2;
B = 3.0 * areacoord[0] * sqr(areacoord[2]);
Bsum += B;
//Bsum += B;
normal += B * Nijk[7];
//i=0; j=1; k=2;
B = 3.0 * areacoord[1] * sqr(areacoord[2]);
Bsum += B;
//Bsum += B;
normal += B * Nijk[8];
//i=0; j=0; k=3;
B = cube(areacoord[2]);
Bsum += B;
//Bsum += B;
normal += B * Nijk[9];
//assert(fabs(Bsum - 1.0) < 1e-9);
......
......@@ -373,8 +373,10 @@ ErrorCode SparseTag::tag_iterate(SequenceManager* seqman,
rval = get_data_ptr(*iter, ptr);
if (MB_SUCCESS == rval)
data_ptr = const_cast<void*>(ptr);
else if (get_default_value() && allocate)
else if (get_default_value() && allocate) {
ptr = allocate_data(*iter, mData.end());
data_ptr = const_cast<void*>(ptr);
}
else {
// If allocation was not requested, need to increment the iterator so that
// the count can be computed properly
......
......@@ -417,7 +417,7 @@ namespace moab
ErrorCode SpatialLocator::locate_points(const double *pos, int num_points,
EntityHandle *ents, double *params, int *is_inside,
const double rel_iter_tol, const double abs_iter_tol,
const double /* rel_iter_tol */, const double abs_iter_tol,
const double inside_tol)
{
bool i_initialized = false;
......@@ -427,11 +427,13 @@ namespace moab
i_initialized = true;
}
/*
double tmp_abs_iter_tol = abs_iter_tol;
if (rel_iter_tol && !tmp_abs_iter_tol) {
// relative epsilon given, translate to absolute epsilon using box dimensions
tmp_abs_iter_tol = rel_iter_tol * localBox.diagonal_length();
}
*/
if (elemEval && myTree->get_eval() != elemEval)
myTree->set_eval(elemEval);
......
......@@ -1575,9 +1575,9 @@ ErrorCode ReadABAQUS::create_instance_of_part(const EntityHandle file_set,
status = mdbImpl->tag_get_data(mLocalIDTag, part_node_list, &node_ids[0]);
MB_RETURN_IF_FAIL;
std::map<int, EntityHandle> nodeIdMap;
for (unsigned int idx = 0; idx < part_node_list.size(); idx++)
nodeIdMap[node_ids[idx]] = part_node_list[idx];
//std::map<int, EntityHandle> nodeIdMap;
//for (unsigned int idx = 0; idx < part_node_list.size(); idx++)
//nodeIdMap[node_ids[idx]] = part_node_list[idx];
// Create new nodes
std::vector<double*> coord_arrays(3);
......@@ -1653,9 +1653,9 @@ ErrorCode ReadABAQUS::create_instance_of_part(const EntityHandle file_set,
status = mdbImpl->tag_get_data(mLocalIDTag, part_element_list, &part_element_ids[0]);
MB_RETURN_IF_FAIL;
std::map<int, EntityHandle> elementIdMap;
for (unsigned int idx = 0; idx < part_element_list.size(); idx++)
elementIdMap[part_element_ids[idx]] = part_element_list[idx];
//std::map<int, EntityHandle> elementIdMap;
//for (unsigned int idx = 0; idx < part_element_list.size(); idx++)
//elementIdMap[part_element_ids[idx]] = part_element_list[idx];
// Create new elements
Range instance_element_list;
......
......@@ -875,20 +875,22 @@ ErrorCode ReadCCMIO::read_all_faces(CCMIOID topologyID, TupleList &vert_map,
CCMIOSize_t index = CCMIOSIZEC(0);
CCMIOID faceID;
ErrorCode rval;
CCMIOError error;
// Get total # internal/bdy faces, size the face map accordingly
int nint_faces = 0, nbdy_faces = 0;
#ifdef TUPLE_LIST
int nbdy_faces = 0;
CCMIOSize_t nf;
CCMIOError error = kCCMIONoErr;
error = kCCMIONoErr;
while (kCCMIONoErr == CCMIONextEntity(NULL, topologyID, kCCMIOBoundaryFaces, &index,
&faceID)) {
CCMIOEntitySize(&error, faceID, &nf, NULL);
nbdy_faces = nbdy_faces + nf;
nbdy_faces += nf;
}
CCMIOGetEntity(&error, topologyID, kCCMIOInternalFaces, 0, &faceID);
CCMIOEntitySize(&error, faceID, &nf, NULL);
nint_faces = nint_faces + nf;
#ifdef TUPLE_LIST
int nint_faces = nf;
face_map.resize(2*nint_faces + nbdy_faces);
#endif
......
......@@ -3420,16 +3420,16 @@ ErrorCode ReadHDF5::read_qa(EntityHandle)
CHECK_OPEN_HANDLES;
mhdf_Status status;
std::vector<std::string> qa_list;
//std::vector<std::string> qa_list;
int qa_len;
char** qa = mhdf_readHistory(filePtr, &qa_len, &status);
if (mhdf_isError(&status)) {
MB_SET_ERR(MB_FAILURE, mhdf_message(&status));
}
qa_list.resize(qa_len);
//qa_list.resize(qa_len);
for (int i = 0; i < qa_len; i++) {
qa_list[i] = qa[i];
//qa_list[i] = qa[i];
free(qa[i]);
}
free(qa);
......
......@@ -68,10 +68,8 @@ ErrorCode ReadIDEAS::load_file(const char* fname,
return MB_FAILURE;
EntityHandle first_vertex = 0;
std::string s;
while (!file.eof()) {
file.getline(line, 10000);
s = line;
unsigned int header_id = (unsigned int) strtol(line, NULL, 10);
// Create vertices
......
......@@ -624,17 +624,17 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
// Check for more data
if (num_read < nodeseth->nsLength) {
FREADC(2); num_read += 2;
FREADC(2); //num_read += 2;
if (char_buf[0] == 'i' && char_buf[1] == 'd') {
FREADI(1); num_read += sizeof(int);
FREADI(1); //num_read += sizeof(int);
//uid = int_buf[0];
}
else {
if (char_buf[0] == 'b' && char_buf[1] == 'c') {
FREADI(1); num_read += sizeof(int);
FREADI(1); //num_read += sizeof(int);
int num_bcs = uint_buf[0];
bc_data.resize(num_bcs);
FREADCA(num_bcs, &bc_data[0]); num_read += num_bcs;
FREADCA(num_bcs, &bc_data[0]); //num_read += num_bcs;
}
}
}
......@@ -785,18 +785,18 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
// Check for more data
if (data_version > 1.0 && num_read < sideseth->ssLength) {
FREADC(2); num_read += 2;
FREADC(2); //num_read += 2;
if (char_buf[0] == 'i' && char_buf[1] == 'd') {
FREADI(1); num_read += sizeof(int);
FREADI(1); //num_read += sizeof(int);
//uid = int_buf[0];
}
else {
// Check for bc_data
if (char_buf[0] == 'b' && char_buf[1] == 'c') {
FREADI(1); num_read += sizeof(int);
FREADI(1); //num_read += sizeof(int);
int num_bcs = uint_buf[0];
bc_data.resize(num_bcs);
FREADCA(num_bcs, &bc_data[0]); num_read += num_bcs;
FREADCA(num_bcs, &bc_data[0]); //num_read += num_bcs;
}
}
}
......@@ -1032,9 +1032,9 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
// Check for more data
if (num_read < blockh->blockLength) {
FREADC(2); num_read += 2;
FREADC(2); //num_read += 2;
if (char_buf[0] == 'i' && char_buf[1] == 'd') {
FREADI(1); num_read += sizeof(int);
FREADI(1); //num_read += sizeof(int);
//uid = int_buf[0];
}
}
......
......@@ -2880,7 +2880,7 @@ ErrorCode WriteHDF5::get_tag_size(Tag tag,
array_length = MB_VARIABLE_LENGTH;
if (!close_hdf_type) {
hdf_type = H5Tcopy(hdf_type);
close_hdf_type = true;
//close_hdf_type = true;
}
}
else if (array_length > 1 && moab_type != MB_TYPE_BIT) {
......@@ -2896,7 +2896,7 @@ ErrorCode WriteHDF5::get_tag_size(Tag tag,
}
else if (!close_hdf_type) {
hdf_type = H5Tcopy(hdf_type);
close_hdf_type = true;
//close_hdf_type = true;
}
return MB_SUCCESS;
......
......@@ -223,7 +223,9 @@ int check_valid_file_ids( struct mhdf_FileDesc* desc )
int check_file_contains_holes( const char* filename )
{
#ifndef _MSC_VER
const int blocksize = 512;
#endif
int errorcode;
struct stat buf;
......
......@@ -335,6 +335,7 @@ namespace moab {
// mpi not initialized yet - initialize here
retval = MPI_Init(&argc, &argv);
assert(MPI_SUCCESS == retval);
}
// Reserve space for vectors
......@@ -1266,7 +1267,7 @@ ErrorCode ParallelComm::send_entities(std::vector<unsigned int>& send_procs,
result = unpack_tags(buff_ptr, new_ents, store_remote_handles, from_proc);MB_CHK_SET_ERR(result, "Unpacking tags failed");
if (myDebug->get_verbosity() == 3) {
myDebug->tprintf(4, "unpack_tags buffer space: %ld bytes.\n", (long int)(buff_ptr - tmp_buff));
tmp_buff = buff_ptr;
//tmp_buff = buff_ptr;
}
if (myDebug->get_verbosity() == 3)
......
......@@ -1533,7 +1533,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
{
double jacobi, min_norm_jac = VERDICT_DBL_MAX;
double min_jacobi = VERDICT_DBL_MAX;
//double min_jacobi = VERDICT_DBL_MAX;
double temp_norm_jac, lengths;
double len1_sq, len2_sq, len3_sq;
VerdictVector xxi, xet, xze;
......@@ -1546,7 +1546,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = calc_hex_efg(3, node_pos );
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1571,7 +1571,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[4] - node_pos[0];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1596,7 +1596,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[5] - node_pos[1];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1620,7 +1620,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[6] - node_pos[2];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1644,7 +1644,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[7] - node_pos[3];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1668,7 +1668,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[0] - node_pos[4];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1692,7 +1692,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[1] - node_pos[5];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1716,7 +1716,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[2] - node_pos[6];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1740,7 +1740,7 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
xze = node_pos[3] - node_pos[7];
jacobi = xxi % ( xet * xze );
if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
//if( jacobi < min_jacobi ) { min_jacobi = jacobi; }
len1_sq = xxi.length_squared();
len2_sq = xet.length_squared();
......@@ -1754,8 +1754,8 @@ C_FUNC_DEF double v_hex_scaled_jacobian( int /*num_nodes*/, double coordinates[]
temp_norm_jac = jacobi / lengths;
if( temp_norm_jac < min_norm_jac)
min_norm_jac = temp_norm_jac;
else
temp_norm_jac = jacobi;
//else
//temp_norm_jac = jacobi;
if( min_norm_jac> 0 )
return (double) VERDICT_MIN( min_norm_jac, VERDICT_DBL_MAX );
......
......@@ -1338,7 +1338,7 @@ C_FUNC_DEF double v_quad_distortion( int num_nodes, double coordinates[][3] )
}
normal_at_point = aa*bb;
jacobian = normal_at_point.length();
//jacobian = normal_at_point.length();
distrt = cc%normal_at_point;
if (distrt < distortion) distortion = distrt;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment