Skip to content

Commit

Permalink
Merge pull request #23 from gismo/warning_fixes
Browse files Browse the repository at this point in the history
Fix compiler warnings when compiling with `GISMO_WITH_WARNINGS=ON`
  • Loading branch information
hverhelst authored Jan 5, 2025
2 parents fcf19de + a3ab872 commit 6e6e5cc
Show file tree
Hide file tree
Showing 36 changed files with 354 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
- name: "Run for ${{ matrix.os }}"
shell: bash
working-directory: ${{runner.workspace}}
run: ctest -S ${{ github.event.repository.name }}/gismo/cmake/ctest_script.cmake -D CTEST_BUILD_NAME="${{ github.event.repository.name }}_actions_$GITHUB_RUN_NUMBER" -D CTEST_SITE="${{ matrix.os }}_[actions]" -D CMAKE_ARGS="-DCMAKE_BUILD_TYPE=$BUILD_TYPE;-DCMAKE_CXX_STANDARD=11;-DGISMO_WITH_XDEBUG=ON;-DGISMO_BUILD_UNITTESTS=ON" -D GISMO_OPTIONAL='gsStructuralAnalysis\\;gsKLShell\\;gsSpectra\\;${{ github.event.repository.name }}' -Q
run: ctest -S ${{ github.event.repository.name }}/gismo/cmake/ctest_script.cmake -D CTEST_BUILD_NAME="${{ github.event.repository.name }}_actions_$GITHUB_RUN_NUMBER" -D CTEST_CONFIGURATION_TYPE=RelWithDebInfo -D LABELS_FOR_SUBPROJECTS="gsUnstructuredSplines-tutorials" -D CTEST_SITE="${{ matrix.os }}_[actions]" -D CMAKE_ARGS="-DCMAKE_BUILD_TYPE=$BUILD_TYPE;-DCMAKE_CXX_STANDARD=11;-DGISMO_WITH_XDEBUG=ON;-DGISMO_BUILD_UNITTESTS=ON" -D GISMO_OPTIONAL='gsStructuralAnalysis\\;gsKLShell\\;gsSpectra\\;${{ github.event.repository.name }}' -Q
6 changes: 3 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ aux_cpp_directory(${CMAKE_CURRENT_SOURCE_DIR} FILES)
foreach(file ${FILES})
add_gismo_executable(${file})
get_filename_component(tarname ${file} NAME_WE) # name without extension
set_property(TEST ${tarname} PROPERTY LABELS "${PROJECT_NAME}")
set_property(TEST ${tarname} PROPERTY LABELS "${PROJECT_NAME}-examples")
if(GISMO_BUILD_EXAMPLES)
set_target_properties(${tarname} PROPERTIES FOLDER "${PROJECT_NAME}")
set_target_properties(${tarname} PROPERTIES FOLDER "${PROJECT_NAME}")
add_dependencies(${PROJECT_NAME}-examples ${tarname})
else(GISMO_BUILD_EXAMPLES)
set_target_properties(${tarname} PROPERTIES
FOLDER "${PROJECT_NAME}"
EXCLUDE_FROM_ALL TRUE)
endif(GISMO_BUILD_EXAMPLES)
add_dependencies(${PROJECT_NAME}-examples ${tarname})
# install the example executables (optionally)
install(TARGETS ${tarname} DESTINATION "${BIN_INSTALL_DIR}" COMPONENT exe OPTIONAL)
endforeach(file ${FILES})
4 changes: 2 additions & 2 deletions examples/biharmonic_planar_eigenvalue_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int main(int argc, char *argv[])
bool first = false;
bool write = false;

index_t method = 0;
index_t method = NITSCHE;

index_t numRefine = 3;
index_t degree = 3;
Expand All @@ -181,7 +181,7 @@ int main(int argc, char *argv[])
real_t penalty_init = -1.0;
std::string output;

std::string fn = "planar/1p_square.xml";
std::string fn = "planar/6p_square_linear.xml";

