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 coming from GISMO_WITH_WARNINGS=ON #21

Merged
merged 11 commits into from
Dec 10, 2024
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ 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='gsSpectra\\;gsKLShell\\;gsElasticity\\;${{ github.event.repository.name }}' -Q
# Add gsStructuralAnalysis-solvers to unittests?? On simple test XML. Needs gsUnstructuredSplines for some multi-patch solvers
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="gsStructuralAnalysis-tutorials;unittests" -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='gsKLShell\\;gsElasticity\\;${{ github.event.repository.name }}' -Q
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ if( (NOT GISMO_BUILD_LIB) )
endif()
endif()

add_custom_target(${PROJECT_NAME})

# add filedata folder
add_definitions(-DSTRAN_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/filedata/")

Expand Down
8 changes: 4 additions & 4 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ 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}-benchmarks")
if(GISMO_BUILD_EXAMPLES)
set_target_properties(${tarname} PROPERTIES FOLDER "${PROJECT_NAME}")
set_target_properties(${tarname} PROPERTIES FOLDER "${PROJECT_NAME}")
add_dependencies(${PROJECT_NAME}-benchmarks ${tarname})
add_dependencies(${PROJECT_NAME}-all ${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}-benchmarks ${tarname})
add_dependencies(${PROJECT_NAME}-all ${tarname})
# install the example executables (optionally)
install(TARGETS ${tarname} DESTINATION "${BIN_INSTALL_DIR}" COMPONENT exe OPTIONAL)
endforeach(file ${FILES})
5 changes: 2 additions & 3 deletions benchmarks/benchmark_Balloon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@ int main (int argc, char** argv)
parameters[7] = &alpha3;
}

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

gsOptionList options;
if (material==0 && impl==1)
{
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand Down Expand Up @@ -424,7 +424,6 @@ int main (int argc, char** argv)
Smembrane_p.save();
}

delete materialMatrix;
delete assembler;
delete arcLength;

Expand Down
10 changes: 2 additions & 8 deletions benchmarks/benchmark_Beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,10 @@ int main (int argc, char** argv)
parameters[0] = &E;
parameters[1] = &nu;

gsMaterialMatrixBase<real_t>* materialMatrix;

gsOptionList options;
options.addInt("Material","Material model: (0): SvK | (1): NH | (2): NH_ext | (3): MR | (4): Ogden",0);
options.addInt("Implementation","Implementation: (0): Composites | (1): Analytical | (2): Generalized | (3): Spectral",1);
materialMatrix = getMaterialMatrix<3,real_t>(mp,t,parameters,rho,options);
gsMaterialMatrixLinear<3,real_t> materialMatrix(mp,t,E,nu,rho);

gsThinShellAssemblerBase<real_t>* assembler;
assembler = new gsThinShellAssembler<3, real_t, true >(mp,dbasis,BCs,force,materialMatrix);
assembler = new gsThinShellAssembler<3, real_t, true >(mp,dbasis,BCs,force,&materialMatrix);

// Construct assembler object
assembler->setOptions(opts);
Expand Down Expand Up @@ -389,7 +384,6 @@ int main (int argc, char** argv)
if (plot)
collection.save();

delete materialMatrix;
delete assembler;
delete arcLength;

Expand Down
5 changes: 2 additions & 3 deletions benchmarks/benchmark_Cylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ int main (int argc, char** argv)
parameters[7] = &alpha3;
}

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

gsOptionList options;
if (material==0 && impl==1)
{
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand Down Expand Up @@ -413,7 +413,6 @@ int main (int argc, char** argv)
Smembrane_p.save();
}

delete materialMatrix;
delete assembler;
delete arcLength;

Expand Down
1 change: 1 addition & 0 deletions benchmarks/benchmark_Elasticity_Beam_APALM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ int main (int argc, char** argv)
#else//gsElasticity_ENABLED
int main(int argc, char *argv[])
{
GISMO_UNUSED(argc); GISMO_UNUSED(argv);
gsWarn<<"G+Smo is not compiled with the gsElasticity module.";
return EXIT_FAILURE;
}
Expand Down
7 changes: 3 additions & 4 deletions benchmarks/benchmark_FrustrumALM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ int main (int argc, char** argv)
parameters[7] = &alpha3;
}

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

