-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for default boundary conditions via null model
Also removed unused function for converting boundary condition characters to integer flags These changes are made to improve the diff hit on PR #59
- Loading branch information
1 parent
aa69df1
commit 3be2b7a
Showing
7 changed files
with
110 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ! | ||
! | ||
! Maintainers : [email protected] | ||
! Official Repository : https://github.com/FluidNumerics/self/ | ||
! | ||
! Copyright © 2024 Fluid Numerics LLC | ||
! | ||
! Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
! | ||
! 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
! | ||
! 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in | ||
! the documentation and/or other materials provided with the distribution. | ||
! | ||
! 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from | ||
! this software without specific prior written permission. | ||
! | ||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
! HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
! LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
! THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
! THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
! | ||
! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ! | ||
|
||
program NullDGModel3D_euler | ||
|
||
use self_data | ||
use self_NullDGModel3D | ||
|
||
implicit none | ||
character(SELF_INTEGRATOR_LENGTH),parameter :: integrator = 'euler' | ||
integer,parameter :: nvar = 1 | ||
integer,parameter :: controlDegree = 7 | ||
integer,parameter :: targetDegree = 16 | ||
real(prec),parameter :: dt = 1.0_prec | ||
real(prec),parameter :: endtime = 1.0_prec | ||
real(prec),parameter :: iointerval = 1.0_prec | ||
type(NullDGModel3D) :: modelobj | ||
type(Lagrange),target :: interp | ||
type(Mesh3D),target :: mesh | ||
type(SEMHex),target :: geometry | ||
character(LEN=255) :: WORKSPACE | ||
|
||
! Create a uniform block mesh | ||
call get_environment_variable("WORKSPACE",WORKSPACE) | ||
call mesh%Read_HOPr(trim(WORKSPACE)//"/share/mesh/Block3D/Block3D_mesh.h5") | ||
call mesh%ResetBoundaryConditionType(SELF_BC_PRESCRIBED) | ||
|
||
! Create an interpolant | ||
call interp%Init(N=controlDegree, & | ||
controlNodeType=GAUSS, & | ||
M=targetDegree, & | ||
targetNodeType=UNIFORM) | ||
|
||
! Generate geometry (metric terms) from the mesh elements | ||
call geometry%Init(interp,mesh%nElem) | ||
call geometry%GenerateFromMesh(mesh) | ||
|
||
! Initialize the model | ||
call modelobj%Init(nvar,mesh,geometry) | ||
call modelobj%gradient_enabled = .true. | ||
! Set the initial condition | ||
call modelobj%solution%SetEquation(1,'f = 0.0') | ||
call modelobj%solution%SetInteriorFromEquation(geometry,0.0_prec) | ||
|
||
print*,"min, max (interior)", & | ||
minval(modelobj%solution%interior), & | ||
maxval(modelobj%solution%interior) | ||
|
||
! Set the model's time integration method | ||
call modelobj%SetTimeIntegrator(integrator) | ||
|
||
! forward step the model to `endtime` using a time step | ||
! of `dt` and outputing model data every `iointerval` | ||
call modelobj%ForwardStep(endtime,dt,iointerval) | ||
|
||
print*,"min, max (interior)", & | ||
minval(modelobj%solution%interior), & | ||
maxval(modelobj%solution%interior) | ||
|
||
! Clean up | ||
call modelobj%free() | ||
call mesh%free() | ||
call geometry%free() | ||
call interp%free() | ||
|
||
endprogram NullDGModel3D_euler |