This file contains hidden or 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
! @(#)s_cbrt.c 5.1 93/09/24 | |
! | |
! ==================================================== | |
! Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. | |
! | |
! Developed at SunPro, a Sun Microsystems, Inc. business. | |
! Permission to use, copy, modify, and distribute this | |
! software is freely granted, provided that this notice | |
! is preserved. | |
! ==================================================== |
This file contains hidden or 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
module m_multa | |
implicit none | |
private | |
public :: multa | |
contains | |
subroutine multa(A,X,ndims,nrens,iblkmax) |
This file contains hidden or 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
module cbrt_mod2 | |
implicit none | |
private | |
public :: cbrt, sp | |
interface cbrt | |
module procedure cbrt_sp_sp | |
module procedure cbrt_sp_csp |
This file contains hidden or 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
module cbrt_mod1 | |
implicit none | |
private | |
public :: cbrt, sp, r | |
interface cbrt | |
module procedure cbrt_sp_sp | |
module procedure cbrt_csp_csp |
This file contains hidden or 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
import math | |
from fractions import Fraction | |
def continued_fraction(r,steps=10): | |
cf = [] | |
for step in range(steps): | |
i = math.floor(r) | |
cf.append(i) |
This file contains hidden or 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
subroutine C_F_STRPOINTER (STRARRAY, FSTRPTR, MAXLEN) | |
use, intrinsic :: ISO_C_BINDING | |
implicit none | |
character, dimension(*), target, intent(in) :: STRARRAY | |
character(:), pointer, intent(out) :: FSTRPTR | |
integer, intent(in), optional :: MAXLEN | |
integer :: curlen | |
curlen = 0 |
This file contains hidden or 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
module linspace_mod | |
use iso_fortran_env, only: dp => real64 | |
implicit none | |
contains | |
!> | |
! Return evenly spaced numbers over a specified interval. | |
! | |
! Returns `num` evenly spaced samples, calculated over the interval `[start, stop]`. |
This file contains hidden or 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
def biperiodic_weight_matrix(bbox,x, p, n, diffs, | |
coeffs=None, | |
phi=phs3, | |
order=None, | |
eps=1.0, | |
stencils=None): | |
''' | |
Returns a weight matrix which maps a functions values at `p` to an | |
approximation of that functions derivative at `x`. This is a convenience | |
function which first creates stencils and then computes the RBF-FD weights |
This file contains hidden or 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
# Ghia, U. K. N. G., Ghia, K. N., & Shin, C. T. (1982). | |
# High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method. | |
# Journal of computational physics, 48(3), 387-411. | |
# | |
# TABLE I | |
# Results for $u$-velocity along Vertical Line through Geometric Center of Cavity | |
#-------------------------------------------------------------------- | |
# Re | |
# ------------------------------------------------------------- | |
# y 100 400 1000 3200 5000 7500 10000 |
This file contains hidden or 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
# Ghia, U. K. N. G., Ghia, K. N., & Shin, C. T. (1982). | |
# High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method. | |
# Journal of computational physics, 48(3), 387-411. | |
# | |
# TABLE II | |
# Results for $v$-Velocity along Horizontal Line through Geometric Center of Cavity | |
# [Note: The velocity for Re = 400 and point (x,v) = (0.9063,-0.23827) is probably wrong] | |
#-------------------------------------------------------------------- | |
# Re | |
# ------------------------------------------------------------- |