Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #1288

Merged
merged 6 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions src/aero/fsi/CalcLoads.C
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ CalcLoads::execute()
coordinates_->sync_to_host();
dudx_->sync_to_host();

// define vector of parent topos; should always be UNITY in size
std::vector<stk::topology> parentTopo;

const auto& bkts = bulk_->get_buckets(
meta.side_rank(),
meta.locally_owned_part() & stk::mesh::selectUnion(partVec_));
Expand All @@ -140,16 +137,6 @@ CalcLoads::execute()
// face_node_relations)
const int* faceIpNodeMap = meFC->ipNodeMap();

// extract connected element topology
b->parent_topology(stk::topology::ELEMENT_RANK, parentTopo);
STK_ThrowAssert(parentTopo.size() == 1);
stk::topology theElemTopo = parentTopo[0];

// extract master element for this element topo
MasterElement* meSCS =
sierra::nalu::MasterElementRepo::get_surface_master_element_on_host(
theElemTopo);

// algorithm related; element
ws_pressure.resize(nodesPerFace);
ws_density.resize(nodesPerFace);
Expand Down Expand Up @@ -194,24 +181,11 @@ CalcLoads::execute()
const double* areaVec = stk::mesh::field_data(*exposedAreaVec_, face);
double* tforce_scs = stk::mesh::field_data(*tforceSCS_, face);

// extract the connected element to this exposed face; should be single in
// size!
const stk::mesh::Entity* face_elem_rels = bulk_->begin_elements(face);
STK_ThrowAssert(bulk_->num_elements(face) == 1);

// get element; its face ordinal number
stk::mesh::Entity element = face_elem_rels[0];
const int face_ordinal = bulk_->begin_element_ordinals(face)[0];

// get the relations off of element
stk::mesh::Entity const* elem_node_rels = bulk_->begin_nodes(element);

for (int ip = 0; ip < numScsBip; ++ip) {

// offsets
const int offSetAveraVec = ip * nDim;
const int localFaceNode = faceIpNodeMap[ip];
const int opposingNode = meSCS->opposingNodes(face_ordinal, ip);

// interpolate to bip
double pBip = 0.0;
Expand All @@ -226,7 +200,6 @@ CalcLoads::execute()

// extract nodal fields
stk::mesh::Entity node = face_node_rels[localFaceNode];
const double* coord = stk::mesh::field_data(*coordinates_, node);
const double* duidxj = stk::mesh::field_data(*dudx_, node);

// divU and aMag
Expand Down
8 changes: 4 additions & 4 deletions src/aero/fsi/FSIturbine.C
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,8 @@ fsiTurbine::mapLoads()
void
fsiTurbine::computeHubForceMomentForPart(
std::vector<double>& hubForceMoment,
std::vector<double>& hubPos,
stk::mesh::PartVector partVec)
std::vector<double>& /* hubPos */,
stk::mesh::PartVector /* partVec */)
{

auto& meta = bulk_->mesh_meta_data();
Expand All @@ -956,12 +956,12 @@ fsiTurbine::computeHubForceMomentForPart(
tforce->sync_to_host();

std::vector<double> l_hubForceMoment(6, 0.0);
std::array<double, 3> tmpMeshPos{
0.0, 0.0, 0.0}; // Vector to temporarily store mesh node location

// TODO: This is looping over the wrong buckets - Nodes instead of faces
// Is this even required anymore? Probly can delete

// std::array<double, 3> tmpMeshPos{
// 0.0, 0.0, 0.0}; // Vector to temporarily store mesh node location
// stk::mesh::Selector sel(
// meta.locally_owned_part() & stk::mesh::selectUnion(partVec));
// const auto& bkts = bulk_->get_buckets(stk::topology::NODE_RANK, sel);
Expand Down
2 changes: 0 additions & 2 deletions src/aero/fsi/MapLoad.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ mapTowerLoad(
std::vector<double> coord_bip(3, 0.0);
std::vector<double> coordref_bip(3, 0.0);

std::array<double, 3> face_center;

std::array<double, 3> tforce_bip;

std::vector<double> tmpNodePos(
Expand Down
60 changes: 29 additions & 31 deletions src/aero/fsi/OpenfastFSI.C
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,8 @@ OpenfastFSI::bcast_turbine_params(int iTurb)
tDoubleParams[3 + i] = fsiTurbineData_[iTurb]->params_.TurbineHubPos[i];
}
}
int iError =
MPI_Bcast(tIntParams.data(), 7, MPI_INT, turbProc, bulk_->parallel());
iError =
MPI_Bcast(tDoubleParams.data(), 6, MPI_DOUBLE, turbProc, bulk_->parallel());
MPI_Bcast(tIntParams.data(), 7, MPI_INT, turbProc, bulk_->parallel());
MPI_Bcast(tDoubleParams.data(), 6, MPI_DOUBLE, turbProc, bulk_->parallel());

if (bulk_->parallel_rank() != turbProc) {
fsiTurbineData_[iTurb]->params_.TurbID = tIntParams[0];
Expand Down Expand Up @@ -351,25 +349,25 @@ OpenfastFSI::compute_mapping()
FAST.getBladeChord(fsiTurbineData_[i]->brFSIdata_.bld_chord.data(), i);
}

int iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.twr_ref_pos.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
int nBlades = fsiTurbineData_[i]->params_.numBlades;
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_ref_pos.data(), nTotBldNodes * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_root_ref_pos.data(), nBlades * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.hub_ref_pos.data(), 6, MPI_DOUBLE,
turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.nac_ref_pos.data(), 6, MPI_DOUBLE,
turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_rloc.data(), nTotBldNodes,
MPI_DOUBLE, turbProc, bulk_->parallel());
// No need to bcast chord
Expand Down Expand Up @@ -397,7 +395,7 @@ OpenfastFSI::predict_struct_timestep(const double curTime)
}

