Skip to content

Commit

Permalink
Update arpack (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM authored Dec 9, 2022
1 parent 225860b commit 7542df8
Show file tree
Hide file tree
Showing 95 changed files with 4,227 additions and 5,401 deletions.
5 changes: 5 additions & 0 deletions Domain/MetaMat/operator_times.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ template<sp_d T> const shared_ptr<MetaMat<T>>& operator*=(const shared_ptr<MetaM
return M;
}

template<sp_d T> const unique_ptr<MetaMat<T>>& operator*=(const unique_ptr<MetaMat<T>>& M, const T value) {
M->operator*=(value);
return M;
}

template<sp_d T> const shared_ptr<MetaMat<T>>& operator+=(const shared_ptr<MetaMat<T>>& M, const shared_ptr<MetaMat<T>>& A) {
M->operator+=(A);
return M;
Expand Down
Binary file modified Libs/win/libfext.dll
Binary file not shown.
Binary file modified Libs/win/libfext.lib
Binary file not shown.
14 changes: 4 additions & 10 deletions MSVC/suanPan/arpack/arpack.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<Tool Name="VFPostBuildEventTool"/></Configuration></Configurations>
<Files>
<Filter Name="SRC" Filter="f90;for;f;fpp;ftn;def;odl;idl">
<File RelativePath="..\..\..\Toolbox\arpack-src\ccdotc.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\cgetv0.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\cmout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\cnaitr.f"/>
Expand All @@ -26,9 +27,7 @@
<File RelativePath="..\..\..\Toolbox\arpack-src\csortc.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\cstatn.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\cvout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\debug.fi"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\dgetv0.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\dlaqrb.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\dmout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\dnaitr.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\dnapps.f"/>
Expand All @@ -53,14 +52,9 @@
<File RelativePath="..\..\..\Toolbox\arpack-src\dstats.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\dstqrb.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\dvout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\icnteq.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\icopy.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\iset.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\iswap.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\ivout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\second.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\second_NONE.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\sgetv0.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\slaqrb.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\smout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\snaitr.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\snapps.f"/>
Expand All @@ -84,7 +78,6 @@
<File RelativePath="..\..\..\Toolbox\arpack-src\sstatn.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\sstats.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\sstqrb.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\stat.fi"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\svout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\zgetv0.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\zmout.f"/>
Expand All @@ -97,5 +90,6 @@
<File RelativePath="..\..\..\Toolbox\arpack-src\zngets.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\zsortc.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\zstatn.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\zvout.f"/></Filter></Files>
<File RelativePath="..\..\..\Toolbox\arpack-src\zvout.f"/>
<File RelativePath="..\..\..\Toolbox\arpack-src\zzdotc.f"/></Filter></Files>
<Globals/></VisualStudioProject>
3 changes: 2 additions & 1 deletion MSVC/suanPan/suanPan/suanPan.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>../../../Libs/vs;../../$(Configuration)/Libs;$(VTK_LIB);$(CUDA_PATH)/lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>cusparse.lib;cusolver.lib;cublas.lib;cudart.lib;amd.lib;arpack.lib;metis.lib;mumps_c.lib;mumps_f.lib;feast.lib;spmm.lib;superlu.lib;libhdf5.lib;libhdf5_hl.lib;opengl32.lib;wsock32.lib;psapi.lib;dbghelp.lib;vtkcgns-9.2.lib;vtkChartsCore-9.2.lib;vtkCommonColor-9.2.lib;vtkCommonComputationalGeometry-9.2.lib;vtkCommonCore-9.2.lib;vtkCommonDataModel-9.2.lib;vtkCommonExecutionModel-9.2.lib;vtkCommonMath-9.2.lib;vtkCommonMisc-9.2.lib;vtkCommonSystem-9.2.lib;vtkCommonTransforms-9.2.lib;vtkDICOMParser-9.2.lib;vtkDomainsChemistry-9.2.lib;vtkDomainsChemistryOpenGL2-9.2.lib;vtkdoubleconversion-9.2.lib;vtkexodusII-9.2.lib;vtkexpat-9.2.lib;vtkFiltersAMR-9.2.lib;vtkFiltersCore-9.2.lib;vtkFiltersExtraction-9.2.lib;vtkFiltersFlowPaths-9.2.lib;vtkFiltersGeneral-9.2.lib;vtkFiltersGeneric-9.2.lib;vtkFiltersGeometry-9.2.lib;vtkFiltersHybrid-9.2.lib;vtkFiltersHyperTree-9.2.lib;vtkFiltersImaging-9.2.lib;vtkFiltersModeling-9.2.lib;vtkFiltersParallel-9.2.lib;vtkFiltersParallelImaging-9.2.lib;vtkFiltersPoints-9.2.lib;vtkFiltersProgrammable-9.2.lib;vtkFiltersSelection-9.2.lib;vtkFiltersSMP-9.2.lib;vtkFiltersSources-9.2.lib;vtkFiltersStatistics-9.2.lib;vtkFiltersTexture-9.2.lib;vtkFiltersTopology-9.2.lib;vtkFiltersVerdict-9.2.lib;vtkfmt-9.2.lib;vtkfreetype-9.2.lib;vtkGeovisCore-9.2.lib;vtkgl2ps-9.2.lib;vtkglew-9.2.lib;vtkhdf5_hl-9.2.lib;vtkhdf5-9.2.lib;vtkImagingColor-9.2.lib;vtkImagingCore-9.2.lib;vtkImagingFourier-9.2.lib;vtkImagingGeneral-9.2.lib;vtkImagingHybrid-9.2.lib;vtkImagingMath-9.2.lib;vtkImagingMorphological-9.2.lib;vtkImagingSources-9.2.lib;vtkImagingStatistics-9.2.lib;vtkImagingStencil-9.2.lib;vtkInfovisCore-9.2.lib;vtkInfovisLayout-9.2.lib;vtkInteractionImage-9.2.lib;vtkInteractionStyle-9.2.lib;vtkInteractionWidgets-9.2.lib;vtkIOAMR-9.2.lib;vtkIOAsynchronous-9.2.lib;vtkIOCesium3DTiles-9.2.lib;vtkIOCGNSReader-9.2.lib;vtkIOChemistry-9.2.lib;vtkIOCityGML-9.2.lib;vtkIOCONVERGECFD-9.2.lib;vtkIOCore-9.2.lib;vtkIOEnSight-9.2.lib;vtkIOExodus-9.2.lib;vtkIOExport-9.2.lib;vtkIOExportGL2PS-9.2.lib;vtkIOExportPDF-9.2.lib;vtkIOGeometry-9.2.lib;vtkIOHDF-9.2.lib;vtkIOImage-9.2.lib;vtkIOImport-9.2.lib;vtkIOInfovis-9.2.lib;vtkIOIOSS-9.2.lib;vtkIOLegacy-9.2.lib;vtkIOLSDyna-9.2.lib;vtkIOMINC-9.2.lib;vtkIOMotionFX-9.2.lib;vtkIOMovie-9.2.lib;vtkIONetCDF-9.2.lib;vtkIOOggTheora-9.2.lib;vtkIOParallel-9.2.lib;vtkIOParallelXML-9.2.lib;vtkIOPLY-9.2.lib;vtkIOSegY-9.2.lib;vtkIOSQL-9.2.lib;vtkioss-9.2.lib;vtkIOTecplotTable-9.2.lib;vtkIOVeraOut-9.2.lib;vtkIOVideo-9.2.lib;vtkIOXML-9.2.lib;vtkIOXMLParser-9.2.lib;vtkjpeg-9.2.lib;vtkjsoncpp-9.2.lib;vtkkissfft-9.2.lib;vtklibharu-9.2.lib;vtklibproj-9.2.lib;vtklibxml2-9.2.lib;vtkloguru-9.2.lib;vtklz4-9.2.lib;vtklzma-9.2.lib;vtkmetaio-9.2.lib;vtknetcdf-9.2.lib;vtkogg-9.2.lib;vtkParallelCore-9.2.lib;vtkParallelDIY-9.2.lib;vtkpng-9.2.lib;vtkpugixml-9.2.lib;vtkRenderingAnnotation-9.2.lib;vtkRenderingContext2D-9.2.lib;vtkRenderingContextOpenGL2-9.2.lib;vtkRenderingCore-9.2.lib;vtkRenderingFreeType-9.2.lib;vtkRenderingGL2PSOpenGL2-9.2.lib;vtkRenderingHyperTreeGrid-9.2.lib;vtkRenderingImage-9.2.lib;vtkRenderingLabel-9.2.lib;vtkRenderingLICOpenGL2-9.2.lib;vtkRenderingLOD-9.2.lib;vtkRenderingOpenGL2-9.2.lib;vtkRenderingSceneGraph-9.2.lib;vtkRenderingUI-9.2.lib;vtkRenderingVolume-9.2.lib;vtkRenderingVolumeOpenGL2-9.2.lib;vtkRenderingVtkJS-9.2.lib;vtksqlite-9.2.lib;vtksys-9.2.lib;vtkTestingRendering-9.2.lib;vtktheora-9.2.lib;vtktiff-9.2.lib;vtkverdict-9.2.lib;vtkViewsContext2D-9.2.lib;vtkViewsCore-9.2.lib;vtkViewsInfovis-9.2.lib;vtkWrappingTools-9.2.lib;vtkzlib-9.2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>cusparse.lib;cusolver.lib;cublas.lib;cudart.lib;amd.lib;arpack.lib;metis.lib;mumps_c.lib;mumps_f.lib;feast.lib;superlu.lib;libhdf5.lib;libhdf5_hl.lib;opengl32.lib;wsock32.lib;psapi.lib;dbghelp.lib;vtkcgns-9.2.lib;vtkChartsCore-9.2.lib;vtkCommonColor-9.2.lib;vtkCommonComputationalGeometry-9.2.lib;vtkCommonCore-9.2.lib;vtkCommonDataModel-9.2.lib;vtkCommonExecutionModel-9.2.lib;vtkCommonMath-9.2.lib;vtkCommonMisc-9.2.lib;vtkCommonSystem-9.2.lib;vtkCommonTransforms-9.2.lib;vtkDICOMParser-9.2.lib;vtkDomainsChemistry-9.2.lib;vtkDomainsChemistryOpenGL2-9.2.lib;vtkdoubleconversion-9.2.lib;vtkexodusII-9.2.lib;vtkexpat-9.2.lib;vtkFiltersAMR-9.2.lib;vtkFiltersCore-9.2.lib;vtkFiltersExtraction-9.2.lib;vtkFiltersFlowPaths-9.2.lib;vtkFiltersGeneral-9.2.lib;vtkFiltersGeneric-9.2.lib;vtkFiltersGeometry-9.2.lib;vtkFiltersHybrid-9.2.lib;vtkFiltersHyperTree-9.2.lib;vtkFiltersImaging-9.2.lib;vtkFiltersModeling-9.2.lib;vtkFiltersParallel-9.2.lib;vtkFiltersParallelImaging-9.2.lib;vtkFiltersPoints-9.2.lib;vtkFiltersProgrammable-9.2.lib;vtkFiltersSelection-9.2.lib;vtkFiltersSMP-9.2.lib;vtkFiltersSources-9.2.lib;vtkFiltersStatistics-9.2.lib;vtkFiltersTexture-9.2.lib;vtkFiltersTopology-9.2.lib;vtkFiltersVerdict-9.2.lib;vtkfmt-9.2.lib;vtkfreetype-9.2.lib;vtkGeovisCore-9.2.lib;vtkgl2ps-9.2.lib;vtkglew-9.2.lib;vtkhdf5_hl-9.2.lib;vtkhdf5-9.2.lib;vtkImagingColor-9.2.lib;vtkImagingCore-9.2.lib;vtkImagingFourier-9.2.lib;vtkImagingGeneral-9.2.lib;vtkImagingHybrid-9.2.lib;vtkImagingMath-9.2.lib;vtkImagingMorphological-9.2.lib;vtkImagingSources-9.2.lib;vtkImagingStatistics-9.2.lib;vtkImagingStencil-9.2.lib;vtkInfovisCore-9.2.lib;vtkInfovisLayout-9.2.lib;vtkInteractionImage-9.2.lib;vtkInteractionStyle-9.2.lib;vtkInteractionWidgets-9.2.lib;vtkIOAMR-9.2.lib;vtkIOAsynchronous-9.2.lib;vtkIOCesium3DTiles-9.2.lib;vtkIOCGNSReader-9.2.lib;vtkIOChemistry-9.2.lib;vtkIOCityGML-9.2.lib;vtkIOCONVERGECFD-9.2.lib;vtkIOCore-9.2.lib;vtkIOEnSight-9.2.lib;vtkIOExodus-9.2.lib;vtkIOExport-9.2.lib;vtkIOExportGL2PS-9.2.lib;vtkIOExportPDF-9.2.lib;vtkIOGeometry-9.2.lib;vtkIOHDF-9.2.lib;vtkIOImage-9.2.lib;vtkIOImport-9.2.lib;vtkIOInfovis-9.2.lib;vtkIOIOSS-9.2.lib;vtkIOLegacy-9.2.lib;vtkIOLSDyna-9.2.lib;vtkIOMINC-9.2.lib;vtkIOMotionFX-9.2.lib;vtkIOMovie-9.2.lib;vtkIONetCDF-9.2.lib;vtkIOOggTheora-9.2.lib;vtkIOParallel-9.2.lib;vtkIOParallelXML-9.2.lib;vtkIOPLY-9.2.lib;vtkIOSegY-9.2.lib;vtkIOSQL-9.2.lib;vtkioss-9.2.lib;vtkIOTecplotTable-9.2.lib;vtkIOVeraOut-9.2.lib;vtkIOVideo-9.2.lib;vtkIOXML-9.2.lib;vtkIOXMLParser-9.2.lib;vtkjpeg-9.2.lib;vtkjsoncpp-9.2.lib;vtkkissfft-9.2.lib;vtklibharu-9.2.lib;vtklibproj-9.2.lib;vtklibxml2-9.2.lib;vtkloguru-9.2.lib;vtklz4-9.2.lib;vtklzma-9.2.lib;vtkmetaio-9.2.lib;vtknetcdf-9.2.lib;vtkogg-9.2.lib;vtkParallelCore-9.2.lib;vtkParallelDIY-9.2.lib;vtkpng-9.2.lib;vtkpugixml-9.2.lib;vtkRenderingAnnotation-9.2.lib;vtkRenderingContext2D-9.2.lib;vtkRenderingContextOpenGL2-9.2.lib;vtkRenderingCore-9.2.lib;vtkRenderingFreeType-9.2.lib;vtkRenderingGL2PSOpenGL2-9.2.lib;vtkRenderingHyperTreeGrid-9.2.lib;vtkRenderingImage-9.2.lib;vtkRenderingLabel-9.2.lib;vtkRenderingLICOpenGL2-9.2.lib;vtkRenderingLOD-9.2.lib;vtkRenderingOpenGL2-9.2.lib;vtkRenderingSceneGraph-9.2.lib;vtkRenderingUI-9.2.lib;vtkRenderingVolume-9.2.lib;vtkRenderingVolumeOpenGL2-9.2.lib;vtkRenderingVtkJS-9.2.lib;vtksqlite-9.2.lib;vtksys-9.2.lib;vtkTestingRendering-9.2.lib;vtktheora-9.2.lib;vtktiff-9.2.lib;vtkverdict-9.2.lib;vtkViewsContext2D-9.2.lib;vtkViewsCore-9.2.lib;vtkViewsInfovis-9.2.lib;vtkWrappingTools-9.2.lib;vtkzlib-9.2.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -493,6 +493,7 @@
<ClCompile Include="..\..\..\Toolbox\tensorToolbox.cpp" />
<ClCompile Include="..\..\..\Toolbox\utility.cpp" />
<ClCompile Include="..\..\..\UnitTest\CatchTest.cpp" />
<ClCompile Include="..\..\..\UnitTest\TestEigen.cpp" />
<ClCompile Include="..\..\..\UnitTest\TestSampling.cpp" />
<ClCompile Include="..\..\..\UnitTest\TestSolver.cpp" />
<ClCompile Include="..\..\..\UnitTest\TestColoring.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions MSVC/suanPan/suanPan/suanPan.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,9 @@
<ClCompile Include="..\..\..\Solver\Integrator\GeneralizedAlphaExplicit.cpp">
<Filter>Solver\Integrator</Filter>
</ClCompile>
<ClCompile Include="..\..\..\UnitTest\TestEigen.cpp">
<Filter>UnitTest</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\Constraint\BC\GroupMultiplierBC.h">
Expand Down
6 changes: 5 additions & 1 deletion Solver/Arnoldi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ int Arnoldi::analyze() {
// if(SUANPAN_SUCCESS != G->process_load()) return SUANPAN_FAIL;
if(SUANPAN_SUCCESS != G->process_constraint()) return SUANPAN_FAIL;

return eig_solve(get_eigenvalue(W), get_eigenvector(W), W->get_stiffness(), W->get_mass(), eigen_num, 'L' == eigen_type ? "LM" : "SM");
const shared_ptr t_mass = W->get_mass()->make_copy();
const auto factor = 1E-12 * t_mass->max();
for(auto I = 0llu; I < t_mass->n_rows; ++I) t_mass->at(I, I) += factor;

return eig_solve(get_eigenvalue(W), get_eigenvector(W), W->get_stiffness(), t_mass, eigen_num, 'L' == eigen_type ? "LM" : "SM");
}

void Arnoldi::print() { suanpan_info("A solver using Arnoldi method.\n"); }
5 changes: 4 additions & 1 deletion Step/Buckle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ int Buckle::analyze() {

if(SUANPAN_SUCCESS != G->process_constraint()) return SUANPAN_FAIL;

if(eig_solve(get_eigenvalue(W), get_eigenvector(W), W->get_stiffness(), W->get_geometry()) != SUANPAN_SUCCESS) return SUANPAN_FAIL;
const shared_ptr t_geometry = W->get_geometry()->make_copy();
t_geometry *= -1.;

if(eig_solve(get_eigenvalue(W), get_eigenvector(W), W->get_stiffness(), t_geometry, 1, "SM") != SUANPAN_SUCCESS) return SUANPAN_FAIL;

suanpan_info("\nbuckling load multiplier: %.8E.\n", W->get_eigenvalue().at(0));

Expand Down
36 changes: 36 additions & 0 deletions Toolbox/arpack-src/ccdotc.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
complex function ccdotc(n,zx,incx,zy,incy)
c
c forms the dot product of a vector.
c jack dongarra, 3/11/78.
c modified 12/3/93, array(1) declarations changed to array(*)
c
complex zx(*),zy(*),ztemp
integer i,incx,incy,ix,iy,n
ztemp = (0.0d0,0.0d0)
ccdotc = (0.0d0,0.0d0)
if(n.le.0)return
if(incx.eq.1.and.incy.eq.1)go to 20
c
c code for unequal increments or equal increments
c not equal to 1
c
ix = 1
iy = 1
if(incx.lt.0)ix = (-n+1)*incx + 1
if(incy.lt.0)iy = (-n+1)*incy + 1
do 10 i = 1,n
ztemp = ztemp + conjg(zx(ix))*zy(iy)
ix = ix + incx
iy = iy + incy
10 continue
ccdotc = ztemp
return
c
c code for both increments equal to 1
c
20 do 30 i = 1,n
ztemp = ztemp + conjg(zx(i))*zy(i)
30 continue
ccdotc = ztemp
return
end
Loading

0 comments on commit 7542df8

Please sign in to comment.