gsCmdLine cmd("Tutorial on solving a Biharmonic problem with different spaces.");
// Flags related to the method (default: Approx C1 method)
Expand Down
4 changes: 2 additions & 2 deletions examples/biharmonic_planar_example.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @file biharmonic_planar_example.cpp
@brief Tutorial on how to use expression assembler and
@brief Tutorial on how to use expression assembler and
gsUnstructuredSplines to solve the Biharmonic equation
This file is part of the G+Smo library.
Expand Down Expand Up @@ -70,7 +70,7 @@ int main(int argc, char *argv[])
bool plotApproxC1 = false;
bool mesh = false;

index_t method = 0;
index_t method = NITSCHE;

index_t numRefine = 3;
index_t numRefineIni = 1;
Expand Down
6 changes: 3 additions & 3 deletions examples/biharmonic_surface2_example.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @file biharmonic_surface2_example.cpp
@brief Tutorial on how to use expression assembler and
@brief Tutorial on how to use expression assembler and
gsUnstructuredSplines to solve the Surface Biharmonic equation
This file is part of the G+Smo library.
Expand Down Expand Up @@ -910,7 +910,7 @@ int main(int argc, char *argv[])
bool plot = false;
bool mesh = false;

index_t method = 0;
index_t method = NITSCHE;

index_t numRefine = 5;
index_t degree = 3;
Expand All @@ -924,7 +924,7 @@ int main(int argc, char *argv[])
bool residual = false;

std::string output;
std::string fn = "surfaces/surface_roof.xml";
std::string fn = "surfaces/6p_hyperboloid.xml";
std::string geometry;

gsCmdLine cmd("Example for solving the biharmonic problem (single patch only).");
Expand Down
6 changes: 3 additions & 3 deletions examples/biharmonic_surface_example.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @file biharmonic_surface_example.cpp
@brief Tutorial on how to use expression assembler and
@brief Tutorial on how to use expression assembler and
gsUnstructuredSplines to solve the Surface Biharmonic equation
This file is part of the G+Smo library.
Expand Down Expand Up @@ -445,8 +445,8 @@ int main(int argc, char *argv[])
bool second = false;
bool residual = false;

std::string fn;
std::string geometry = "g1000";
std::string fn= "surfaces/simple.xml";
std::string geometry;

gsCmdLine cmd("Example for solving the biharmonic problem (single patch only).");
cmd.addInt("p", "degree","Set discrete polynomial degree", degree);
Expand Down
2 changes: 1 addition & 1 deletion examples/create_multipatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char *argv[])
index_t degree = 3;
index_t smoothness = 2;

std::string fn, basisOutput, geoOutput;
std::string fn="surfaces/6p_hyperboloid.xml", basisOutput, geoOutput;

gsCmdLine cmd("Tutorial on solving a Biharmonic problem with different spaces.");
// Flags related to the method (default: Approx C1 method)
Expand Down
11 changes: 4 additions & 7 deletions examples/kirchhoff-Love_multipatch_buckling_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ int main(int argc, char *argv[])
real_t shift = 0.01;

std::string fn1,fn2,fn3;
fn1 = "pde/2p_square_geom.xml";
fn2 = "pde/2p_square_bvp.xml";
fn1 = "surfaces/shell/2p_cornerSimo.xml";
fn2 = "pde/shell/2p_cornerSimo_bvp.xml";
fn3 = "options/solver_options.xml";
std::string out = "BucklingResults";

Expand Down Expand Up @@ -153,9 +153,6 @@ int main(int argc, char *argv[])
for (index_t k =0; k!=points.cols(); k++)
pLoads.addLoad(points.col(k), loads.col(k), pid_ploads.at(k) ); // in parametric domain!

gsInfo<<pLoads;
gsInfo<<mp.patch(pid_ploads.at(0)).eval(pLoads[0].point);