void
OpenfastFSI::advance_struct_timestep(const double curTime)
OpenfastFSI::advance_struct_timestep(const double /* curTime */)
{

timer_start(openFastTimer_);
Expand All @@ -414,7 +412,7 @@ OpenfastFSI::advance_struct_timestep(const double curTime)
}

void
OpenfastFSI::send_loads(const double curTime)
OpenfastFSI::send_loads(const double /* curTime */)
{

int nTurbinesGlob = FAST.get_nTurbinesGlob();
Expand All @@ -426,7 +424,7 @@ OpenfastFSI::send_loads(const double curTime)

int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
if (bulk_->parallel_rank() == turbProc) {
int iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.twr_ld.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
Expand All @@ -435,7 +433,7 @@ OpenfastFSI::send_loads(const double curTime)
fsiTurbineData_[i]->brFSIdata_.twr_ld[k];
FAST.setTowerForces(fsiTurbineData_[i]->brFSIdata_.twr_ld, i);

iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.bld_ld.data(),
nTotBldNodes * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
for (int k = 0; k < nTotBldNodes * 6; k++)
Expand All @@ -445,11 +443,11 @@ OpenfastFSI::send_loads(const double curTime)
FAST.setBladeForces(fsiTurbineData_[i]->brFSIdata_.bld_ld, i);

} else {
int iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.twr_ld.data(), NULL,
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.bld_ld.data(), NULL,
(nTotBldNodes) * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
}
Expand All @@ -458,7 +456,7 @@ OpenfastFSI::send_loads(const double curTime)
}

void
OpenfastFSI::get_displacements(double current_time)
OpenfastFSI::get_displacements(double /* current_time */)
{

int nTurbinesGlob = FAST.get_nTurbinesGlob();
Expand All @@ -484,38 +482,38 @@ OpenfastFSI::get_displacements(double current_time)
fsiTurbineData_[i]->brFSIdata_.nac_vel.data(), i);
}

int iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.twr_def.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
int numBlades = fsiTurbineData_[i]->params_.numBlades;
int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_def.data(), nTotBldNodes * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_root_def.data(), numBlades * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_pitch.data(), numBlades, MPI_DOUBLE,
turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.hub_def.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.nac_def.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.twr_vel.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_vel.data(), nTotBldNodes * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.hub_vel.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.nac_vel.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());

Expand Down Expand Up @@ -651,19 +649,19 @@ OpenfastFSI::map_loads(const int tStep, const double curTime)
fsiTurbineData_[i]->mapLoads();
int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
if (bulk_->parallel_rank() == turbProc) {
int iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.twr_ld.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.bld_ld.data(),
nTotBldNodes * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
} else {
int iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.twr_ld.data(), NULL,
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.bld_ld.data(), NULL,
(nTotBldNodes) * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
}
Expand Down
10 changes: 5 additions & 5 deletions src/ngp_algorithms/BuoyancySourceAlg.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BuoyancySourceAlg::execute()
using EntityInfoType = nalu_ngp::EntityInfo<stk::mesh::NgpMesh>;
const auto& meshInfo = realm_.mesh_info();
const auto& meta = meshInfo.meta();
const int ndim = meta.spatial_dimension();
const unsigned ndim = meta.spatial_dimension();
const auto ngpMesh = meshInfo.ngp_mesh();
const auto& fieldMgr = meshInfo.ngp_field_manager();
const auto density = fieldMgr.template get_field<double>(density_);
Expand All @@ -60,7 +60,7 @@ BuoyancySourceAlg::execute()
double gravity[3] = {0.0, 0.0, 0.0};

if (realm_.solutionOptions_->gravity_.size() >= ndim)
for (int idim = 0; idim < ndim; ++idim)
for (unsigned idim = 0; idim < ndim; ++idim)
gravity[idim] = realm_.solutionOptions_->gravity_[idim];

source.sync_to_device();
Expand All @@ -70,7 +70,7 @@ BuoyancySourceAlg::execute()
algName, ngpMesh, sel, KOKKOS_LAMBDA(const EntityInfoType& einfo) {
NALU_ALIGNED DblType av[NDimMax];

for (int d = 0; d < ndim; ++d)
for (unsigned d = 0; d < ndim; ++d)
av[d] = edgeAreaVec.get(einfo.meshIdx, d);

const auto nodeL = ngpMesh.fast_mesh_index(einfo.entityNodes[0]);
Expand All @@ -81,13 +81,13 @@ BuoyancySourceAlg::execute()

DblType weight = 0.0;

for (int i = 0; i < ndim; ++i) {
for (unsigned i = 0; i < ndim; ++i) {
weight += stk::math::pow(gravity[i] * av[i], 2);
}

weight = stk::math::sqrt(weight);

for (int i = 0; i < ndim; ++i) {
for (unsigned i = 0; i < ndim; ++i) {
sourceOps(einfo, 0, i) += weight * rhoIp * gravity[i];
sourceOps(einfo, 1, i) += weight * rhoIp * gravity[i];
}
Expand Down
1 change: 0 additions & 1 deletion src/ngp_algorithms/NodalBuoyancyAlgDriver.C
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ NodalBuoyancyAlgDriver::post_work()
// Divide by weight here

using Traits = nalu_ngp::NGPMeshTraits<>;
using EntityInfoType = nalu_ngp::EntityInfo<stk::mesh::NgpMesh>;

const auto& ngpMesh = meshInfo.ngp_mesh();

Expand Down
2 changes: 1 addition & 1 deletion src/user_functions/DropletVOFAuxFunction.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ DropletVOFAuxFunction::DropletVOFAuxFunction(const std::vector<double>& params)
droppos_x_(0.0),
droppos_y_(0.0),
droppos_z_(0.0),
radius_(0.1),
surf_pos_(0.0),
surf_idx_dbl_(1.0),
radius_(0.1),
interface_thickness_(0.0025)
{
// check size and populate
Expand Down
Loading