gsOptionList options;
if (material==0 && impl==1)
{
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand All @@ -296,7 +296,7 @@ int main (int argc, char** argv)
// Assemble linear system to obtain the force vector
assembler->assemble();
gsVector<> Force = assembler->rhs();

// Function for the Jacobian
gsStructuralAnalysisOps<real_t>::Jacobian_t Jacobian = [&time,&stopwatch,&assembler,&mp_def](gsVector<real_t> const &x, gsSparseMatrix<real_t> & m)
{
Expand Down Expand Up @@ -458,7 +458,6 @@ int main (int argc, char** argv)
Smembrane_p.save();
}

delete materialMatrix;
delete assembler;
delete arcLength;

Expand Down
5 changes: 2 additions & 3 deletions benchmarks/benchmark_FrustrumDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ int main (int argc, char** argv)
parameters[7] = &alpha3;
}

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

gsOptionList options;
if (material==0 && impl==1)
{
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand Down Expand Up @@ -432,7 +432,6 @@ int main (int argc, char** argv)
gsInfo<<"Total ellapsed assembly time: \t\t"<<time<<" s\n";
gsInfo<<"Total ellapsed solution time (incl. assembly): \t"<<totaltime<<" s\n";

delete materialMatrix;
delete assembler;

return result;
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/benchmark_Frustrum_APALM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class gsAPALMFrustrum : public gsAPALM<T>

}

void parallelIntervalOutput(const std::vector<std::pair<gsVector<T>,T>> & stepSolutions, const std::vector<T> & stepTimes, index_t level, index_t ID)
void parallelIntervalOutput(const std::vector<std::pair<gsVector<T>,T>> & stepSolutions, const std::vector<T> & /* stepTimes */, index_t level, index_t ID)
{
gsStructuralAnalysisOutput<real_t> data(m_dirname + "/interval_"+std::to_string(ID)+".csv",m_refPoints);
gsMultiPatch<T> deformation,mp_tmp, mp;
Expand Down Expand Up @@ -364,14 +364,14 @@ int main (int argc, char** argv)
parameters[7] = &alpha3;
}

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

gsOptionList options;
if (material==0 && impl==1)
{
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand All @@ -398,7 +398,7 @@ int main (int argc, char** argv)
// Assemble linear system to obtain the force vector
assembler->assemble();
gsVector<> Force = assembler->rhs();

// Function for the Jacobian
gsStructuralAnalysisOps<real_t>::Jacobian_t Jacobian = [&time,&stopwatch,&assembler,&mp_def](gsVector<real_t> const &x, gsSparseMatrix<real_t> & m)
{
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/benchmark_MaterialTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,14 @@ int main (int argc, char** argv)
parameters[7] = &alpha3;
}

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

gsOptionList options;
if (material==0 && impl==1)
{
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<2,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<2,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand Down Expand Up @@ -574,7 +574,6 @@ int main (int argc, char** argv)
Smembrane_p.save();
}

delete materialMatrix;
delete assembler;
delete arcLength;

Expand Down
5 changes: 2 additions & 3 deletions benchmarks/benchmark_MaterialTestConv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ int main (int argc, char** argv)
parameters[7] = &alpha3;
}

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