// // Loads
// gsPointLoads<real_t> pLoads = gsPointLoads<real_t>();
// gsMatrix<> points,loads;
Expand Down Expand Up @@ -459,9 +456,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = output + util::to_string(m) + "_";
collection.addTimestep(fileName,p,m,".vts");
collection.addPart(fileName+".vts",m,"Solution",p);
if (mesh)
collection.addTimestep(fileName,p,m,"_mesh.vtp");
collection.addPart(fileName+"_mesh.vtp",m,"Mesh",p);
}
}
collection.save();
Expand Down
24 changes: 12 additions & 12 deletions examples/kirchhoff-Love_multipatch_post-buckling_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ int main(int argc, char *argv[])
bool SingularPoint = false;
bool quasiNewton = false;
index_t quasiNewtonInt = -1;
index_t numRefine = 2;
index_t numRefine = 0;
index_t degree = 3;
index_t smoothness = 2;
index_t method = 0;
index_t method = 1;
std::string input;

index_t step = 10;
Expand All @@ -74,8 +74,8 @@ int main(int argc, char *argv[])
real_t shift = -1e2;

std::string fn1,fn2,fn3;
fn1 = "pde/2p_square_geom.xml";
fn2 = "pde/2p_square_bvp.xml";
fn1 = "surfaces/shell/2p_cornerSimo.xml";
fn2 = "pde/shell/2p_cornerSimo_bvp.xml";
fn3 = "options/solver_options.xml";
std::string dirname = "ArcLengthResults";

Expand Down Expand Up @@ -547,9 +547,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = output + util::to_string(m) + "_";
collection.addTimestep(fileName,p,m,".vts");
collection.addPart(fileName+".vts",m,"Solution",p);
if (mesh)
collection.addTimestep(fileName,p,m,"_mesh.vtp");
collection.addPart(fileName+"_mesh.vtp",m,"Mesh",p);
}
}
collection.save();
Expand Down Expand Up @@ -729,9 +729,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = output + util::to_string(k) + "_";
collection.addTimestep(fileName,p,k,".vts");
collection.addPart(fileName+".vts",k,"Solution",p);
if (mesh)
collection.addTimestep(fileName,p,k,"_mesh.vtp");
collection.addPart(fileName+"_mesh.vtp",k,"Mesh",p);
}
}

Expand All @@ -758,9 +758,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = "MembraneStress" + util::to_string(k) + "_";
membraneStressCollection.addTimestep(fileName,p,k,".vts");
membraneStressCollection.addPart(fileName+".vts",k,"Solution",p);
if (mesh)
membraneStressCollection.addTimestep(fileName,p,k,"_mesh.vtp");
membraneStressCollection.addPart(fileName+"_mesh.vtp",k,"Mesh",p);
}

gsPiecewiseFunction<> flexuralStresses;
Expand All @@ -770,9 +770,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = "FlexuralStress" + util::to_string(k) + "_";
flexuralStressCollection.addTimestep(fileName,p,k,".vts");
flexuralStressCollection.addPart(fileName+".vts",k,"Solution",p);
if (mesh)
flexuralStressCollection.addTimestep(fileName,p,k,"_mesh.vtp");
flexuralStressCollection.addPart(fileName+"_mesh.vtp",k,"Mesh",p);
}

}
Expand Down
5 changes: 4 additions & 1 deletion examples/kirchhoff-Love_multipatch_vibration_example_XML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ int main(int argc, char *argv[])

real_t shift = 0.01;

std::string geomFileName,basisFileName,bvpFileName,optFileName;
std::string geomFileName = "multipatches/2p_cornerSimo_AlmostC1_geom.xml";
std::string basisFileName= "multipatches/2p_cornerSimo_AlmostC1_basis.xml";
std::string bvpFileName = "pde/shell/2p_cornerSimo_bvp.xml";
std::string optFileName;
optFileName = "options/solver_options.xml";
std::string out = "ModalResults";

Expand Down
13 changes: 5 additions & 8 deletions examples/kirchhoff-Love_weak_multipatch_buckling_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ int main(int argc, char *argv[])
real_t bcDirichlet = 1e3;
real_t bcClamped = 1e3;

real_t ifcDirichlet = 1.0;
real_t ifcClamped = 1.0;
real_t ifcPenalty = 1.0;

real_t shift = 0.01;

