diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d82a5aa9..e5787bece 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ ## unscheduled features +## v0.5.0 (9 Aug 2024) +- Rewriting local kronmult library and adding an optional global kronmult library +- Matrix-free implicit timestepping using GMRES or BICGStab solver +- IMEX time advance +- File checkpoint restart +- New PDEs + ## v0.3.0 (26 Feb 2020) - [x] multi-node capability (merged 24 Oct 2019) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbb6e7764..ee906acc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required (VERSION 3.19) -project (asgard - VERSION 0.7.0 - LANGUAGES CXX -) +project (asgard VERSION 0.7.0 LANGUAGES CXX) #------------------------------------------------------------------------------- # Setup the kromult external project. @@ -149,10 +146,8 @@ find_package (LINALG REQUIRED) # sets OpenBLAS_PATH and LINALG_LIBS include (${CMAKE_SOURCE_DIR}/contrib/contrib.cmake) -# sets PROFILE_DEPS and PROFILE_LIBS -include (${CMAKE_SOURCE_DIR}/profiling/profiling.cmake) # sets HighFive_FOUND -include (${CMAKE_SOURCE_DIR}/contrib/io.cmake) +include (${CMAKE_SOURCE_DIR}/contrib/asgard_io.cmake) string(FIND "${BLAS_LIBRARIES}" "mkl" FOUND_MKL) set(ASGARD_USE_MKL FALSE) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6e4708b98..58ae58305 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,24 @@ +Miroslav Stoyanov (Oak Ridge National Lab) +- Project lead since 2023 + +Stefan Schnake (Oak Ridge National Lab) +- Software and method developer + +Eirik Endeve (Oak Ridge National Lab) +- Software and method developer + +Cory Hauck (Oak Ridge National Lab) +- Software and method developer + +Steven Hahn (Oak Ridge National Lab) +- Software developer + +## past developers + +Coleman Kendrick (Oak Ridge National Lab) +- Computer scientist + Eduardo D'Azevedo (Oak Ridge National Lab) - Method development @@ -6,7 +26,7 @@ Wael Elwasif (Oak Ridge National Lab) - Computer scientist David L. Green (Oak Ridge National Lab) -- Principal investigator and project lead +- Principal investigator and project lead (until 2023) M. Graham Lopez (Oak Ridge National Lab) - Lead software engineer diff --git a/contrib/io.cmake b/contrib/asgard_io.cmake similarity index 100% rename from contrib/io.cmake rename to contrib/asgard_io.cmake diff --git a/scripts/matlab/electric.m b/scripts/matlab/electric.m deleted file mode 100644 index 724561bf4..000000000 --- a/scripts/matlab/electric.m +++ /dev/null @@ -1,22 +0,0 @@ -function plot_Eall(nodes, E, src, phi, time) - - figure(1002); - subplot(2,2,1); - - plot(nodes, E); - title("E field"); - - subplot(2,2,2); - plot(nodes, src); - title("src"); - - subplot(2,2,3); - plot(nodes, phi); - title("phi"); - - sgtitle("Poisson Variables. t = " + num2str(time)); - - drawnow - - figure(1) -end diff --git a/scripts/matlab/plot_fval.m b/scripts/matlab/plot_fval.m deleted file mode 100644 index bd0ab36be..000000000 --- a/scripts/matlab/plot_fval.m +++ /dev/null @@ -1,233 +0,0 @@ -function plot_fval(num_dims,solutions,nodes,f_nD,f_nD_analytic,element_coordinates,window_title) - -overPlotAnalytic = 0; -if nargin >= 4 - overPlotAnalytic = 1; -end - -if num_dims==1 - - %% - % Plot solution - - x = nodes{1}; - plot(x,f_nD,'-o'); - - %% - % Overplot analytic solution - - if ~isempty(solutions) - hold on; - coord = {x}; - if overPlotAnalytic - plot(x,f_nD_analytic,'-'); - end - hold off; - end - -end - -if num_dims==2 - - x = nodes{1}; - y = nodes{2}; - - nx = numel(x); - ny = numel(y); - - %% - % Plot a 1D line through the solution - - sy = max(1,floor(ny/2)); - if ny > 2 - sy = sy+2; % just to get off the exact middle - end - - f_slice = f_nD(sy,:); - x = nodes{1}; - y = nodes{2}; - ax1 = subplot(2,2,1); - plot(x,f_slice,'-o'); - title_info = sprintf('1D slice (vertical) x = %5.4f', y(sy)); - title(title_info); - - %% - % Overplot analytic solution - - if ~isempty(solutions) - f_slice_analytic = f_nD_analytic(sy,:); - hold on; - plot(x,f_slice_analytic,'-'); - hold off; - end - - sx = max(1,floor(nx/2)); - if nx > 2 - sx = sx+2; % just to get off the exact middle - end - - f_slice = f_nD(:,sx); - x = nodes{1}; - y = nodes{2}; - ax1 = subplot(2,2,2); - plot(y,f_slice,'-o'); - title_info = sprintf('1D slice (horizontal) x = %5.4f', x(sx)); - title(title_info); - - if ~isempty(solutions) - f_slice_analytic = f_nD_analytic(:,sx); - hold on; - plot(y,f_slice_analytic,'-'); - hold off; - end - - %% - % Plot 2D - - ax1 = subplot(2,2,3); - f_nD_with_noise = f_nD; - f_nD_with_noise(1,1) = f_nD_with_noise(1,1)*1.0001; - contourf(x,y,f_nD_with_noise,'LineColor','none'); - title('numeric 2D solution'); - - if nargin >= 5 - hold on - scatter(element_coordinates(:,1),element_coordinates(:,2),60,'+','MarkerEdgeColor','black') - hold off - end - - if ~isempty(solutions) && norm(f_nD_analytic-f_nD_analytic(1,1))>0 - ax2 = subplot(2,2,4); - contourf(x,y,f_nD_analytic); - title('analytic 2D solution'); - end - - do_RE_paper_plots = false; - if do_RE_paper_plots - figure(11) - levs = [-9,-8,-7,-6,-5,-4,-3,-2,-1,0]; - f_nD(f_nD<1e-12)=1e-12; - [M,c]=contourf(x,y,log10(f_nD),levs,'LineColor','none'); - xlabel('p'); - ylabel('\zeta'); - clabel(M,c,levs,'Color','w'); - colormap(flipud(pink)); - set(gca,'FontSize',16) - g=100; - yy=yline(0.984,'Color','b','LineWidth',1); - xx=xline(5.01,'Color','b','LineWidth',1); - hold on - scatter(element_coordinates(:,1),element_coordinates(:,2),60,'+','MarkerEdgeColor','r') - hold off - end - - plot_fval_in_cyl = false; - if plot_fval_in_cyl - p = x; - z = y; - f = f_nD; - pper = linspace(0,max(p),31); - ppar = linspace(-max(p),+max(p),51); - [ppar2d,pper2d] = meshgrid(ppar,pper); - p2dA = sqrt(ppar2d.^2+pper2d.^2); - z2dA = cos(atan2(pper2d,ppar2d)); - f2d = interp2(p,z,f,p2dA,z2dA,'linear',1e-12); - figure(87) - f2d(f2d<1e-12)=1e-12; - contourf(ppar,pper,log10(f2d),levs,'LineColor','none') - colormap(flipud(pink)); - sg_th = acos(element_coordinates(:,2)); - sg_pper = element_coordinates(:,1).*sin(sg_th); - sg_ppar = element_coordinates(:,1).*cos(sg_th); - hold on - scatter(sg_ppar,sg_pper,60,'+','MarkerEdgeColor','k','LineWidth',2); - nL = 100; - pL1 = linspace(0,1,nL)*(max(x)-min(x))+min(x); - zL1 = zeros(1,nL)+0.984; - pperL1 = pL1.*sin(acos(zL1)); - pparL1 = pL1.*cos(acos(zL1)); - plot(pparL1,pperL1,'-r','LineWidth',1); - pL2 = zeros(1,nL)+5.01; - zL2 = linspace(0,1,nL)*(max(y)-min(y))+min(y); - pperL2 = pL2.*sin(acos(zL2)); - pparL2 = pL2.*cos(acos(zL2)); - plot(pparL2,pperL2,'-b','LineWidth',1); - - pL2 = zeros(1,nL)+max(x); - zL2 = linspace(0,1,nL)*(max(y)-min(y))+min(y); - pperL2 = pL2.*sin(acos(zL2)); - pparL2 = pL2.*cos(acos(zL2)); - plot(pparL2,pperL2,'-k','LineWidth',0.5); - pL2 = zeros(1,nL)+min(x); - zL2 = linspace(0,1,nL)*(max(y)-min(y))+min(y); - pperL2 = pL2.*sin(acos(zL2)); - pparL2 = pL2.*cos(acos(zL2)); - plot(pparL2,pperL2,'-k','LineWidth',0.5); - hold off - - end -end - -if num_dims==3 - %% - % Plot a 1D line through the solution - - sz = numel(f_nD(1,1,:))/2; - sy = numel(f_nD(1,:,1))/2; - sx = numel(f_nD(:,1,1))/2; - - x = nodes{1}; - y = nodes{2}; - z = nodes{3}; - - %% - % Overplot analytic solution - - if ~isempty(solutions) - f_slice_analytic = f_nD_analytic(:,sy,sx); - hold on; - plot(z,f_slice_analytic,'-'); - hold off; - end - - %% - % Plot a 2D xy plane - - ax1 = subplot(2,3,1); - contourf(z,y,f_nD(:,:,sx)'); - title('2D slice through 3D numeric'); - - if ~isempty(solutions) - ax2 = subplot(2,3,4); - contourf(z,y,f_nD_analytic(:,:,sx)'); - title('2D slice through 3D analytic'); - end - - %% - % Plot a 2D xz plane - - ax3 = subplot(2,3,2); - contourf(z,x,squeeze(f_nD(:,sy,:))'); - title('2D slice through 3D numeric'); - - if ~isempty(solutions) - ax3 = subplot(2,3,5); - contourf(z,x,squeeze(f_nD_analytic(:,sy,:))'); - title('2D slice through 3D analytic'); - end - - %% - % Plot a 2D yz plane - - ax3 = subplot(2,3,3); - contourf(y,x,squeeze(f_nD(sz,:,:))'); - title('2D slice through 3D numeric'); - - if ~isempty(solutions) - ax3 = subplot(2,3,6); - contourf(y,x,squeeze(f_nD_analytic(sz,:,:))'); - title('2D slice through 3D analytic'); - end -end - -end diff --git a/scripts/matlab/vlasov_params.m b/scripts/matlab/vlasov_params.m deleted file mode 100644 index 554266a5d..000000000 --- a/scripts/matlab/vlasov_params.m +++ /dev/null @@ -1,27 +0,0 @@ -function plot_params(nodes, n, u, theta, time) - - fig1 = figure(1000); - fig1.Units = 'Normalized'; - fig1.Position = [0.5 0.5 0.3 0.3]; - - subplot(2,2,1); - - plot(nodes, n); - title("n_f"); - - subplot(2,2,2); - - plot(nodes, u); - title("u_f"); - - subplot(2,2,3); - - plot(nodes, theta); - title("th_f"); - - sgtitle("Fluid Variables. t = " + num2str(time)); - - drawnow - - figure(1) -end diff --git a/scripts/matlab/wait_for_plots.m b/scripts/matlab/wait_for_plots.m deleted file mode 100644 index 484248ed5..000000000 --- a/scripts/matlab/wait_for_plots.m +++ /dev/null @@ -1,8 +0,0 @@ -% simple script to wait for all open plots to close before returning -figures = findobj('Type', 'figure'); -if (numel(figures) > 0) - disp("Waiting on all open figures to close...") -end -for fig_id=1:numel(figures) - waitfor(figures(fig_id)) -end diff --git a/scripts/read_output.py b/scripts/read_output.py deleted file mode 100644 index 5a67ae09a..000000000 --- a/scripts/read_output.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/env python - -import os -import sys - -import h5py - -import matplotlib.pyplot as plt - -def plot_from_file(filename, dataset, ax = plt): - data_file = h5py.File(filename, 'r') - - print(data_file) - print(data_file.keys()) - - nodes = data_file['nodes'][()] - soln = data_file['soln'][()] - - tmp = data_file['soln'][()] - - try: - # reshape to 2D matrix - tmp = tmp.reshape((len(nodes), len(nodes))).transpose() - except ValueError: - raise RuntimeError("Could not reshape solution vector, was it run with full grid option?") - - ax.contourf(nodes, nodes, tmp) - ax.set_title("t = {}".format(data_file['time'][()])) - - -if __name__ == '__main__': - if len(sys.argv) <= 1: - raise RuntimeError("Expected a datafile") - - input_fname = sys.argv[1] - - if not os.path.exists(input_fname): - raise RuntimeError("File '{}' does not exist".format(input_fname)) - - fig, ax = plt.subplots() - plot_from_file(input_fname, 'asgard', ax) - - plt.show()