gsOptionList options;
if (material==0 && impl==1)
{
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<2,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<2,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand Down Expand Up @@ -328,7 +328,6 @@ int main (int argc, char** argv)
gsInfo<< std::setprecision(12) <<strains.at(k)<<",";
gsInfo<<"\n";

delete materialMatrix;
delete assembler;

return result;
Expand Down
22 changes: 10 additions & 12 deletions benchmarks/benchmark_Pillow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ int main (int argc, char** argv)
gsConstantFunction<> rho(Density,3);
gsConstantFunction<> ratio(Ratio,3);

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>* materialMatrixTFT;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrixTFT;
gsOptionList options;

std::vector<gsFunctionSet<>*> parameters;
Expand All @@ -214,16 +214,16 @@ int main (int argc, char** argv)
options.addInt("Material","Material model: (0): SvK | (1): NH | (2): NH_ext | (3): MR | (4): Ogden",0);
options.addInt("Implementation","Implementation: (0): Composites | (1): Analytical | (2): Generalized | (3): Spectral",1);
materialMatrix = getMaterialMatrix<3,real_t>(mp,t,parameters,rho,options);
materialMatrixTFT = new gsMaterialMatrixTFT<3,real_t,true>(static_cast<gsMaterialMatrixBaseDim<3,real_t> * >(materialMatrix));
// materialMatrixTFT = new gsMaterialMatrixTFT<3,real_t,false>(static_cast<gsMaterialMatrixBaseDim<3,real_t> * >(materialMatrix));
materialMatrixTFT = memory::make_unique(new gsMaterialMatrixTFT<3,real_t,true>(*materialMatrix));
// materialMatrixTFT = new gsMaterialMatrixTFT<3,real_t,false>(materialMatri));
}
else if (material==1 || material==2)
{
options.addInt("Material","Material model: (0): SvK | (1): NH | (2): NH_ext | (3): MR | (4): Ogden",material);
options.addSwitch("Compressibility","Compressibility: (false): Imcompressible | (true): Compressible",Compressibility);
options.addInt("Implementation","Implementation: (0): Composites | (1): Analytical | (2): Generalized | (3): Spectral",impl);
materialMatrix = getMaterialMatrix<3,real_t>(mp,t,parameters,rho,options);
materialMatrixTFT = new gsMaterialMatrixTFT<3,real_t,false>(static_cast<gsMaterialMatrixBaseDim<3,real_t> * >(materialMatrix));
materialMatrixTFT = memory::make_unique(new gsMaterialMatrixTFT<3,real_t,false>(*materialMatrix));
// dynamic_cast<gsMaterialMatrixTFT<3,real_t,false> *>(materialMatrixTFT)->updateDeformed(&mp_def);
}
else
Expand All @@ -233,7 +233,7 @@ int main (int argc, char** argv)
// gsMaterialMatrixTFT<3,real_t,false> * materialMatrixTFT = new gsMaterialMatrixTFT<3,real_t,false>(static_cast<gsMaterialMatrixBaseDim<3,real_t> * >(materialMatrix));

materialMatrixTFT->options().setReal("SlackMultiplier",1e-6);
// materialMatrixTFT->options().setSwitch("Explicit",true);
// materialMatrixTFT->options().setSwitch("Explicit",true);

gsThinShellAssemblerBase<real_t>* assembler;
if (TFT)
Expand Down Expand Up @@ -339,9 +339,9 @@ int main (int argc, char** argv)
neuDataX<<maxLoad*(1-load_fac),0,0;
neuDataY<<0,-maxLoad*(1-load_fac),0;
neuX.setValue(neuDataX,3);
neuY.setValue(neuDataY,3);
neuY.setValue(neuDataY,3);
}
else
else
{
neuDataX<<0,0,0;
neuDataY<<0,0,0;
Expand Down Expand Up @@ -405,7 +405,7 @@ int main (int argc, char** argv)
std::string fileName;
gsField<> solField(mp_def, deformation);
gsInfo<<"Plotting in Paraview...\n";

fileName = dirname + "/" + "solution" + util::to_string(step);
gsWriteParaview<>( solField, fileName, 1000, true);
solcollection.addPart(gsFileManager::getFilename(fileName) + "0.vts",step);
Expand Down Expand Up @@ -525,11 +525,9 @@ int main (int argc, char** argv)
gsWriteParaview(stretchDir1,dirname + "/" + "PrincipalDirection1",5000);
gsWriteParaview(stretchDir2,dirname + "/" + "PrincipalDirection2",5000);
gsWriteParaview(stretchDir3,dirname + "/" + "PrincipalDirection3",5000);

}

delete materialMatrix;
delete materialMatrixTFT;
delete assembler;

return EXIT_SUCCESS;
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/benchmark_Roof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int main (int argc, char** argv)
// Initialise solution object
gsMultiPatch<> mp_def = mp;

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

real_t pi = math::atan(1)*4;
index_t kmax = 3;
Expand Down Expand Up @@ -297,7 +297,7 @@ int main (int argc, char** argv)
gsOptionList options;
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand Down Expand Up @@ -525,7 +525,6 @@ int main (int argc, char** argv)


delete arcLength;
delete materialMatrix;
delete assembler;

return result;
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmark_Roof_APALM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ int main (int argc, char** argv)
// Initialise solution object
gsMultiPatch<> mp_def = mp;

gsMaterialMatrixBase<real_t>* materialMatrix;
gsMaterialMatrixBase<real_t>::uPtr materialMatrix;

real_t pi = math::atan(1)*4;
index_t kmax = 3;
Expand Down Expand Up @@ -346,7 +346,7 @@ int main (int argc, char** argv)
gsOptionList options;
if (composite)
{
materialMatrix = new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis);
materialMatrix = memory::make_unique(new gsMaterialMatrixComposite<3,real_t>(mp,Ts,Gs,Phis));
}
else
{
Expand Down
Loading
Loading