Expand All @@ -60,8 +59,7 @@ int main(int argc, char *argv[])
gsCmdLine cmd("Composite basis tests.");
cmd.addReal( "D", "Dir", "Dirichlet BC penalty scalar", bcDirichlet );
cmd.addReal( "C", "Cla", "Clamped BC penalty scalar", bcClamped );
cmd.addReal( "d", "DirIfc", "Dirichlet penalty scalar", ifcDirichlet );
cmd.addReal( "c", "ClaIfc", "Clamped penalty scalar", ifcClamped );
cmd.addReal( "d", "DirIfc", "Dirichlet penalty scalar", ifcPenalty );
cmd.addString( "G", "geom","File containing the geometry", fn1 );
cmd.addString( "B", "bvp", "File containing the Boundary Value Problem (BVP)", fn2 );
cmd.addString( "O", "opt", "File containing solver options", fn3 );
Expand Down Expand Up @@ -206,8 +204,7 @@ int main(int argc, char *argv[])
assembler.options().setReal("WeakClamped",bcClamped);
// Set the penalty parameter for the interface C1 continuity
assembler.options().setInt("Continuity",-1);
assembler.options().setReal("IfcDirichlet",ifcDirichlet);
assembler.options().setReal("IfcClamped",ifcClamped);
assembler.options().setReal("IfcPenalty",ifcPenalty);
assembler.addWeakC0(mp.topology().interfaces());
assembler.addWeakC1(mp.topology().interfaces());
assembler.initInterfaces();
Expand Down Expand Up @@ -326,9 +323,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = output + util::to_string(m) + "_";
collection.addTimestep(fileName,p,m,".vts");
collection.addPart(fileName+".vts",m,"Solution",p);
if (mesh)
collection.addTimestep(fileName,p,m,"_mesh.vtp");
collection.addPart(fileName+"_mesh.vtp",m,"Mesh",p);
}
}
collection.save();
Expand Down
26 changes: 11 additions & 15 deletions examples/kirchhoff-Love_weak_multipatch_post-buckling_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char *argv[])
bool SingularPoint = false;
bool quasiNewton = false;
index_t quasiNewtonInt = -1;
index_t numRefine = 2;
index_t numRefine = 0;
index_t degree = 3;
index_t smoothness = 2;
std::string input;
Expand All @@ -69,15 +69,14 @@ int main(int argc, char *argv[])
real_t shift = -1e2;

std::string fn1,fn2,fn3;
fn1 = "pde/2p_square_geom.xml";
fn2 = "pde/2p_square_bvp.xml";
fn1 = "surfaces/shell/2p_cornerSimo.xml";
fn2 = "pde/shell/2p_cornerSimo_bvp.xml";
fn3 = "options/solver_options.xml";
std::string dirname = "ArcLengthResults";

real_t bcDirichlet = 1e3;
real_t bcClamped = 1e3;
real_t ifcDirichlet = 1.0;
real_t ifcClamped = 1.0;
real_t ifcPenalty = 1.0;

index_t nmodes = 15;

Expand All @@ -86,8 +85,7 @@ int main(int argc, char *argv[])
gsCmdLine cmd("Composite basis tests.");
cmd.addReal( "D", "Dir", "Dirichlet BC penalty scalar", bcDirichlet );
cmd.addReal( "C", "Cla", "Clamped BC penalty scalar", bcClamped );
cmd.addReal( "d", "DirIfc", "Dirichlet penalty scalar", ifcDirichlet );
cmd.addReal( "c", "ClaIfc", "Clamped penalty scalar", ifcClamped );
cmd.addReal( "d", "DirIfc", "Dirichlet penalty scalar", ifcPenalty );

