1 // SPDX-FileCopyrightText: Copyright (c) 2017-2024, HONEE contributors. 2 // SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause 3 #pragma once 4 5 #include <ceed.h> 6 #include "stabilization_types.h" 7 8 typedef enum { 9 ADVDIF_WIND_ROTATION = 0, 10 ADVDIF_WIND_TRANSLATION = 1, 11 } AdvDifWindType; 12 13 // Advection - Initial Condition Types 14 typedef enum { 15 ADVDIF_IC_BUBBLE_SPHERE = 0, // dim=3 16 ADVDIF_IC_BUBBLE_CYLINDER = 1, // dim=2 17 ADVDIF_IC_COSINE_HILL = 2, // dim=2 18 ADVDIF_IC_SKEW = 3, 19 ADVDIF_IC_WAVE = 4, 20 } AdvDifICType; 21 22 // Advection-Diffusion wave types 23 typedef enum { 24 ADVDIF_WAVE_SINE = 0, 25 ADVDIF_WAVE_SQUARE = 1, 26 } AdvDifWaveType; 27 28 // Advection - Bubble Continuity Types 29 typedef enum { 30 ADVDIF_BUBBLE_CONTINUITY_SMOOTH = 0, // Original continuous, smooth shape 31 ADVDIF_BUBBLE_CONTINUITY_BACK_SHARP = 1, // Discontinuous, sharp back half shape 32 ADVDIF_BUBBLE_CONTINUITY_THICK = 2, // Define a finite thickness 33 ADVDIF_BUBBLE_CONTINUITY_COSINE = 3, // Use cosine wave for smoothing 34 } AdvDifBubbleContinuityType; 35 36 typedef struct AdvectionContext_ *AdvectionContext; 37 struct AdvectionContext_ { 38 bool strong_form; 39 CeedScalar E_wind; 40 bool implicit; 41 CeedScalar dt; 42 CeedScalar diffusion_coeff; 43 44 StabilizationType stabilization; 45 StabilizationTauType stabilization_tau; 46 CeedScalar CtauS; 47 CeedScalar Ctau_a, Ctau_d, Ctau_t; 48 }; 49 50 typedef struct SetupContextAdv_ *SetupContextAdv; 51 struct SetupContextAdv_ { 52 CeedScalar rc; 53 CeedScalar lx; 54 CeedScalar ly; 55 CeedScalar lz; 56 CeedScalar wind[3]; 57 CeedScalar time; 58 CeedScalar wave_frequency, wave_phase; 59 60 AdvDifWaveType wave_type; 61 AdvDifWindType wind_type; 62 AdvDifICType initial_condition_type; 63 AdvDifBubbleContinuityType bubble_continuity_type; 64 }; 65