cmd.addString( "G", "geom","File containing the geometry", fn1 );
cmd.addString( "B", "bvp", "File containing the Boundary Value Problem (BVP)", fn2 );
Expand Down Expand Up @@ -272,8 +270,7 @@ int main(int argc, char *argv[])
assembler.options().setReal("WeakClamped",bcClamped);
// Set the penalty parameter for the interface C1 continuity
assembler.options().setInt("Continuity",-1);
assembler.options().setReal("IfcDirichlet",ifcDirichlet);
assembler.options().setReal("IfcClamped",ifcClamped);
assembler.options().setReal("IfcPenalty",ifcPenalty);
assembler.addWeakC0(mp.topology().interfaces());
assembler.addWeakC1(mp.topology().interfaces());
assembler.initInterfaces();
Expand Down Expand Up @@ -393,9 +390,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = output + util::to_string(m) + "_";
collection.addTimestep(fileName,p,m,".vts");
collection.addPart(fileName+".vts",m,"Solution",p);
if (mesh)
collection.addTimestep(fileName,p,m,"_mesh.vtp");
collection.addPart(fileName+"_mesh.vtp",m,"Mesh",p);
}

}
Expand All @@ -420,8 +417,7 @@ int main(int argc, char *argv[])
assembler.options().setReal("WeakClamped",bcClamped);
// Set the penalty parameter for the interface C1 continuity
assembler.options().setInt("Continuity",-1);
assembler.options().setReal("IfcDirichlet",ifcDirichlet);
assembler.options().setReal("IfcClamped",ifcClamped);
assembler.options().setReal("IfcPenalty",ifcPenalty);
assembler.addWeakC0(mp.topology().interfaces());
assembler.addWeakC1(mp.topology().interfaces());
assembler.initInterfaces();
Expand Down Expand Up @@ -548,9 +544,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = output + util::to_string(k) + "_";
collection.addTimestep(fileName,p,k,".vts");
collection.addPart(fileName+".vts",k,"Solution",p);
if (mesh)
collection.addTimestep(fileName,p,k,"_mesh.vtp");
collection.addPart(fileName+"_mesh.vtp",k,"Mesh",p);
}
}

Expand Down
13 changes: 5 additions & 8 deletions examples/kirchhoff-Love_weak_multipatch_vibration_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ int main(int argc, char *argv[])
real_t bcDirichlet = 1e3;
real_t bcClamped = 1e3;

real_t ifcDirichlet = 1.0;
real_t ifcClamped = 1.0;
real_t ifcPenalty = 1.0;

real_t shift = 0.01;

Expand All @@ -59,8 +58,7 @@ int main(int argc, char *argv[])
gsCmdLine cmd("Composite basis tests.");
cmd.addReal( "D", "Dir", "Dirichlet BC penalty scalar", bcDirichlet );
cmd.addReal( "C", "Cla", "Clamped BC penalty scalar", bcClamped );
cmd.addReal( "d", "DirIfc", "Dirichlet penalty scalar", ifcDirichlet );
cmd.addReal( "c", "ClaIfc", "Clamped penalty scalar", ifcClamped );
cmd.addReal( "d", "DirIfc", "Dirichlet penalty scalar", ifcPenalty );
cmd.addString( "G", "geom","File containing the geometry", fn1 );
cmd.addString( "B", "bvp", "File containing the Boundary Value Problem (BVP)", fn2 );
cmd.addString( "O", "opt", "File containing solver options", fn3 );
Expand Down Expand Up @@ -176,8 +174,7 @@ int main(int argc, char *argv[])
assembler.options().setReal("WeakClamped",bcClamped);
// Set the penalty parameter for the interface C1 continuity
assembler.options().setInt("Continuity",-1);
assembler.options().setReal("IfcDirichlet",ifcDirichlet);
assembler.options().setReal("IfcClamped",ifcClamped);
assembler.options().setReal("IfcPenalty",ifcPenalty);
assembler.addWeakC0(mp.topology().interfaces());
assembler.addWeakC1(mp.topology().interfaces());
assembler.initInterfaces();
Expand Down Expand Up @@ -283,9 +280,9 @@ int main(int argc, char *argv[])
for (size_t p = 0; p!=mp.nPatches(); p++)
{
fileName = output + util::to_string(m) + "_";
collection.addTimestep(fileName,p,m,".vts");
collection.addPart(fileName+".vts",m,"Solution",p);
if (mesh)
collection.addTimestep(fileName,p,m,"_mesh.vtp");
collection.addPart(fileName+"_mesh.vtp",m,"Mesh",p);
}
}
collection.save();
Expand Down
Loading

0 comments on commit 6e6e5cc

Please sign in to comment.