From 5b5e0c7f15753f48c464fb57daf71f2111a75dbc Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Wed, 14 Jan 2026 16:58:27 -0800 Subject: [PATCH 01/10] doc(tensors_1D_m): add metadata for RAG This commit starts the process of adding metadat to the tensors_1D_m module to support Retrieval Agumented Generation (RAG). --- src/formal/tensors_1D_m.F90 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index 2615a7c..376870e 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -24,6 +24,13 @@ module tensors_1D_m abstract interface + ! PURPOSE: To provide values for initializing a scalar_1D_t object at the cell centers and boundaries + ! for use in the mimetic discretization scheme of Corbino-Castillo (2020) + ! KEYWORDS: mimetic discretization, scalar function, sampling,one-dimensional (1D) + ! CONTEXT: This abstract interface is used to declare a procedure pointer that can be associated with + ! a user-defined function. The user's function can be invoked via this abstract interface + ! to sample the function at the appropriate grid locations. + pure function scalar_1D_initializer_i(x) result(f) !! Sampling function for initializing a scalar_1D_t object implicit none @@ -31,6 +38,13 @@ pure function scalar_1D_initializer_i(x) result(f) double precision, allocatable :: f(:) end function + ! PURPOSE: To provide values for initializing a vector_1D_t object at grid cell faces as defined in the + ! mimetic discretization scheme of Corbino-Castillo (2020). + ! KEYWORDS: mimetic discretization, vector function, sampling, one-dimensional (1D) + ! CONTEXT: This abstract interface is used to declare a procedure pointer that can be associated with + ! a user-defined function. The user's function can be invoked via this abstract interface + ! to sample the function at the appropriate grid locations. + pure function vector_1D_initializer_i(x) result(v) !! Sampling function for initializing a vector_1D_t object implicit none @@ -40,6 +54,11 @@ pure function vector_1D_initializer_i(x) result(v) end interface + ! PURPOSE: Encapsulate the data and operations that are common to most or all tensor_1D_t child types + ! KEYWORDS: mimetic discretization, grid values, grid functions, one-dimensional (1D) + ! CONTEXT: Child types extend this derived type to define specific types of tensors such as scalars, + ! vectors, gradients, and divergences. + type tensor_1D_t !! Encapsulate the components that are common to all 1D tensors. !! Child types define the operations supported by each child, including From 4450df3c02e2af9da07ef9a7ba3173b6f5541618 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Mon, 19 Jan 2026 20:36:05 -0800 Subject: [PATCH 02/10] doc(tensors_1D): add more RAG metadata --- src/formal/tensors_1D_m.F90 | 43 ++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index 376870e..b0c957e 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -26,7 +26,7 @@ module tensors_1D_m ! PURPOSE: To provide values for initializing a scalar_1D_t object at the cell centers and boundaries ! for use in the mimetic discretization scheme of Corbino-Castillo (2020) - ! KEYWORDS: mimetic discretization, scalar function, sampling,one-dimensional (1D) + ! KEYWORDS: mimetic discretization, scalar function, sampling, one-dimensional (1D) ! CONTEXT: This abstract interface is used to declare a procedure pointer that can be associated with ! a user-defined function. The user's function can be invoked via this abstract interface ! to sample the function at the appropriate grid locations. @@ -38,9 +38,9 @@ pure function scalar_1D_initializer_i(x) result(f) double precision, allocatable :: f(:) end function - ! PURPOSE: To provide values for initializing a vector_1D_t object at grid cell faces as defined in the - ! mimetic discretization scheme of Corbino-Castillo (2020). - ! KEYWORDS: mimetic discretization, vector function, sampling, one-dimensional (1D) + ! PURPOSE: To provide values for initializing a vection function of one spatialdimension at cell faces + ! as defined in the mimetic discretization scheme of Corbino-Castillo (2020). + ! KEYWORDS: mimetic discretization, vector function, sampling, 1D ! CONTEXT: This abstract interface is used to declare a procedure pointer that can be associated with ! a user-defined function. The user's function can be invoked via this abstract interface ! to sample the function at the appropriate grid locations. @@ -55,7 +55,7 @@ pure function vector_1D_initializer_i(x) result(v) end interface ! PURPOSE: Encapsulate the data and operations that are common to most or all tensor_1D_t child types - ! KEYWORDS: mimetic discretization, grid values, grid functions, one-dimensional (1D) + ! KEYWORDS: mimetic discretization, grid values, grid functions, 1D ! CONTEXT: Child types extend this derived type to define specific types of tensors such as scalars, ! vectors, gradients, and divergences. @@ -78,6 +78,11 @@ pure function vector_1D_initializer_i(x) result(v) interface tensor_1D_t + ! PURPOSE: To construct a new tensor_1D_t object by assigning each argument to a corresponding + ! corresponding component of the new object. + ! KEYWORDS: 1D tensor constructor + ! CONTEXT: Constructors for child types assign this function's result to to the child object's parent component. + pure module function construct_1D_tensor_from_components(values, x_min, x_max, cells, order) result(tensor_1D) !! User-defined constructor: result is a 1D tensor defined by assigning the dummy arguments to corresponding components implicit none @@ -91,6 +96,10 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c end interface + ! PURPOSE: Encapsulatae a scalar function of one spatial dimension as a tensor with a gradient operator. + ! KEYWORDS: 1D scalar field abstraction + ! CONTEXT: Combine with other tensors via expressions that may include differential operators + type, extends(tensor_1D_t) :: scalar_1D_t !! Encapsulate scalar values at cell centers and boundaries private @@ -108,6 +117,12 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c interface scalar_1D_t + ! PURPOSE: To construct a new scalar_1D_t object by assigning each argument to a corresponding + ! corresponding component of the new object. + ! KEYWORDS: 1D scalar field constructor + ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set + ! of uniformly-spaced cell centers along one spatial dimension bounded by x_min and x_max. + pure module function construct_1D_scalar_from_function(initializer, order, cells, x_min, x_max) result(scalar_1D) !! Result is a collection of cell-centered-extended values with a corresponding mimetic gradient operator implicit none @@ -121,6 +136,10 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells end interface + ! PURPOSE: Encapsulatae a vector function of one spatial dimension as a tensor with a divergence operator. + ! KEYWORDS: 1D vector field abstraction + ! CONTEXT: Combine with other tensors via expressions that may include differential operators + type, extends(tensor_1D_t) :: vector_1D_t !! Encapsulate 1D vector values at cell faces (of unit area for 1D) and corresponding operators private @@ -142,6 +161,10 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells procedure, non_overridable, private :: vector_1D_values end type + ! PURPOSE: Encapsulatae a scalar/vector product weighted for integration on a surface + ! KEYWORDS: 1D product abstraction + ! CONTEXT: Combine with other tensors via expressions that may include the double integrals + type, extends(tensor_1D_t) :: weighted_product_1D_t contains generic :: operator(.SS.) => surface_integrate_vector_x_scalar_1D @@ -150,6 +173,11 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells interface vector_1D_t + ! PURPOSE: To construct a new vector_1D_t object by sampling a function of one spatial dimension. + ! KEYWORDS: 1D vector field constructor + ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set + ! of uniformly-spaced cell faces along one spatial dimension bounded by x_min and x_max. + pure module function construct_1D_vector_from_function(initializer, order, cells, x_min, x_max) result(vector_1D) !! Result is a 1D vector with values initialized by the provided procedure pointer sampled on the specified !! number of evenly spaced cells covering [x_min, x_max] @@ -162,6 +190,11 @@ pure module function construct_1D_vector_from_function(initializer, order, cells type(vector_1D_t) vector_1D end function + ! PURPOSE: To construct a new vector_1D_t object from a parent tensor and a divergence operator object. + ! KEYWORDS: 1D vector field constructor + ! CONTEXT: Invoke this constructor with a an object to be used to define the constructed parent component + ! divergence-operator matrix component. + pure module function construct_from_components(tensor_1D, divergence_operator_1D) result(vector_1D) !! Result is a 1D vector with the provided parent component tensor_1D and the provided divergence operatror type(tensor_1D_t), intent(in) :: tensor_1D From e4f3d2b3d87e17ad3909134cf939bdd290f8f38b Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Mon, 19 Jan 2026 21:44:25 -0800 Subject: [PATCH 03/10] doc(mimetic_operators_1D_m): add metadata --- src/formal/mimetic_operators_1D_m.F90 | 16 ++++++++++++++++ src/formal/tensors_1D_m.F90 | 16 ++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/formal/mimetic_operators_1D_m.F90 b/src/formal/mimetic_operators_1D_m.F90 index 22a4670..42e2b2f 100644 --- a/src/formal/mimetic_operators_1D_m.F90 +++ b/src/formal/mimetic_operators_1D_m.F90 @@ -36,6 +36,10 @@ pure module function construct_matrix_operator(upper, inner, lower) result(mimet end interface + ! PURPOSE: To encapsulate a one-dimenstional (1D) mimetic gradient operator matrix. + ! KEYWORDS: 1D gradient operator matrix + ! CONTEXT: Use this type to assemble gradient-operator matrix for printing. + type, extends(mimetic_matrix_1D_t) :: gradient_operator_1D_t !! Encapsulate a 1D mimetic gradient operator private @@ -51,6 +55,10 @@ pure module function construct_matrix_operator(upper, inner, lower) result(mimet interface gradient_operator_1D_t + ! PURPOSE: To construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. + ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix + ! CONTEXT: Use this function to construct a sparse-matrix represntation of a mimetic gradient operator. + pure module function construct_1D_gradient_operator(k, dx, cells) result(gradient_operator_1D) !! Construct a mimetic gradient operator implicit none @@ -62,6 +70,10 @@ pure module function construct_1D_gradient_operator(k, dx, cells) result(gradien end interface + ! PURPOSE: To encapsulate a 1D mimetic divergence operator matrix. + ! KEYWORDS: 1D, divergence operator, sparse matrix + ! CONTEXT: Use this type to assemble divergence-operator matrix for printing. + type, extends(mimetic_matrix_1D_t) :: divergence_operator_1D_t !! Encapsulate kth-order mimetic divergence operator on m_ cells of width dx private @@ -77,6 +89,10 @@ pure module function construct_1D_gradient_operator(k, dx, cells) result(gradien interface divergence_operator_1D_t + ! PURPOSE: To construct an object representing a 1D mimetic divergence operator. + ! KEYWORDS: 1D, divergence operator, sparse matrix, constructor + ! CONTEXT: Use this type to assemble a divergence-operator matrix for printing. + pure module function construct_1D_divergence_operator(k, dx, cells) result(divergence_operator_1D) !! Construct a mimetic gradient operator implicit none diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index b0c957e..8e5b2a5 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -54,7 +54,7 @@ pure function vector_1D_initializer_i(x) result(v) end interface - ! PURPOSE: Encapsulate the data and operations that are common to most or all tensor_1D_t child types + ! PURPOSE: To encapsulate the data and operations that are common to most or all tensor_1D_t child types ! KEYWORDS: mimetic discretization, grid values, grid functions, 1D ! CONTEXT: Child types extend this derived type to define specific types of tensors such as scalars, ! vectors, gradients, and divergences. @@ -96,7 +96,7 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c end interface - ! PURPOSE: Encapsulatae a scalar function of one spatial dimension as a tensor with a gradient operator. + ! PURPOSE: To encapsulatae a scalar function of one spatial dimension as a tensor with a gradient operator. ! KEYWORDS: 1D scalar field abstraction ! CONTEXT: Combine with other tensors via expressions that may include differential operators @@ -136,7 +136,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells end interface - ! PURPOSE: Encapsulatae a vector function of one spatial dimension as a tensor with a divergence operator. + ! PURPOSE: To encapsulate a vector function of one spatial dimension as a tensor with a divergence operator. ! KEYWORDS: 1D vector field abstraction ! CONTEXT: Combine with other tensors via expressions that may include differential operators @@ -161,7 +161,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells procedure, non_overridable, private :: vector_1D_values end type - ! PURPOSE: Encapsulatae a scalar/vector product weighted for integration on a surface + ! PURPOSE: To encapsulate a scalar/vector product weighted for integration on a surface ! KEYWORDS: 1D product abstraction ! CONTEXT: Combine with other tensors via expressions that may include the double integrals @@ -204,6 +204,10 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D end interface + ! PURPOSE: To define a vector child type for capturing gradient data and a scalar (dot) product operator. + ! KEYWORDS: 1D gradient vector field abstraction + ! CONTEXT: The scalar_1D_t .grad. operator produces this type as a result. + type, extends(vector_1D_t) :: gradient_1D_t !! A 1D mimetic gradient vector field abstraction with a public method that produces corresponding numerical quadrature weights contains @@ -214,6 +218,10 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private, pass(gradient_1D) :: dot end type + ! PURPOSE: To define a tensor child for capturing the scalar (dot) product of a vector and a gradient vector data + ! KEYWORDS: 1D vector/gradient scalar product + ! CONTEXT: An instance of this type can serve as an integrand in a .SSS. triple-integral operator. + type, extends(tensor_1D_t) :: vector_dot_gradient_1D_t !! Result is the dot product of a 1D vector field and a 1D gradient field private From d0cb28a5336c0a651cbaf9960fb2f7890d5d29fb Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Mon, 19 Jan 2026 21:54:27 -0800 Subject: [PATCH 04/10] doc(tensors_1D): public type/constructor metadata --- src/formal/tensors_1D_m.F90 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index 8e5b2a5..6dc4b72 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -231,6 +231,11 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private, pass(integrand) ::volume_integrate_vector_dot_grad_scalar_1D end type + ! PURPOSE: To define a tensor child type capturing the divergence of a vector function of one spatial dimension. + ! KEYWORDS: 1D, divergence + ! CONTEXT: Although a mathematical scalar, this type differs from scalar_1D_t in that the values are stored + ! _only_ at cell centers, whereas a scalar_1D_t object additionally has values at domain boundaries. + type, extends(tensor_1D_t) :: divergence_1D_t !! Encapsulate divergences at cell centers contains @@ -244,6 +249,10 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private :: divergence_1D_grid end type + ! PURPOSE: + ! KEYWORDS: + ! CONTEXT: + type, extends(tensor_1D_t) :: scalar_x_divergence_1D_t !! product of a 1D scalar field and a 1D divergence field private @@ -253,6 +262,12 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private, pass(integrand) :: volume_integrate_scalar_x_divergence_1D end type + ! PURPOSE: To define a divergence child type capturing the result of applying a divergence operator to a gradient. + ! KEYWORDS: 1D, laplacian + ! CONTEXT: Although a mathematical a divergence, this type additionally provides a type-bound procedure that + ! returns the number of boundary-adjacent points at which the Laplacian aproximation's accuracy drops by + ! by one order relative to the parent divergence type. + type, extends(divergence_1D_t) :: laplacian_1D_t private integer boundary_depth_ From d0578c68a9732a5eaba77f6ca3c1f17e9dd00602 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Mon, 19 Jan 2026 23:14:30 -0800 Subject: [PATCH 05/10] doc(tensors_1D): add metadata public module funcs --- src/formal/tensors_1D_m.F90 | 118 +++++++++++++++++++++++++++++++++--- 1 file changed, 111 insertions(+), 7 deletions(-) diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index 6dc4b72..ed0beef 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -38,7 +38,7 @@ pure function scalar_1D_initializer_i(x) result(f) double precision, allocatable :: f(:) end function - ! PURPOSE: To provide values for initializing a vection function of one spatialdimension at cell faces + ! PURPOSE: To provide values for initializing a vector function of one spatial dimension at cell faces ! as defined in the mimetic discretization scheme of Corbino-Castillo (2020). ! KEYWORDS: mimetic discretization, vector function, sampling, 1D ! CONTEXT: This abstract interface is used to declare a procedure pointer that can be associated with @@ -96,7 +96,7 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c end interface - ! PURPOSE: To encapsulatae a scalar function of one spatial dimension as a tensor with a gradient operator. + ! PURPOSE: To encapsulate a scalar function of one spatial dimension as a tensor with a gradient operator. ! KEYWORDS: 1D scalar field abstraction ! CONTEXT: Combine with other tensors via expressions that may include differential operators @@ -196,7 +196,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells ! divergence-operator matrix component. pure module function construct_from_components(tensor_1D, divergence_operator_1D) result(vector_1D) - !! Result is a 1D vector with the provided parent component tensor_1D and the provided divergence operatror + !! Result is a 1D vector with the provided parent component tensor_1D and the provided divergence operator type(tensor_1D_t), intent(in) :: tensor_1D type(divergence_operator_1D_t), intent(in) :: divergence_operator_1D type(vector_1D_t) vector_1D @@ -265,7 +265,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D ! PURPOSE: To define a divergence child type capturing the result of applying a divergence operator to a gradient. ! KEYWORDS: 1D, laplacian ! CONTEXT: Although a mathematical a divergence, this type additionally provides a type-bound procedure that - ! returns the number of boundary-adjacent points at which the Laplacian aproximation's accuracy drops by + ! returns the number of boundary-adjacent points at which the Laplacian approximation's accuracy drops by ! by one order relative to the parent divergence type. type, extends(divergence_1D_t) :: laplacian_1D_t @@ -277,6 +277,10 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D interface + ! PURPOSE: To provide the differential area for use in surface integrals. + ! KEYWORDS: surface integral, area integral, double integral, numerical quadrature, mimetic discretization + ! CONTEXT: Use this in expressions of the form .SS. (f .x. (v .dot. dA)) with a scalar_1D_t f and vector_1D_t v + pure module function dA(self) !! Result is the grid's discrete surface-area differential for use in surface integrals of the form !! .SS. (f .x. (v .dot. dA)) @@ -285,6 +289,10 @@ pure module function dA(self) double precision dA end function + ! PURPOSE: To provide a uniform cell width along the x-coordinate spatial direction. + ! KEYWORDS: abcissa, mesh spacing + ! CONTEXT: Use this function to produce cell widths for uniform 1D meshes. + pure module function dx(self) !! Result is the uniform cell width implicit none @@ -292,13 +300,23 @@ pure module function dx(self) double precision dx end function + ! PURPOSE: To provide the staggered-grid locations at which scalar values are stored: cell centers plus domain boundaries. + ! KEYWORDS: staggered grid, scalar field, cell centers + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete scalar locations for + ! initialization-function sampling, printing, or plotting. + pure module function scalar_1D_grid(self) result(cell_centers_extended) - !! Result is the array of locations at which 1D scalars are defined: cell centers agumented by spatial boundaries + !! Result is the array of locations at which 1D scalars are defined: cell centers augmented by spatial boundaries implicit none class(scalar_1D_t), intent(in) :: self double precision, allocatable :: cell_centers_extended(:) end function + ! PURPOSE: To provide staggered-grid locations at which vector values are stored: cell faces. + ! KEYWORDS: abcissa, cell faces + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete vector locations for + ! initialization-function sampling, printing, or plotting. + pure module function vector_1D_grid(self) result(cell_faces) !! Result is the array of cell face locations (of unit area for 1D) at which 1D vectors are defined implicit none @@ -306,6 +324,11 @@ pure module function vector_1D_grid(self) result(cell_faces) double precision, allocatable :: cell_faces(:) end function + ! PURPOSE: To provide staggered-grid locations at which divergence values are stored: cell centers. + ! KEYWORDS: cell centers, staggered grid, divergence + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for + ! initialization-function sampling, printing, or plotting. + pure module function divergence_1D_grid(self) result(cell_centers) !! Result is the array of cell centers at which 1D divergences are defined implicit none @@ -313,6 +336,10 @@ pure module function divergence_1D_grid(self) result(cell_centers) double precision, allocatable :: cell_centers(:) end function + ! PURPOSE: To provide the cell-centered values of scalar quantities. + ! KEYWORDS: cell centers, staggered grid, scalar field + ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete scalar values. + pure module function scalar_1D_values(self) result(cell_centers_extended_values) !! Result is an array of 1D scalar values at boundaries and cell centers implicit none @@ -320,6 +347,10 @@ pure module function scalar_1D_values(self) result(cell_centers_extended_values) double precision, allocatable :: cell_centers_extended_values(:) end function + ! PURPOSE: To provide the cell face-centered values of vector quantities. + ! KEYWORDS: staggered grid, vector field + ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete vector values. + pure module function vector_1D_values(self) result(face_centered_values) !! Result is an array of the 1D vector values at cell faces (of unit area 1D) implicit none @@ -327,6 +358,10 @@ pure module function vector_1D_values(self) result(face_centered_values) double precision, allocatable :: face_centered_values(:) end function + ! PURPOSE: To provide the cell-centered values of divergences. + ! KEYWORDS: staggered grid, divergence + ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete divergence values. + pure module function divergence_1D_values(self) result(cell_centered_values) !! Result is an array of 1D divergences at cell centers implicit none @@ -334,6 +369,10 @@ pure module function divergence_1D_values(self) result(cell_centered_values) double precision, allocatable :: cell_centered_values(:) end function + ! PURPOSE: To compute mimetic approximations to the gradient of scalar fields. + ! KEYWORDS: gradient, differential operator + ! CONTEXT: Invoke this function via the unary .grad. operator with a right-hand-side, scalar-field operand. + pure module function grad(self) result(gradient_1D) !! Result is mimetic gradient of the scalar_1D_t "self" implicit none @@ -341,6 +380,10 @@ pure module function grad(self) result(gradient_1D) type(gradient_1D_t) gradient_1D end function + ! PURPOSE: To compute mimetic approximations to the Laplacian of a scalar field. + ! KEYWORDS: Laplacian, differential operator + ! CONTEXT: Invoke this function via the unary .laplacian. operator with a right-hand-side, scalar-field operand. + pure module function laplacian(self) result(laplacian_1D) !! Result is mimetic Laplacian of the scalar_1D_t "self" implicit none @@ -348,6 +391,10 @@ pure module function laplacian(self) result(laplacian_1D) type(laplacian_1D_t) laplacian_1D end function + ! PURPOSE: To report the number of boundary-adjacent locations at which the Laplacian has reduced-order accuracy. + ! KEYWORDS: Laplacian, boundary, order of accuracy + ! CONTEXT: Use this function to determine the region of slightly slower convergence for mimetic Laplacian approximations. + pure module function reduced_order_boundary_depth(self) result(num_nodes) !! Result is number of nodes away from the boundary for which convergence rate is one degree lower implicit none @@ -355,6 +402,10 @@ pure module function reduced_order_boundary_depth(self) result(num_nodes) integer num_nodes end function + ! PURPOSE: To compute mimetic approximations to the divergence of a vector field. + ! KEYWORDS: divergence, vector field + ! CONTEXT: Invoke this function via the unary .div. operator with a right-hand-side vector-field operand. + pure module function div(self) result(divergence_1D) !! Result is mimetic divergence of the vector_1D_t "self" implicit none @@ -362,6 +413,12 @@ pure module function div(self) result(divergence_1D) type(divergence_1D_t) divergence_1D !! discrete divergence end function + ! PURPOSE: To perform mimetic volume integration of a vector/scalar-gradient dot product. + ! KEYWORDS: triple integral, volume integral + ! CONTEXT: Invoke this function in expressions of the form .SSS. (v .dot. .grad. f) * dV + ! with a vector_1D_t v, a scalar f, and a differential volume dV. + + pure module function volume_integrate_vector_dot_grad_scalar_1D(integrand) result(integral) !! Result is the mimetic quadrature corresponding to a volume integral of a vector-gradient dot product implicit none @@ -369,6 +426,11 @@ pure module function volume_integrate_vector_dot_grad_scalar_1D(integrand) resul double precision integral end function + ! PURPOSE: To perform mimetic volume integration of a scalar/divergence dot product. + ! KEYWORDS: triple integral, volume integral + ! CONTEXT: Invoke this function in expressions of the form .SSS. (f * .div. v) * dV + ! with a vector_1D_t v, a scalar f, and a differential volume dV. + pure module function volume_integrate_scalar_x_divergence_1D(integrand) result(integral) !! Result is the mimetic quadrature corresponding to a volume integral of a scalar-divergence product implicit none @@ -376,13 +438,23 @@ pure module function volume_integrate_scalar_x_divergence_1D(integrand) result(i double precision integral end function + ! PURPOSE: To perform mimetic surface integration of a scalar/vector product. + ! KEYWORDS: double integral, surface integral, flux + ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) + ! with a vector_1D_t v, a scalar_1D_t f, and a differential area dA. + pure module function surface_integrate_vector_x_scalar_1D(integrand) result(integral) - !! Result is the mimetic quadrature correspondingto a surface integral of a scalar-vector product + !! Result is the mimetic quadrature corresponding to a surface integral of a scalar-vector product implicit none class(weighted_product_1D_t), intent(in) :: integrand double precision integral end function + ! PURPOSE: To compute the scalar (dot) product of a vector and the gradient of a scalar. + ! KEYWORDS: scalar product, dot product, inner product + ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form + ! g .dot. b with a gradient_1D_t g and a vector_1D_t b. + pure module function dot(vector_1D, gradient_1D) result(vector_dot_gradient_1D) !! Result is the mimetic divergence of the vector_1D_t "self" implicit none @@ -391,6 +463,11 @@ pure module function dot(vector_1D, gradient_1D) result(vector_dot_gradient_1D) type(vector_dot_gradient_1D_t) vector_dot_gradient_1D end function + ! PURPOSE: To compute the scalar (not) product of a vector and a differential area. + ! KEYWORDS: dot product, flux, surface-normal + ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form + ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. + pure module function dot_surface_normal(vector_1D, dS) result(v_dot_dS) !! Result is magnitude of a vector/surface-normal dot product for use in surface integrals of the form !! `.SS. (f .x. (v .dot. dA))` @@ -401,6 +478,11 @@ pure module function dot_surface_normal(vector_1D, dS) result(v_dot_dS) type(vector_1D_t) v_dot_dS end function + ! PURPOSE: To compute a scalar/vector product weighted for subsequent surface integration. + ! KEYWORDS: integrand, surface integral, double integral + ! CONTEXT: Inovke this function .x. binary infix operator in expressions of the form + ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. + pure module function weighted_premultiply(scalar_1D, vector_1D) result(weighted_product_1D) !! Result is the product of a boundary-weighted vector_1D_t with a scalar_1D_t implicit none @@ -409,6 +491,12 @@ pure module function weighted_premultiply(scalar_1D, vector_1D) result(weighted_ type(weighted_product_1D_t) weighted_product_1D end function + ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a vector + ! and the gradient of a scalar. + ! KEYWORDS: quadrature, numerical integration, coefficients, weights + ! CONTEXT: Inovke this function via the "weights" generic binding to produce the quadrature weights + ! associated with mimetic approximations to gradients. + pure module function gradient_1D_weights(self) result(weights) !! Result is an array of quadrature coefficients that can be used to compute a weighted !! inner product of a vector_1D_t object and a gradient_1D_t object. @@ -417,14 +505,25 @@ pure module function gradient_1D_weights(self) result(weights) double precision, allocatable :: weights(:) end function + ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a scalar + ! and the divergence of a vector. + ! KEYWORDS: quadrature, numerical integration, coefficients, weights + ! CONTEXT: Invoke this function via the "weights" generic binding to produce the quadrature weights + ! associated with mimetic approximations to divergences. + pure module function divergence_1D_weights(self) result(weights) !! Result is an array of quadrature coefficients that can be used to compute a weighted - !! inner product of a vector_1D_t object and a gradient_1D_t object. + !! inner product of a scalar_1D_t object and a divergence_1D_t object. implicit none class(tensor_1D_t), intent(in) :: self double precision, allocatable :: weights(:) end function + ! PURPOSE: To compute the product of a scalar and a divergence + ! KEYWORDS: scalar multiplication + ! CONTEXT: Invoke this function via the binary infix operator "*" with scalar and divergence left- and + ! right-hand operands, respectively + pure module function premultiply_scalar_1D(scalar_1D, divergence_1D) result(scalar_x_divergence_1D) !! Result is the point-wise product of a 1D scalar field and the divergence of a 1D vector field implicit none @@ -433,6 +532,11 @@ pure module function premultiply_scalar_1D(scalar_1D, divergence_1D) result(scal type(scalar_x_divergence_1D_t) scalar_x_divergence_1D end function + ! PURPOSE: To compute the product of a divergence and a scalar + ! KEYWORDS: scalar multiplication + ! CONTEXT: Invoke this function via the binary infix operator "*" with divergence and scalar left- and + ! right-hand operands, respectively + pure module function postmultiply_scalar_1D(divergence_1D, scalar_1D) result(scalar_x_divergence_1D) !! Result is the point-wise product of a 1D scalar field and the divergence of a 1D vector field implicit none From 6377e4e7e726d584e917ee62c462f5bf13d70a68 Mon Sep 17 00:00:00 2001 From: Katherine Rasmussen Date: Tue, 20 Jan 2026 18:19:28 -0800 Subject: [PATCH 06/10] Populate procedure definitions with metadata comments --- src/formal/divergence_1D_s.F90 | 27 +++++++++++++++- src/formal/divergence_operator_1D_s.F90 | 6 +++- src/formal/gradient_1D_s.F90 | 11 +++++++ src/formal/gradient_operator_1D_s.F90 | 8 +++-- src/formal/laplacian_s.f90 | 4 +++ src/formal/scalar_1D_s.F90 | 32 +++++++++++++++++- src/formal/scalar_x_divergence_1D_s.F90 | 5 +++ src/formal/tensor_1D_s.f90 | 9 ++++++ src/formal/vector_1D_s.F90 | 43 ++++++++++++++++++++++++- src/formal/vector_dot_gradient_1D_s.F90 | 5 +++ src/formal/weighted_product_1D_s.F90 | 5 +++ 11 files changed, 149 insertions(+), 6 deletions(-) diff --git a/src/formal/divergence_1D_s.F90 b/src/formal/divergence_1D_s.F90 index b7aa0d4..0dad672 100644 --- a/src/formal/divergence_1D_s.F90 +++ b/src/formal/divergence_1D_s.F90 @@ -27,6 +27,11 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) #endif + ! PURPOSE: To compute the product of a scalar and a divergence + ! KEYWORDS: scalar multiplication + ! CONTEXT: Invoke this function via the binary infix operator "*" with scalar and divergence left- and + ! right-hand operands, respectively + module procedure premultiply_scalar_1D call_julienne_assert(size(scalar_1D%values_) .equalsExpected. size(divergence_1D%values_) + 2) scalar_x_divergence_1D%tensor_1D_t = & @@ -39,18 +44,38 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) call_julienne_assert(size(scalar_x_divergence_1D%weights_) .equalsExpected. size(divergence_1D%values_)+2) end procedure + ! PURPOSE: To compute the product of a divergence and a scalar + ! KEYWORDS: scalar multiplication + ! CONTEXT: Invoke this function via the binary infix operator "*" with divergence and scalar left- and + ! right-hand operands, respectively + module procedure postmultiply_scalar_1D scalar_x_divergence_1D = premultiply_scalar_1D(scalar_1D, divergence_1D) end procedure + ! PURPOSE: To provide the cell-centered values of divergences. + ! KEYWORDS: staggered grid, divergence + ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete divergence values. + module procedure divergence_1D_values cell_centered_values = self%values_ end procedure + ! PURPOSE: To provide staggered-grid locations at which divergence values are stored: cell centers. + ! KEYWORDS: cell centers, staggered grid, divergence + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for + ! initialization-function sampling, printing, or plotting. + module procedure divergence_1D_grid cell_centers = cell_center_locations(self%x_min_, self%x_max_, self%cells_) end procedure + ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a scalar + ! and the divergence of a vector. + ! KEYWORDS: quadrature, numerical integration, coefficients, weights + ! CONTEXT: Invoke this function via the "weights" generic binding to produce the quadrature weights + ! associated with mimetic approximations to divergences. + module procedure divergence_1D_weights integer c @@ -73,4 +98,4 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) call_julienne_assert(size(weights) .equalsExpected. self%cells_+2) end procedure -end submodule divergence_1D_s \ No newline at end of file +end submodule divergence_1D_s diff --git a/src/formal/divergence_operator_1D_s.F90 b/src/formal/divergence_operator_1D_s.F90 index fd0fc18..694d12f 100644 --- a/src/formal/divergence_operator_1D_s.F90 +++ b/src/formal/divergence_operator_1D_s.F90 @@ -36,6 +36,10 @@ pure function negate_and_flip(A) result(Ap) #endif + ! PURPOSE: To construct an object representing a 1D mimetic divergence operator. + ! KEYWORDS: 1D, divergence operator, sparse matrix, constructor + ! CONTEXT: Use this type to assemble a divergence-operator matrix for printing. + module procedure construct_1D_divergence_operator double precision, allocatable :: Ap(:,:) @@ -186,4 +190,4 @@ pure function e(dir, length) result(unit_vector) end procedure -end submodule divergence_operator_1D_s \ No newline at end of file +end submodule divergence_operator_1D_s diff --git a/src/formal/gradient_1D_s.F90 b/src/formal/gradient_1D_s.F90 index e3589f1..a354d66 100644 --- a/src/formal/gradient_1D_s.F90 +++ b/src/formal/gradient_1D_s.F90 @@ -16,6 +16,12 @@ contains + ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a vector + ! and the gradient of a scalar. + ! KEYWORDS: quadrature, numerical integration, coefficients, weights + ! CONTEXT: Inovke this function via the "weights" generic binding to produce the quadrature weights + ! associated with mimetic approximations to gradients. + module procedure gradient_1D_weights integer face @@ -39,6 +45,11 @@ end procedure + ! PURPOSE: To compute the scalar (dot) product of a vector and the gradient of a scalar. + ! KEYWORDS: scalar product, dot product, inner product + ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form + ! g .dot. b with a gradient_1D_t g and a vector_1D_t b. + module procedure dot call_julienne_assert(size(gradient_1D%values_) .equalsExpected. size(vector_1D%values_)) call_julienne_assert(gradient_1D%order_ .equalsExpected. vector_1D%order_) diff --git a/src/formal/gradient_operator_1D_s.F90 b/src/formal/gradient_operator_1D_s.F90 index 0298e58..e723dfa 100644 --- a/src/formal/gradient_operator_1D_s.F90 +++ b/src/formal/gradient_operator_1D_s.F90 @@ -36,7 +36,11 @@ pure function negate_and_flip(A) result(Ap) end function #endif - + + ! PURPOSE: To construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. + ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix + ! CONTEXT: Use this function to construct a sparse-matrix represntation of a mimetic gradient operator. + module procedure construct_1D_gradient_operator call_julienne_assert(cells .isAtLeast. 2*k) @@ -168,4 +172,4 @@ pure function e(dir, length) result(unit_vector) end procedure -end submodule gradient_operator_1D_s \ No newline at end of file +end submodule gradient_operator_1D_s diff --git a/src/formal/laplacian_s.f90 b/src/formal/laplacian_s.f90 index a8a4eaa..2dd1e1d 100644 --- a/src/formal/laplacian_s.f90 +++ b/src/formal/laplacian_s.f90 @@ -5,6 +5,10 @@ implicit none contains + ! PURPOSE: To report the number of boundary-adjacent locations at which the Laplacian has reduced-order accuracy. + ! KEYWORDS: Laplacian, boundary, order of accuracy + ! CONTEXT: Use this function to determine the region of slightly slower convergence for mimetic Laplacian approximations. + module procedure reduced_order_boundary_depth num_nodes = self%boundary_depth_ end procedure diff --git a/src/formal/scalar_1D_s.F90 b/src/formal/scalar_1D_s.F90 index 47fa585..b60fae4 100644 --- a/src/formal/scalar_1D_s.F90 +++ b/src/formal/scalar_1D_s.F90 @@ -23,6 +23,12 @@ #ifndef __GFORTRAN__ + ! PURPOSE: To construct a new scalar_1D_t object by assigning each argument to a corresponding + ! corresponding component of the new object. + ! KEYWORDS: 1D scalar field constructor + ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set + ! of uniformly-spaced cell centers along one spatial dimension bounded by x_min and x_max. + module procedure construct_1D_scalar_from_function call_julienne_assert(x_max .greaterThan. x_min) call_julienne_assert(cells .isAtLeast. 2*order) @@ -35,6 +41,12 @@ #else + ! PURPOSE: To construct a new scalar_1D_t object by assigning each argument to a corresponding + ! corresponding component of the new object. + ! KEYWORDS: 1D scalar field constructor + ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set + ! of uniformly-spaced cell centers along one spatial dimension bounded by x_min and x_max. + pure module function construct_1D_scalar_from_function(initializer, order, cells, x_min, x_max) result(scalar_1D) procedure(scalar_1D_initializer_i), pointer :: initializer integer, intent(in) :: order !! order of accuracy @@ -65,6 +77,10 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) #endif + ! PURPOSE: To compute mimetic approximations to the gradient of scalar fields. + ! KEYWORDS: gradient, differential operator + ! CONTEXT: Invoke this function via the unary .grad. operator with a right-hand-side, scalar-field operand. + module procedure grad integer c @@ -82,6 +98,10 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) end procedure + ! PURPOSE: To compute mimetic approximations to the Laplacian of a scalar field. + ! KEYWORDS: Laplacian, differential operator + ! CONTEXT: Invoke this function via the unary .laplacian. operator with a right-hand-side, scalar-field operand. + module procedure laplacian #ifndef __GFORTRAN__ @@ -96,6 +116,11 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) end procedure + + ! PURPOSE: To provide the cell-centered values of scalar quantities. + ! KEYWORDS: cell centers, staggered grid, scalar field + ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete scalar values. + module procedure scalar_1D_values cell_centers_extended_values = self%values_ end procedure @@ -111,8 +136,13 @@ pure function scalar_1D_grid_locations(x_min, x_max, cells) result(x) end associate end function + ! PURPOSE: To provide the staggered-grid locations at which scalar values are stored: cell centers plus domain boundaries. + ! KEYWORDS: staggered grid, scalar field, cell centers + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete scalar locations for + ! initialization-function sampling, printing, or plotting. + module procedure scalar_1D_grid cell_centers_extended = scalar_1D_grid_locations(self%x_min_, self%x_max_, self%cells_) end procedure -end submodule scalar_1D_s \ No newline at end of file +end submodule scalar_1D_s diff --git a/src/formal/scalar_x_divergence_1D_s.F90 b/src/formal/scalar_x_divergence_1D_s.F90 index 93b9b04..6fc7fa7 100644 --- a/src/formal/scalar_x_divergence_1D_s.F90 +++ b/src/formal/scalar_x_divergence_1D_s.F90 @@ -9,6 +9,11 @@ contains + ! PURPOSE: To perform mimetic volume integration of a scalar/divergence dot product. + ! KEYWORDS: triple integral, volume integral + ! CONTEXT: Invoke this function in expressions of the form .SSS. (f * .div. v) * dV + ! with a vector_1D_t v, a scalar f, and a differential volume dV. + module procedure volume_integrate_scalar_x_divergence_1D call_julienne_assert(size(integrand%weights_ ) .equalsExpected. size(integrand%values_)+2) integral = sum(integrand%weights_ * [0D0, integrand%values_, 0D0]) diff --git a/src/formal/tensor_1D_s.f90 b/src/formal/tensor_1D_s.f90 index c67558b..a06f6c8 100644 --- a/src/formal/tensor_1D_s.f90 +++ b/src/formal/tensor_1D_s.f90 @@ -5,6 +5,11 @@ implicit none contains + ! PURPOSE: To construct a new tensor_1D_t object by assigning each argument to a corresponding + ! corresponding component of the new object. + ! KEYWORDS: 1D tensor constructor + ! CONTEXT: Constructors for child types assign this function's result to to the child object's parent component. + module procedure construct_1D_tensor_from_components tensor_1D%values_ = values tensor_1D%x_min_ = x_min @@ -13,6 +18,10 @@ tensor_1D%order_ = order end procedure + ! PURPOSE: To provide a uniform cell width along the x-coordinate spatial direction. + ! KEYWORDS: abcissa, mesh spacing + ! CONTEXT: Use this function to produce cell widths for uniform 1D meshes. + module procedure dx dx = (self%x_max_ - self%x_min_)/self%cells_ end procedure diff --git a/src/formal/vector_1D_s.F90 b/src/formal/vector_1D_s.F90 index 6410b31..ade664f 100644 --- a/src/formal/vector_1D_s.F90 +++ b/src/formal/vector_1D_s.F90 @@ -22,6 +22,11 @@ contains + ! PURPOSE: To compute the scalar (not) product of a vector and a differential area. + ! KEYWORDS: dot product, flux, surface-normal + ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form + ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. + module procedure dot_surface_normal v_dot_dS%tensor_1D_t = tensor_1D_t(vector_1D%values_*dS, vector_1D%x_min_, vector_1D%x_max_, vector_1D%cells_, vector_1D%order_) v_dot_dS%divergence_operator_1D_ = vector_1D%divergence_operator_1D_ @@ -29,6 +34,11 @@ #ifndef __GFORTRAN__ + ! PURPOSE: To construct a new vector_1D_t object by sampling a function of one spatial dimension. + ! KEYWORDS: 1D vector field constructor + ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set + ! of uniformly-spaced cell faces along one spatial dimension bounded by x_min and x_max. + module procedure construct_1D_vector_from_function call_julienne_assert(x_max .greaterThan. x_min) call_julienne_assert(cells .isAtLeast. 2*order+1) @@ -41,6 +51,11 @@ #else + ! PURPOSE: To construct a new vector_1D_t object by sampling a function of one spatial dimension. + ! KEYWORDS: 1D vector field constructor + ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set + ! of uniformly-spaced cell faces along one spatial dimension bounded by x_min and x_max. + pure module function construct_1D_vector_from_function(initializer, order, cells, x_min, x_max) result(vector_1D) procedure(vector_1D_initializer_i), pointer :: initializer integer, intent(in) :: order !! order of accuracy @@ -60,11 +75,20 @@ pure module function construct_1D_vector_from_function(initializer, order, cells #endif + ! PURPOSE: To construct a new vector_1D_t object from a parent tensor and a divergence operator object. + ! KEYWORDS: 1D vector field constructor + ! CONTEXT: Invoke this constructor with a an object to be used to define the constructed parent component + ! divergence-operator matrix component. + module procedure construct_from_components vector_1D%tensor_1D_t = tensor_1D vector_1D%divergence_operator_1D_ = divergence_operator_1D end procedure + ! PURPOSE: To compute mimetic approximations to the divergence of a vector field. + ! KEYWORDS: divergence, vector field + ! CONTEXT: Invoke this function via the unary .div. operator with a right-hand-side vector-field operand. + module procedure div integer center @@ -90,6 +114,10 @@ pure module function construct_1D_vector_from_function(initializer, order, cells end procedure + ! PURPOSE: To provide the cell face-centered values of vector quantities. + ! KEYWORDS: staggered grid, vector field + ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete vector values. + module procedure vector_1D_values face_centered_values = self%values_ end procedure @@ -105,10 +133,20 @@ pure function faces(x_min, x_max, cells) result(x) end associate end function + ! PURPOSE: To provide staggered-grid locations at which vector values are stored: cell faces. + ! KEYWORDS: abcissa, cell faces + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete vector locations for + ! initialization-function sampling, printing, or plotting. + module procedure vector_1D_grid cell_faces = faces(self%x_min_, self%x_max_, self%cells_) end procedure + ! PURPOSE: To compute a scalar/vector product weighted for subsequent surface integration. + ! KEYWORDS: integrand, surface integral, double integral + ! CONTEXT: Inovke this function .x. binary infix operator in expressions of the form + ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. + module procedure weighted_premultiply !! vector values at faces scalar values at cell centers + boundaries @@ -190,8 +228,11 @@ pure function postmultiply_diagonal(A,d) result(AD) end procedure + ! PURPOSE: To provide the differential area for use in surface integrals. + ! KEYWORDS: surface integral, area integral, double integral, numerical quadrature, mimetic discretization + ! CONTEXT: Use this in expressions of the form .SS. (f .x. (v .dot. dA)) with a scalar_1D_t f and vector_1D_t v module procedure dA dA = 1D0 end procedure -end submodule vector_1D_s \ No newline at end of file +end submodule vector_1D_s diff --git a/src/formal/vector_dot_gradient_1D_s.F90 b/src/formal/vector_dot_gradient_1D_s.F90 index f91e460..8cdaf90 100644 --- a/src/formal/vector_dot_gradient_1D_s.F90 +++ b/src/formal/vector_dot_gradient_1D_s.F90 @@ -9,6 +9,11 @@ contains + ! PURPOSE: To perform mimetic volume integration of a vector/scalar-gradient dot product. + ! KEYWORDS: triple integral, volume integral + ! CONTEXT: Invoke this function in expressions of the form .SSS. (v .dot. .grad. f) * dV + ! with a vector_1D_t v, a scalar f, and a differential volume dV. + module procedure volume_integrate_vector_dot_grad_scalar_1D call_julienne_assert(size(integrand%weights_ ) .equalsExpected. size(integrand%values_)) integral = sum(integrand%weights_ * integrand%values_) diff --git a/src/formal/weighted_product_1D_s.F90 b/src/formal/weighted_product_1D_s.F90 index a802b59..66a5493 100644 --- a/src/formal/weighted_product_1D_s.F90 +++ b/src/formal/weighted_product_1D_s.F90 @@ -6,6 +6,11 @@ contains + ! PURPOSE: To perform mimetic surface integration of a scalar/vector product. + ! KEYWORDS: double integral, surface integral, flux + ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) + ! with a vector_1D_t v, a scalar_1D_t f, and a differential area dA. + module procedure surface_integrate_vector_x_scalar_1D integral = sum(integrand%values_) end procedure From 6cff464bbbde090dd0bf8bdce5e19850ae2c3163 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Mon, 26 Jan 2026 14:13:03 -0800 Subject: [PATCH 07/10] chore: remove trailing blank spaces --- src/formal/divergence_1D_s.F90 | 6 +++--- src/formal/gradient_operator_1D_s.F90 | 4 ++-- src/formal/mimetic_operators_1D_m.F90 | 2 +- src/formal/tensor_1D_s.f90 | 2 +- src/formal/tensors_1D_m.F90 | 27 +++++++++++++-------------- src/formal/vector_1D_s.F90 | 2 +- src/formal/weighted_product_1D_s.F90 | 2 +- 7 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/formal/divergence_1D_s.F90 b/src/formal/divergence_1D_s.F90 index 0dad672..ada8ee9 100644 --- a/src/formal/divergence_1D_s.F90 +++ b/src/formal/divergence_1D_s.F90 @@ -27,7 +27,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) #endif - ! PURPOSE: To compute the product of a scalar and a divergence + ! PURPOSE: To compute the product of a scalar and a divergence ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with scalar and divergence left- and ! right-hand operands, respectively @@ -44,7 +44,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) call_julienne_assert(size(scalar_x_divergence_1D%weights_) .equalsExpected. size(divergence_1D%values_)+2) end procedure - ! PURPOSE: To compute the product of a divergence and a scalar + ! PURPOSE: To compute the product of a divergence and a scalar ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with divergence and scalar left- and ! right-hand operands, respectively @@ -63,7 +63,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) ! PURPOSE: To provide staggered-grid locations at which divergence values are stored: cell centers. ! KEYWORDS: cell centers, staggered grid, divergence - ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for ! initialization-function sampling, printing, or plotting. module procedure divergence_1D_grid diff --git a/src/formal/gradient_operator_1D_s.F90 b/src/formal/gradient_operator_1D_s.F90 index e723dfa..077f4cd 100644 --- a/src/formal/gradient_operator_1D_s.F90 +++ b/src/formal/gradient_operator_1D_s.F90 @@ -38,8 +38,8 @@ pure function negate_and_flip(A) result(Ap) #endif ! PURPOSE: To construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. - ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix - ! CONTEXT: Use this function to construct a sparse-matrix represntation of a mimetic gradient operator. + ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix + ! CONTEXT: Use this function to construct a sparse-matrix represntation of a mimetic gradient operator. module procedure construct_1D_gradient_operator diff --git a/src/formal/mimetic_operators_1D_m.F90 b/src/formal/mimetic_operators_1D_m.F90 index 42e2b2f..af61275 100644 --- a/src/formal/mimetic_operators_1D_m.F90 +++ b/src/formal/mimetic_operators_1D_m.F90 @@ -56,7 +56,7 @@ pure module function construct_matrix_operator(upper, inner, lower) result(mimet interface gradient_operator_1D_t ! PURPOSE: To construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. - ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix + ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix ! CONTEXT: Use this function to construct a sparse-matrix represntation of a mimetic gradient operator. pure module function construct_1D_gradient_operator(k, dx, cells) result(gradient_operator_1D) diff --git a/src/formal/tensor_1D_s.f90 b/src/formal/tensor_1D_s.f90 index a06f6c8..8657202 100644 --- a/src/formal/tensor_1D_s.f90 +++ b/src/formal/tensor_1D_s.f90 @@ -7,7 +7,7 @@ ! PURPOSE: To construct a new tensor_1D_t object by assigning each argument to a corresponding ! corresponding component of the new object. - ! KEYWORDS: 1D tensor constructor + ! KEYWORDS: 1D tensor constructor ! CONTEXT: Constructors for child types assign this function's result to to the child object's parent component. module procedure construct_1D_tensor_from_components diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index ed0beef..425388c 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -80,7 +80,7 @@ pure function vector_1D_initializer_i(x) result(v) ! PURPOSE: To construct a new tensor_1D_t object by assigning each argument to a corresponding ! corresponding component of the new object. - ! KEYWORDS: 1D tensor constructor + ! KEYWORDS: 1D tensor constructor ! CONTEXT: Constructors for child types assign this function's result to to the child object's parent component. pure module function construct_1D_tensor_from_components(values, x_min, x_max, cells, order) result(tensor_1D) @@ -98,7 +98,7 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c ! PURPOSE: To encapsulate a scalar function of one spatial dimension as a tensor with a gradient operator. ! KEYWORDS: 1D scalar field abstraction - ! CONTEXT: Combine with other tensors via expressions that may include differential operators + ! CONTEXT: Combine with other tensors via expressions that may include differential operators type, extends(tensor_1D_t) :: scalar_1D_t !! Encapsulate scalar values at cell centers and boundaries @@ -138,7 +138,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells ! PURPOSE: To encapsulate a vector function of one spatial dimension as a tensor with a divergence operator. ! KEYWORDS: 1D vector field abstraction - ! CONTEXT: Combine with other tensors via expressions that may include differential operators + ! CONTEXT: Combine with other tensors via expressions that may include differential operators type, extends(tensor_1D_t) :: vector_1D_t !! Encapsulate 1D vector values at cell faces (of unit area for 1D) and corresponding operators @@ -233,7 +233,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D ! PURPOSE: To define a tensor child type capturing the divergence of a vector function of one spatial dimension. ! KEYWORDS: 1D, divergence - ! CONTEXT: Although a mathematical scalar, this type differs from scalar_1D_t in that the values are stored + ! CONTEXT: Although a mathematical scalar, this type differs from scalar_1D_t in that the values are stored ! _only_ at cell centers, whereas a scalar_1D_t object additionally has values at domain boundaries. type, extends(tensor_1D_t) :: divergence_1D_t @@ -249,9 +249,9 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private :: divergence_1D_grid end type - ! PURPOSE: - ! KEYWORDS: - ! CONTEXT: + ! PURPOSE: + ! KEYWORDS: + ! CONTEXT: type, extends(tensor_1D_t) :: scalar_x_divergence_1D_t !! product of a 1D scalar field and a 1D divergence field @@ -313,7 +313,7 @@ pure module function scalar_1D_grid(self) result(cell_centers_extended) end function ! PURPOSE: To provide staggered-grid locations at which vector values are stored: cell faces. - ! KEYWORDS: abcissa, cell faces + ! KEYWORDS: abcissa, cell faces ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete vector locations for ! initialization-function sampling, printing, or plotting. @@ -326,7 +326,7 @@ pure module function vector_1D_grid(self) result(cell_faces) ! PURPOSE: To provide staggered-grid locations at which divergence values are stored: cell centers. ! KEYWORDS: cell centers, staggered grid, divergence - ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for + ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for ! initialization-function sampling, printing, or plotting. pure module function divergence_1D_grid(self) result(cell_centers) @@ -418,7 +418,6 @@ pure module function div(self) result(divergence_1D) ! CONTEXT: Invoke this function in expressions of the form .SSS. (v .dot. .grad. f) * dV ! with a vector_1D_t v, a scalar f, and a differential volume dV. - pure module function volume_integrate_vector_dot_grad_scalar_1D(integrand) result(integral) !! Result is the mimetic quadrature corresponding to a volume integral of a vector-gradient dot product implicit none @@ -440,9 +439,9 @@ pure module function volume_integrate_scalar_x_divergence_1D(integrand) result(i ! PURPOSE: To perform mimetic surface integration of a scalar/vector product. ! KEYWORDS: double integral, surface integral, flux - ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) + ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) ! with a vector_1D_t v, a scalar_1D_t f, and a differential area dA. - + pure module function surface_integrate_vector_x_scalar_1D(integrand) result(integral) !! Result is the mimetic quadrature corresponding to a surface integral of a scalar-vector product implicit none @@ -519,7 +518,7 @@ pure module function divergence_1D_weights(self) result(weights) double precision, allocatable :: weights(:) end function - ! PURPOSE: To compute the product of a scalar and a divergence + ! PURPOSE: To compute the product of a scalar and a divergence ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with scalar and divergence left- and ! right-hand operands, respectively @@ -532,7 +531,7 @@ pure module function premultiply_scalar_1D(scalar_1D, divergence_1D) result(scal type(scalar_x_divergence_1D_t) scalar_x_divergence_1D end function - ! PURPOSE: To compute the product of a divergence and a scalar + ! PURPOSE: To compute the product of a divergence and a scalar ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with divergence and scalar left- and ! right-hand operands, respectively diff --git a/src/formal/vector_1D_s.F90 b/src/formal/vector_1D_s.F90 index ade664f..ac33727 100644 --- a/src/formal/vector_1D_s.F90 +++ b/src/formal/vector_1D_s.F90 @@ -134,7 +134,7 @@ pure function faces(x_min, x_max, cells) result(x) end function ! PURPOSE: To provide staggered-grid locations at which vector values are stored: cell faces. - ! KEYWORDS: abcissa, cell faces + ! KEYWORDS: abcissa, cell faces ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete vector locations for ! initialization-function sampling, printing, or plotting. diff --git a/src/formal/weighted_product_1D_s.F90 b/src/formal/weighted_product_1D_s.F90 index 66a5493..d08e324 100644 --- a/src/formal/weighted_product_1D_s.F90 +++ b/src/formal/weighted_product_1D_s.F90 @@ -8,7 +8,7 @@ ! PURPOSE: To perform mimetic surface integration of a scalar/vector product. ! KEYWORDS: double integral, surface integral, flux - ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) + ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) ! with a vector_1D_t v, a scalar_1D_t f, and a differential area dA. module procedure surface_integrate_vector_x_scalar_1D From 72bf769f5fa93e0598f2185e0a437895464b2904 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Mon, 26 Jan 2026 14:15:53 -0800 Subject: [PATCH 08/10] doc(scalar_x_divergence_1D_t): add RAG metadata --- src/formal/tensors_1D_m.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index 425388c..57d59ac 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -249,9 +249,9 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private :: divergence_1D_grid end type - ! PURPOSE: - ! KEYWORDS: - ! CONTEXT: + ! PURPOSE: To define a tensor child for capturing the product of a scalar and divergence + ! KEYWORDS: 1D scalar/divergence product + ! CONTEXT: An instance of this type can serve as an integrand in a .SSS. triple-integral operator. type, extends(tensor_1D_t) :: scalar_x_divergence_1D_t !! product of a 1D scalar field and a 1D divergence field From 304568d381f06681558691e6fc01087557f75739 Mon Sep 17 00:00:00 2001 From: Katherine Rasmussen Date: Thu, 29 Jan 2026 14:21:01 -0800 Subject: [PATCH 09/10] Update RAG metadata to include distinction between type definitions, procedure interfaces, and procedure definitions. --- src/formal/divergence_1D_s.F90 | 10 +-- src/formal/divergence_operator_1D_s.F90 | 2 +- src/formal/gradient_1D_s.F90 | 4 +- src/formal/gradient_operator_1D_s.F90 | 2 +- src/formal/laplacian_s.f90 | 2 +- src/formal/mimetic_operators_1D_m.F90 | 10 +-- src/formal/scalar_1D_s.F90 | 12 ++-- src/formal/scalar_x_divergence_1D_s.F90 | 2 +- src/formal/tensor_1D_s.f90 | 4 +- src/formal/tensors_1D_m.F90 | 92 ++++++++++++------------- src/formal/vector_1D_s.F90 | 18 ++--- src/formal/vector_dot_gradient_1D_s.F90 | 2 +- src/formal/weighted_product_1D_s.F90 | 2 +- 13 files changed, 81 insertions(+), 81 deletions(-) diff --git a/src/formal/divergence_1D_s.F90 b/src/formal/divergence_1D_s.F90 index ada8ee9..c5a7eca 100644 --- a/src/formal/divergence_1D_s.F90 +++ b/src/formal/divergence_1D_s.F90 @@ -27,7 +27,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) #endif - ! PURPOSE: To compute the product of a scalar and a divergence + ! PURPOSE: Definition of procedure to compute the product of a scalar and a divergence ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with scalar and divergence left- and ! right-hand operands, respectively @@ -44,7 +44,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) call_julienne_assert(size(scalar_x_divergence_1D%weights_) .equalsExpected. size(divergence_1D%values_)+2) end procedure - ! PURPOSE: To compute the product of a divergence and a scalar + ! PURPOSE: Definition of procedure to compute the product of a divergence and a scalar ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with divergence and scalar left- and ! right-hand operands, respectively @@ -53,7 +53,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) scalar_x_divergence_1D = premultiply_scalar_1D(scalar_1D, divergence_1D) end procedure - ! PURPOSE: To provide the cell-centered values of divergences. + ! PURPOSE: Definition of procedure to provide the cell-centered values of divergences. ! KEYWORDS: staggered grid, divergence ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete divergence values. @@ -61,7 +61,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) cell_centered_values = self%values_ end procedure - ! PURPOSE: To provide staggered-grid locations at which divergence values are stored: cell centers. + ! PURPOSE: Definition of procedure to provide staggered-grid locations at which divergence values are stored: cell centers. ! KEYWORDS: cell centers, staggered grid, divergence ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for ! initialization-function sampling, printing, or plotting. @@ -70,7 +70,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) cell_centers = cell_center_locations(self%x_min_, self%x_max_, self%cells_) end procedure - ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a scalar + ! PURPOSE: Definition of procedure to compute the quadrature weights for use in the mimetic inner products of a scalar ! and the divergence of a vector. ! KEYWORDS: quadrature, numerical integration, coefficients, weights ! CONTEXT: Invoke this function via the "weights" generic binding to produce the quadrature weights diff --git a/src/formal/divergence_operator_1D_s.F90 b/src/formal/divergence_operator_1D_s.F90 index 694d12f..95d667f 100644 --- a/src/formal/divergence_operator_1D_s.F90 +++ b/src/formal/divergence_operator_1D_s.F90 @@ -36,7 +36,7 @@ pure function negate_and_flip(A) result(Ap) #endif - ! PURPOSE: To construct an object representing a 1D mimetic divergence operator. + ! PURPOSE: Definition of procedure to construct an object representing a 1D mimetic divergence operator. ! KEYWORDS: 1D, divergence operator, sparse matrix, constructor ! CONTEXT: Use this type to assemble a divergence-operator matrix for printing. diff --git a/src/formal/gradient_1D_s.F90 b/src/formal/gradient_1D_s.F90 index a354d66..5442f8a 100644 --- a/src/formal/gradient_1D_s.F90 +++ b/src/formal/gradient_1D_s.F90 @@ -16,7 +16,7 @@ contains - ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a vector + ! PURPOSE: Definition of procedure to compute the quadrature weights for use in the mimetic inner products of a vector ! and the gradient of a scalar. ! KEYWORDS: quadrature, numerical integration, coefficients, weights ! CONTEXT: Inovke this function via the "weights" generic binding to produce the quadrature weights @@ -45,7 +45,7 @@ end procedure - ! PURPOSE: To compute the scalar (dot) product of a vector and the gradient of a scalar. + ! PURPOSE: Definition of procedure to compute the scalar (dot) product of a vector and the gradient of a scalar. ! KEYWORDS: scalar product, dot product, inner product ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form ! g .dot. b with a gradient_1D_t g and a vector_1D_t b. diff --git a/src/formal/gradient_operator_1D_s.F90 b/src/formal/gradient_operator_1D_s.F90 index 077f4cd..ba92a7a 100644 --- a/src/formal/gradient_operator_1D_s.F90 +++ b/src/formal/gradient_operator_1D_s.F90 @@ -37,7 +37,7 @@ pure function negate_and_flip(A) result(Ap) #endif - ! PURPOSE: To construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. + ! PURPOSE: Definition of procedure to construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix ! CONTEXT: Use this function to construct a sparse-matrix represntation of a mimetic gradient operator. diff --git a/src/formal/laplacian_s.f90 b/src/formal/laplacian_s.f90 index 2dd1e1d..ea88d79 100644 --- a/src/formal/laplacian_s.f90 +++ b/src/formal/laplacian_s.f90 @@ -5,7 +5,7 @@ implicit none contains - ! PURPOSE: To report the number of boundary-adjacent locations at which the Laplacian has reduced-order accuracy. + ! PURPOSE: Definition of procedure to report the number of boundary-adjacent locations at which the Laplacian has reduced-order accuracy. ! KEYWORDS: Laplacian, boundary, order of accuracy ! CONTEXT: Use this function to determine the region of slightly slower convergence for mimetic Laplacian approximations. diff --git a/src/formal/mimetic_operators_1D_m.F90 b/src/formal/mimetic_operators_1D_m.F90 index af61275..fead8c1 100644 --- a/src/formal/mimetic_operators_1D_m.F90 +++ b/src/formal/mimetic_operators_1D_m.F90 @@ -36,8 +36,8 @@ pure module function construct_matrix_operator(upper, inner, lower) result(mimet end interface - ! PURPOSE: To encapsulate a one-dimenstional (1D) mimetic gradient operator matrix. - ! KEYWORDS: 1D gradient operator matrix + ! PURPOSE: Definition of type to encapsulate a one-dimenstional (1D) mimetic gradient operator matrix. + ! KEYWORDS: type definition, 1D gradient operator matrix ! CONTEXT: Use this type to assemble gradient-operator matrix for printing. type, extends(mimetic_matrix_1D_t) :: gradient_operator_1D_t @@ -55,7 +55,7 @@ pure module function construct_matrix_operator(upper, inner, lower) result(mimet interface gradient_operator_1D_t - ! PURPOSE: To construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. + ! PURPOSE: Interface for procedure to construct a new mimetic gradient-operator matrix representation of kth order for 1D cells of width dx. ! KEYWORDS: 1D, gradient-operator constructor, sparse matrix ! CONTEXT: Use this function to construct a sparse-matrix represntation of a mimetic gradient operator. @@ -70,7 +70,7 @@ pure module function construct_1D_gradient_operator(k, dx, cells) result(gradien end interface - ! PURPOSE: To encapsulate a 1D mimetic divergence operator matrix. + ! PURPOSE: Interface for procedure to encapsulate a 1D mimetic divergence operator matrix. ! KEYWORDS: 1D, divergence operator, sparse matrix ! CONTEXT: Use this type to assemble divergence-operator matrix for printing. @@ -89,7 +89,7 @@ pure module function construct_1D_gradient_operator(k, dx, cells) result(gradien interface divergence_operator_1D_t - ! PURPOSE: To construct an object representing a 1D mimetic divergence operator. + ! PURPOSE: Interface for procedure to construct an object representing a 1D mimetic divergence operator. ! KEYWORDS: 1D, divergence operator, sparse matrix, constructor ! CONTEXT: Use this type to assemble a divergence-operator matrix for printing. diff --git a/src/formal/scalar_1D_s.F90 b/src/formal/scalar_1D_s.F90 index b60fae4..2c60013 100644 --- a/src/formal/scalar_1D_s.F90 +++ b/src/formal/scalar_1D_s.F90 @@ -23,7 +23,7 @@ #ifndef __GFORTRAN__ - ! PURPOSE: To construct a new scalar_1D_t object by assigning each argument to a corresponding + ! PURPOSE: Definition of procedure to construct a new scalar_1D_t object by assigning each argument to a corresponding ! corresponding component of the new object. ! KEYWORDS: 1D scalar field constructor ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set @@ -41,7 +41,7 @@ #else - ! PURPOSE: To construct a new scalar_1D_t object by assigning each argument to a corresponding + ! PURPOSE: Definition of procedure to construct a new scalar_1D_t object by assigning each argument to a corresponding ! corresponding component of the new object. ! KEYWORDS: 1D scalar field constructor ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set @@ -77,7 +77,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) #endif - ! PURPOSE: To compute mimetic approximations to the gradient of scalar fields. + ! PURPOSE: Definition of procedure to compute mimetic approximations to the gradient of scalar fields. ! KEYWORDS: gradient, differential operator ! CONTEXT: Invoke this function via the unary .grad. operator with a right-hand-side, scalar-field operand. @@ -98,7 +98,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) end procedure - ! PURPOSE: To compute mimetic approximations to the Laplacian of a scalar field. + ! PURPOSE: Definition of procedure to compute mimetic approximations to the Laplacian of a scalar field. ! KEYWORDS: Laplacian, differential operator ! CONTEXT: Invoke this function via the unary .laplacian. operator with a right-hand-side, scalar-field operand. @@ -117,7 +117,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) end procedure - ! PURPOSE: To provide the cell-centered values of scalar quantities. + ! PURPOSE: Definition of procedure to provide the cell-centered values of scalar quantities. ! KEYWORDS: cell centers, staggered grid, scalar field ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete scalar values. @@ -136,7 +136,7 @@ pure function scalar_1D_grid_locations(x_min, x_max, cells) result(x) end associate end function - ! PURPOSE: To provide the staggered-grid locations at which scalar values are stored: cell centers plus domain boundaries. + ! PURPOSE: Definition of procedure to provide the staggered-grid locations at which scalar values are stored: cell centers plus domain boundaries. ! KEYWORDS: staggered grid, scalar field, cell centers ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete scalar locations for ! initialization-function sampling, printing, or plotting. diff --git a/src/formal/scalar_x_divergence_1D_s.F90 b/src/formal/scalar_x_divergence_1D_s.F90 index 6fc7fa7..611d7a7 100644 --- a/src/formal/scalar_x_divergence_1D_s.F90 +++ b/src/formal/scalar_x_divergence_1D_s.F90 @@ -9,7 +9,7 @@ contains - ! PURPOSE: To perform mimetic volume integration of a scalar/divergence dot product. + ! PURPOSE: Definition of procedure to perform mimetic volume integration of a scalar/divergence dot product. ! KEYWORDS: triple integral, volume integral ! CONTEXT: Invoke this function in expressions of the form .SSS. (f * .div. v) * dV ! with a vector_1D_t v, a scalar f, and a differential volume dV. diff --git a/src/formal/tensor_1D_s.f90 b/src/formal/tensor_1D_s.f90 index 8657202..3611ab8 100644 --- a/src/formal/tensor_1D_s.f90 +++ b/src/formal/tensor_1D_s.f90 @@ -5,7 +5,7 @@ implicit none contains - ! PURPOSE: To construct a new tensor_1D_t object by assigning each argument to a corresponding + ! PURPOSE: Definition of procedure to construct a new tensor_1D_t object by assigning each argument to a corresponding ! corresponding component of the new object. ! KEYWORDS: 1D tensor constructor ! CONTEXT: Constructors for child types assign this function's result to to the child object's parent component. @@ -18,7 +18,7 @@ tensor_1D%order_ = order end procedure - ! PURPOSE: To provide a uniform cell width along the x-coordinate spatial direction. + ! PURPOSE: Definition of procedure to provide a uniform cell width along the x-coordinate spatial direction. ! KEYWORDS: abcissa, mesh spacing ! CONTEXT: Use this function to produce cell widths for uniform 1D meshes. diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index 57d59ac..5f0f5f2 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -24,7 +24,7 @@ module tensors_1D_m abstract interface - ! PURPOSE: To provide values for initializing a scalar_1D_t object at the cell centers and boundaries + ! PURPOSE: Interface for procedure to provide values for initializing a scalar_1D_t object at the cell centers and boundaries ! for use in the mimetic discretization scheme of Corbino-Castillo (2020) ! KEYWORDS: mimetic discretization, scalar function, sampling, one-dimensional (1D) ! CONTEXT: This abstract interface is used to declare a procedure pointer that can be associated with @@ -38,7 +38,7 @@ pure function scalar_1D_initializer_i(x) result(f) double precision, allocatable :: f(:) end function - ! PURPOSE: To provide values for initializing a vector function of one spatial dimension at cell faces + ! PURPOSE: Interface for procedure to provide values for initializing a vector function of one spatial dimension at cell faces ! as defined in the mimetic discretization scheme of Corbino-Castillo (2020). ! KEYWORDS: mimetic discretization, vector function, sampling, 1D ! CONTEXT: This abstract interface is used to declare a procedure pointer that can be associated with @@ -54,8 +54,8 @@ pure function vector_1D_initializer_i(x) result(v) end interface - ! PURPOSE: To encapsulate the data and operations that are common to most or all tensor_1D_t child types - ! KEYWORDS: mimetic discretization, grid values, grid functions, 1D + ! PURPOSE: Definition for type to encapsulate the data and operations that are common to most or all tensor_1D_t child types + ! KEYWORDS: type definition, mimetic discretization, grid values, grid functions, 1D ! CONTEXT: Child types extend this derived type to define specific types of tensors such as scalars, ! vectors, gradients, and divergences. @@ -78,7 +78,7 @@ pure function vector_1D_initializer_i(x) result(v) interface tensor_1D_t - ! PURPOSE: To construct a new tensor_1D_t object by assigning each argument to a corresponding + ! PURPOSE: Interface for procedure to construct a new tensor_1D_t object by assigning each argument to a corresponding ! corresponding component of the new object. ! KEYWORDS: 1D tensor constructor ! CONTEXT: Constructors for child types assign this function's result to to the child object's parent component. @@ -96,8 +96,8 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c end interface - ! PURPOSE: To encapsulate a scalar function of one spatial dimension as a tensor with a gradient operator. - ! KEYWORDS: 1D scalar field abstraction + ! PURPOSE: Definition for type to encapsulate a scalar function of one spatial dimension as a tensor with a gradient operator. + ! KEYWORDS: type definition, 1D scalar field abstraction ! CONTEXT: Combine with other tensors via expressions that may include differential operators type, extends(tensor_1D_t) :: scalar_1D_t @@ -117,7 +117,7 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c interface scalar_1D_t - ! PURPOSE: To construct a new scalar_1D_t object by assigning each argument to a corresponding + ! PURPOSE: Interface for procedure to construct a new scalar_1D_t object by assigning each argument to a corresponding ! corresponding component of the new object. ! KEYWORDS: 1D scalar field constructor ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set @@ -136,8 +136,8 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells end interface - ! PURPOSE: To encapsulate a vector function of one spatial dimension as a tensor with a divergence operator. - ! KEYWORDS: 1D vector field abstraction + ! PURPOSE: Definition for type to encapsulate a vector function of one spatial dimension as a tensor with a divergence operator. + ! KEYWORDS: type definition, 1D vector field abstraction ! CONTEXT: Combine with other tensors via expressions that may include differential operators type, extends(tensor_1D_t) :: vector_1D_t @@ -161,8 +161,8 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells procedure, non_overridable, private :: vector_1D_values end type - ! PURPOSE: To encapsulate a scalar/vector product weighted for integration on a surface - ! KEYWORDS: 1D product abstraction + ! PURPOSE: Definition of type to encapsulate a scalar/vector product weighted for integration on a surface + ! KEYWORDS: type definition, 1D product abstraction ! CONTEXT: Combine with other tensors via expressions that may include the double integrals type, extends(tensor_1D_t) :: weighted_product_1D_t @@ -173,7 +173,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells interface vector_1D_t - ! PURPOSE: To construct a new vector_1D_t object by sampling a function of one spatial dimension. + ! PURPOSE: Interface for procedure to construct a new vector_1D_t object by sampling a function of one spatial dimension. ! KEYWORDS: 1D vector field constructor ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set ! of uniformly-spaced cell faces along one spatial dimension bounded by x_min and x_max. @@ -190,7 +190,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells type(vector_1D_t) vector_1D end function - ! PURPOSE: To construct a new vector_1D_t object from a parent tensor and a divergence operator object. + ! PURPOSE: Interface for procedure to construct a new vector_1D_t object from a parent tensor and a divergence operator object. ! KEYWORDS: 1D vector field constructor ! CONTEXT: Invoke this constructor with a an object to be used to define the constructed parent component ! divergence-operator matrix component. @@ -204,8 +204,8 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D end interface - ! PURPOSE: To define a vector child type for capturing gradient data and a scalar (dot) product operator. - ! KEYWORDS: 1D gradient vector field abstraction + ! PURPOSE: Definition of type for a vector child type for capturing gradient data and a scalar (dot) product operator. + ! KEYWORDS: type definition, 1D gradient vector field abstraction ! CONTEXT: The scalar_1D_t .grad. operator produces this type as a result. type, extends(vector_1D_t) :: gradient_1D_t @@ -218,8 +218,8 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private, pass(gradient_1D) :: dot end type - ! PURPOSE: To define a tensor child for capturing the scalar (dot) product of a vector and a gradient vector data - ! KEYWORDS: 1D vector/gradient scalar product + ! PURPOSE: Definition of type for a tensor child type for capturing the scalar (dot) product of a vector and a gradient vector data + ! KEYWORDS: type definition, 1D vector/gradient scalar product ! CONTEXT: An instance of this type can serve as an integrand in a .SSS. triple-integral operator. type, extends(tensor_1D_t) :: vector_dot_gradient_1D_t @@ -231,8 +231,8 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private, pass(integrand) ::volume_integrate_vector_dot_grad_scalar_1D end type - ! PURPOSE: To define a tensor child type capturing the divergence of a vector function of one spatial dimension. - ! KEYWORDS: 1D, divergence + ! PURPOSE: Definition of type for a tensor child type capturing the divergence of a vector function of one spatial dimension. + ! KEYWORDS: type definition, 1D, divergence ! CONTEXT: Although a mathematical scalar, this type differs from scalar_1D_t in that the values are stored ! _only_ at cell centers, whereas a scalar_1D_t object additionally has values at domain boundaries. @@ -249,8 +249,8 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private :: divergence_1D_grid end type - ! PURPOSE: To define a tensor child for capturing the product of a scalar and divergence - ! KEYWORDS: 1D scalar/divergence product + ! PURPOSE: Definition of type for a tensor child type for capturing the product of a scalar and divergence + ! KEYWORDS: type definition, 1D scalar/divergence product ! CONTEXT: An instance of this type can serve as an integrand in a .SSS. triple-integral operator. type, extends(tensor_1D_t) :: scalar_x_divergence_1D_t @@ -262,8 +262,8 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private, pass(integrand) :: volume_integrate_scalar_x_divergence_1D end type - ! PURPOSE: To define a divergence child type capturing the result of applying a divergence operator to a gradient. - ! KEYWORDS: 1D, laplacian + ! PURPOSE: Definition of type for a divergence child type capturing the result of applying a divergence operator to a gradient. + ! KEYWORDS: type definition, 1D, laplacian ! CONTEXT: Although a mathematical a divergence, this type additionally provides a type-bound procedure that ! returns the number of boundary-adjacent points at which the Laplacian approximation's accuracy drops by ! by one order relative to the parent divergence type. @@ -277,7 +277,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D interface - ! PURPOSE: To provide the differential area for use in surface integrals. + ! PURPOSE: Interface for procedure to provide the differential area for use in surface integrals. ! KEYWORDS: surface integral, area integral, double integral, numerical quadrature, mimetic discretization ! CONTEXT: Use this in expressions of the form .SS. (f .x. (v .dot. dA)) with a scalar_1D_t f and vector_1D_t v @@ -289,7 +289,7 @@ pure module function dA(self) double precision dA end function - ! PURPOSE: To provide a uniform cell width along the x-coordinate spatial direction. + ! PURPOSE: Interface for procedure to provide a uniform cell width along the x-coordinate spatial direction. ! KEYWORDS: abcissa, mesh spacing ! CONTEXT: Use this function to produce cell widths for uniform 1D meshes. @@ -300,7 +300,7 @@ pure module function dx(self) double precision dx end function - ! PURPOSE: To provide the staggered-grid locations at which scalar values are stored: cell centers plus domain boundaries. + ! PURPOSE: Interface for procedure to provide the staggered-grid locations at which scalar values are stored: cell centers plus domain boundaries. ! KEYWORDS: staggered grid, scalar field, cell centers ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete scalar locations for ! initialization-function sampling, printing, or plotting. @@ -312,7 +312,7 @@ pure module function scalar_1D_grid(self) result(cell_centers_extended) double precision, allocatable :: cell_centers_extended(:) end function - ! PURPOSE: To provide staggered-grid locations at which vector values are stored: cell faces. + ! PURPOSE: Interface for procedure to provide staggered-grid locations at which vector values are stored: cell faces. ! KEYWORDS: abcissa, cell faces ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete vector locations for ! initialization-function sampling, printing, or plotting. @@ -324,7 +324,7 @@ pure module function vector_1D_grid(self) result(cell_faces) double precision, allocatable :: cell_faces(:) end function - ! PURPOSE: To provide staggered-grid locations at which divergence values are stored: cell centers. + ! PURPOSE: Interface for procedure to provide staggered-grid locations at which divergence values are stored: cell centers. ! KEYWORDS: cell centers, staggered grid, divergence ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete gradient-vector locations for ! initialization-function sampling, printing, or plotting. @@ -336,7 +336,7 @@ pure module function divergence_1D_grid(self) result(cell_centers) double precision, allocatable :: cell_centers(:) end function - ! PURPOSE: To provide the cell-centered values of scalar quantities. + ! PURPOSE: Interface for procedure to provide the cell-centered values of scalar quantities. ! KEYWORDS: cell centers, staggered grid, scalar field ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete scalar values. @@ -347,7 +347,7 @@ pure module function scalar_1D_values(self) result(cell_centers_extended_values) double precision, allocatable :: cell_centers_extended_values(:) end function - ! PURPOSE: To provide the cell face-centered values of vector quantities. + ! PURPOSE: Interface for procedure to provide the cell face-centered values of vector quantities. ! KEYWORDS: staggered grid, vector field ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete vector values. @@ -358,7 +358,7 @@ pure module function vector_1D_values(self) result(face_centered_values) double precision, allocatable :: face_centered_values(:) end function - ! PURPOSE: To provide the cell-centered values of divergences. + ! PURPOSE: Interface for procedure to provide the cell-centered values of divergences. ! KEYWORDS: staggered grid, divergence ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete divergence values. @@ -369,7 +369,7 @@ pure module function divergence_1D_values(self) result(cell_centered_values) double precision, allocatable :: cell_centered_values(:) end function - ! PURPOSE: To compute mimetic approximations to the gradient of scalar fields. + ! PURPOSE: Interface for procedure to compute mimetic approximations to the gradient of scalar fields. ! KEYWORDS: gradient, differential operator ! CONTEXT: Invoke this function via the unary .grad. operator with a right-hand-side, scalar-field operand. @@ -380,7 +380,7 @@ pure module function grad(self) result(gradient_1D) type(gradient_1D_t) gradient_1D end function - ! PURPOSE: To compute mimetic approximations to the Laplacian of a scalar field. + ! PURPOSE: Interface for procedure to compute mimetic approximations to the Laplacian of a scalar field. ! KEYWORDS: Laplacian, differential operator ! CONTEXT: Invoke this function via the unary .laplacian. operator with a right-hand-side, scalar-field operand. @@ -391,7 +391,7 @@ pure module function laplacian(self) result(laplacian_1D) type(laplacian_1D_t) laplacian_1D end function - ! PURPOSE: To report the number of boundary-adjacent locations at which the Laplacian has reduced-order accuracy. + ! PURPOSE: Interface for procedure to report the number of boundary-adjacent locations at which the Laplacian has reduced-order accuracy. ! KEYWORDS: Laplacian, boundary, order of accuracy ! CONTEXT: Use this function to determine the region of slightly slower convergence for mimetic Laplacian approximations. @@ -402,7 +402,7 @@ pure module function reduced_order_boundary_depth(self) result(num_nodes) integer num_nodes end function - ! PURPOSE: To compute mimetic approximations to the divergence of a vector field. + ! PURPOSE: Interface for procedure to compute mimetic approximations to the divergence of a vector field. ! KEYWORDS: divergence, vector field ! CONTEXT: Invoke this function via the unary .div. operator with a right-hand-side vector-field operand. @@ -413,7 +413,7 @@ pure module function div(self) result(divergence_1D) type(divergence_1D_t) divergence_1D !! discrete divergence end function - ! PURPOSE: To perform mimetic volume integration of a vector/scalar-gradient dot product. + ! PURPOSE: Interface for procedure to perform mimetic volume integration of a vector/scalar-gradient dot product. ! KEYWORDS: triple integral, volume integral ! CONTEXT: Invoke this function in expressions of the form .SSS. (v .dot. .grad. f) * dV ! with a vector_1D_t v, a scalar f, and a differential volume dV. @@ -425,7 +425,7 @@ pure module function volume_integrate_vector_dot_grad_scalar_1D(integrand) resul double precision integral end function - ! PURPOSE: To perform mimetic volume integration of a scalar/divergence dot product. + ! PURPOSE: Interface for procedure to perform mimetic volume integration of a scalar/divergence dot product. ! KEYWORDS: triple integral, volume integral ! CONTEXT: Invoke this function in expressions of the form .SSS. (f * .div. v) * dV ! with a vector_1D_t v, a scalar f, and a differential volume dV. @@ -437,7 +437,7 @@ pure module function volume_integrate_scalar_x_divergence_1D(integrand) result(i double precision integral end function - ! PURPOSE: To perform mimetic surface integration of a scalar/vector product. + ! PURPOSE: Interface for procedure to perform mimetic surface integration of a scalar/vector product. ! KEYWORDS: double integral, surface integral, flux ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) ! with a vector_1D_t v, a scalar_1D_t f, and a differential area dA. @@ -449,7 +449,7 @@ pure module function surface_integrate_vector_x_scalar_1D(integrand) result(inte double precision integral end function - ! PURPOSE: To compute the scalar (dot) product of a vector and the gradient of a scalar. + ! PURPOSE: Interface for procedure to compute the scalar (dot) product of a vector and the gradient of a scalar. ! KEYWORDS: scalar product, dot product, inner product ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form ! g .dot. b with a gradient_1D_t g and a vector_1D_t b. @@ -462,7 +462,7 @@ pure module function dot(vector_1D, gradient_1D) result(vector_dot_gradient_1D) type(vector_dot_gradient_1D_t) vector_dot_gradient_1D end function - ! PURPOSE: To compute the scalar (not) product of a vector and a differential area. + ! PURPOSE: Interface for procedure to compute the scalar (not) product of a vector and a differential area. ! KEYWORDS: dot product, flux, surface-normal ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. @@ -477,7 +477,7 @@ pure module function dot_surface_normal(vector_1D, dS) result(v_dot_dS) type(vector_1D_t) v_dot_dS end function - ! PURPOSE: To compute a scalar/vector product weighted for subsequent surface integration. + ! PURPOSE: Interface for procedure to compute a scalar/vector product weighted for subsequent surface integration. ! KEYWORDS: integrand, surface integral, double integral ! CONTEXT: Inovke this function .x. binary infix operator in expressions of the form ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. @@ -490,7 +490,7 @@ pure module function weighted_premultiply(scalar_1D, vector_1D) result(weighted_ type(weighted_product_1D_t) weighted_product_1D end function - ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a vector + ! PURPOSE: Interface for procedure to compute the quadrature weights for use in the mimetic inner products of a vector ! and the gradient of a scalar. ! KEYWORDS: quadrature, numerical integration, coefficients, weights ! CONTEXT: Inovke this function via the "weights" generic binding to produce the quadrature weights @@ -504,7 +504,7 @@ pure module function gradient_1D_weights(self) result(weights) double precision, allocatable :: weights(:) end function - ! PURPOSE: To compute the quadrature weights for use in the mimetic inner products of a scalar + ! PURPOSE: Interface for procedure to compute the quadrature weights for use in the mimetic inner products of a scalar ! and the divergence of a vector. ! KEYWORDS: quadrature, numerical integration, coefficients, weights ! CONTEXT: Invoke this function via the "weights" generic binding to produce the quadrature weights @@ -518,7 +518,7 @@ pure module function divergence_1D_weights(self) result(weights) double precision, allocatable :: weights(:) end function - ! PURPOSE: To compute the product of a scalar and a divergence + ! PURPOSE: Interface for procedure to compute the product of a scalar and a divergence ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with scalar and divergence left- and ! right-hand operands, respectively @@ -531,7 +531,7 @@ pure module function premultiply_scalar_1D(scalar_1D, divergence_1D) result(scal type(scalar_x_divergence_1D_t) scalar_x_divergence_1D end function - ! PURPOSE: To compute the product of a divergence and a scalar + ! PURPOSE: Interface for procedure to compute the product of a divergence and a scalar ! KEYWORDS: scalar multiplication ! CONTEXT: Invoke this function via the binary infix operator "*" with divergence and scalar left- and ! right-hand operands, respectively diff --git a/src/formal/vector_1D_s.F90 b/src/formal/vector_1D_s.F90 index ac33727..c87f31f 100644 --- a/src/formal/vector_1D_s.F90 +++ b/src/formal/vector_1D_s.F90 @@ -22,7 +22,7 @@ contains - ! PURPOSE: To compute the scalar (not) product of a vector and a differential area. + ! PURPOSE: Definition of procedure to compute the scalar (not) product of a vector and a differential area. ! KEYWORDS: dot product, flux, surface-normal ! CONTEXT: Inovke this function via the .dot. binary infix operator in expressions of the form ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. @@ -34,7 +34,7 @@ #ifndef __GFORTRAN__ - ! PURPOSE: To construct a new vector_1D_t object by sampling a function of one spatial dimension. + ! PURPOSE: Definition of procedure to construct a new vector_1D_t object by sampling a function of one spatial dimension. ! KEYWORDS: 1D vector field constructor ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set ! of uniformly-spaced cell faces along one spatial dimension bounded by x_min and x_max. @@ -51,7 +51,7 @@ #else - ! PURPOSE: To construct a new vector_1D_t object by sampling a function of one spatial dimension. + ! PURPOSE: Definition of procedure to construct a new vector_1D_t object by sampling a function of one spatial dimension. ! KEYWORDS: 1D vector field constructor ! CONTEXT: Invoke this constructor with a pointer associated with a function to be sampled at a set ! of uniformly-spaced cell faces along one spatial dimension bounded by x_min and x_max. @@ -75,7 +75,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells #endif - ! PURPOSE: To construct a new vector_1D_t object from a parent tensor and a divergence operator object. + ! PURPOSE: Definition of procedure to construct a new vector_1D_t object from a parent tensor and a divergence operator object. ! KEYWORDS: 1D vector field constructor ! CONTEXT: Invoke this constructor with a an object to be used to define the constructed parent component ! divergence-operator matrix component. @@ -85,7 +85,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells vector_1D%divergence_operator_1D_ = divergence_operator_1D end procedure - ! PURPOSE: To compute mimetic approximations to the divergence of a vector field. + ! PURPOSE: Definition of procedure to compute mimetic approximations to the divergence of a vector field. ! KEYWORDS: divergence, vector field ! CONTEXT: Invoke this function via the unary .div. operator with a right-hand-side vector-field operand. @@ -114,7 +114,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells end procedure - ! PURPOSE: To provide the cell face-centered values of vector quantities. + ! PURPOSE: Definition of procedure to provide the cell face-centered values of vector quantities. ! KEYWORDS: staggered grid, vector field ! CONTEXT: Invoke this function via the "values" generic binding to produce discrete vector values. @@ -133,7 +133,7 @@ pure function faces(x_min, x_max, cells) result(x) end associate end function - ! PURPOSE: To provide staggered-grid locations at which vector values are stored: cell faces. + ! PURPOSE: Definition of procedure to provide staggered-grid locations at which vector values are stored: cell faces. ! KEYWORDS: abcissa, cell faces ! CONTEXT: Invoke this function via the "grid" generic binding to produce discrete vector locations for ! initialization-function sampling, printing, or plotting. @@ -142,7 +142,7 @@ pure function faces(x_min, x_max, cells) result(x) cell_faces = faces(self%x_min_, self%x_max_, self%cells_) end procedure - ! PURPOSE: To compute a scalar/vector product weighted for subsequent surface integration. + ! PURPOSE: Definition of procedure to compute a scalar/vector product weighted for subsequent surface integration. ! KEYWORDS: integrand, surface integral, double integral ! CONTEXT: Inovke this function .x. binary infix operator in expressions of the form ! .SS. (f .x. (v .dot. dA)) with a saclar_1D_t f, a vector_1D_t v, and a differential area A. @@ -228,7 +228,7 @@ pure function postmultiply_diagonal(A,d) result(AD) end procedure - ! PURPOSE: To provide the differential area for use in surface integrals. + ! PURPOSE: Definition of procedure to provide the differential area for use in surface integrals. ! KEYWORDS: surface integral, area integral, double integral, numerical quadrature, mimetic discretization ! CONTEXT: Use this in expressions of the form .SS. (f .x. (v .dot. dA)) with a scalar_1D_t f and vector_1D_t v module procedure dA diff --git a/src/formal/vector_dot_gradient_1D_s.F90 b/src/formal/vector_dot_gradient_1D_s.F90 index 8cdaf90..72873f2 100644 --- a/src/formal/vector_dot_gradient_1D_s.F90 +++ b/src/formal/vector_dot_gradient_1D_s.F90 @@ -9,7 +9,7 @@ contains - ! PURPOSE: To perform mimetic volume integration of a vector/scalar-gradient dot product. + ! PURPOSE: Definition of procedure to perform mimetic volume integration of a vector/scalar-gradient dot product. ! KEYWORDS: triple integral, volume integral ! CONTEXT: Invoke this function in expressions of the form .SSS. (v .dot. .grad. f) * dV ! with a vector_1D_t v, a scalar f, and a differential volume dV. diff --git a/src/formal/weighted_product_1D_s.F90 b/src/formal/weighted_product_1D_s.F90 index d08e324..bff3d19 100644 --- a/src/formal/weighted_product_1D_s.F90 +++ b/src/formal/weighted_product_1D_s.F90 @@ -6,7 +6,7 @@ contains - ! PURPOSE: To perform mimetic surface integration of a scalar/vector product. + ! PURPOSE: Definition of procedure to perform mimetic surface integration of a scalar/vector product. ! KEYWORDS: double integral, surface integral, flux ! CONTEXT: Invoke this function in expressions of the form -.SS. (f .x. (v .dot. dA)) ! with a vector_1D_t v, a scalar_1D_t f, and a differential area dA. From 277331797bdb0f8c87cf39653b4fb58f8bf79a62 Mon Sep 17 00:00:00 2001 From: Katherine Rasmussen Date: Fri, 6 Feb 2026 16:10:58 -0800 Subject: [PATCH 10/10] Add end code chunk comments to code chunks with RAG metadata --- src/formal/divergence_1D_s.F90 | 6 +++- src/formal/divergence_operator_1D_s.F90 | 1 + src/formal/gradient_1D_s.F90 | 3 +- src/formal/gradient_operator_1D_s.F90 | 1 + src/formal/laplacian_s.f90 | 1 + src/formal/mimetic_operators_1D_m.F90 | 4 +++ src/formal/scalar_1D_s.F90 | 8 ++++-- src/formal/scalar_x_divergence_1D_s.F90 | 1 + src/formal/tensor_1D_s.f90 | 3 +- src/formal/tensors_1D_m.F90 | 37 +++++++++++++++++++++++++ src/formal/vector_1D_s.F90 | 8 ++++++ src/formal/vector_dot_gradient_1D_s.F90 | 1 + src/formal/weighted_product_1D_s.F90 | 1 + 13 files changed, 70 insertions(+), 5 deletions(-) diff --git a/src/formal/divergence_1D_s.F90 b/src/formal/divergence_1D_s.F90 index c5a7eca..1c12aa1 100644 --- a/src/formal/divergence_1D_s.F90 +++ b/src/formal/divergence_1D_s.F90 @@ -43,6 +43,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) #endif call_julienne_assert(size(scalar_x_divergence_1D%weights_) .equalsExpected. size(divergence_1D%values_)+2) end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to compute the product of a divergence and a scalar ! KEYWORDS: scalar multiplication @@ -52,6 +53,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) module procedure postmultiply_scalar_1D scalar_x_divergence_1D = premultiply_scalar_1D(scalar_1D, divergence_1D) end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to provide the cell-centered values of divergences. ! KEYWORDS: staggered grid, divergence @@ -60,6 +62,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) module procedure divergence_1D_values cell_centered_values = self%values_ end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to provide staggered-grid locations at which divergence values are stored: cell centers. ! KEYWORDS: cell centers, staggered grid, divergence @@ -69,6 +72,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) module procedure divergence_1D_grid cell_centers = cell_center_locations(self%x_min_, self%x_max_, self%cells_) end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to compute the quadrature weights for use in the mimetic inner products of a scalar ! and the divergence of a vector. @@ -97,5 +101,5 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) call_julienne_assert(self%cells_ .isAtLeast. 2*size(skin)) call_julienne_assert(size(weights) .equalsExpected. self%cells_+2) end procedure - + ! END CODE CHUNK end submodule divergence_1D_s diff --git a/src/formal/divergence_operator_1D_s.F90 b/src/formal/divergence_operator_1D_s.F90 index 95d667f..780b003 100644 --- a/src/formal/divergence_operator_1D_s.F90 +++ b/src/formal/divergence_operator_1D_s.F90 @@ -104,6 +104,7 @@ pure function M(k, dx) result(row) end function end procedure construct_1D_divergence_operator + ! END CODE CHUNK module procedure submatrix_A_rows call_julienne_assert(allocated(self%upper_)) diff --git a/src/formal/gradient_1D_s.F90 b/src/formal/gradient_1D_s.F90 index 5442f8a..bbd7f60 100644 --- a/src/formal/gradient_1D_s.F90 +++ b/src/formal/gradient_1D_s.F90 @@ -44,6 +44,7 @@ call_julienne_assert(size(weights) .equalsExpected. self%cells_ + 1) end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to compute the scalar (dot) product of a vector and the gradient of a scalar. ! KEYWORDS: scalar product, dot product, inner product @@ -70,5 +71,5 @@ vector_dot_gradient_1D%weights_ = gradient_1D%gradient_1D_weights() #endif end procedure - + ! END CODE CHUNK end submodule gradient_1D_s diff --git a/src/formal/gradient_operator_1D_s.F90 b/src/formal/gradient_operator_1D_s.F90 index ba92a7a..2c22e39 100644 --- a/src/formal/gradient_operator_1D_s.F90 +++ b/src/formal/gradient_operator_1D_s.F90 @@ -96,6 +96,7 @@ pure function corbino_castillo_M(k, dx) result(row) end function end procedure construct_1D_gradient_operator + ! END CODE CHUNK module procedure gradient_matrix_multiply diff --git a/src/formal/laplacian_s.f90 b/src/formal/laplacian_s.f90 index ea88d79..8bfa87e 100644 --- a/src/formal/laplacian_s.f90 +++ b/src/formal/laplacian_s.f90 @@ -12,5 +12,6 @@ module procedure reduced_order_boundary_depth num_nodes = self%boundary_depth_ end procedure + ! END CODE CHUNK end submodule laplacian_s diff --git a/src/formal/mimetic_operators_1D_m.F90 b/src/formal/mimetic_operators_1D_m.F90 index fead8c1..5241c2b 100644 --- a/src/formal/mimetic_operators_1D_m.F90 +++ b/src/formal/mimetic_operators_1D_m.F90 @@ -52,6 +52,7 @@ pure module function construct_matrix_operator(upper, inner, lower) result(mimet generic :: assemble => assemble_gradient procedure, non_overridable, private :: assemble_gradient end type + ! END CODE CHUNK interface gradient_operator_1D_t @@ -67,6 +68,7 @@ pure module function construct_1D_gradient_operator(k, dx, cells) result(gradien integer, intent(in) :: cells !! number of grid cells type(gradient_operator_1D_t) gradient_operator_1D end function + ! END CODE CHUNK end interface @@ -86,6 +88,7 @@ pure module function construct_1D_gradient_operator(k, dx, cells) result(gradien procedure, non_overridable, private :: assemble_divergence procedure, non_overridable :: submatrix_A_rows end type + ! END CODE CHUNK interface divergence_operator_1D_t @@ -101,6 +104,7 @@ pure module function construct_1D_divergence_operator(k, dx, cells) result(diver integer, intent(in) :: cells !! number of grid cells type(divergence_operator_1D_t) divergence_operator_1D end function + ! END CODE CHUNK end interface diff --git a/src/formal/scalar_1D_s.F90 b/src/formal/scalar_1D_s.F90 index 2c60013..06a9774 100644 --- a/src/formal/scalar_1D_s.F90 +++ b/src/formal/scalar_1D_s.F90 @@ -38,7 +38,7 @@ end associate scalar_1D%gradient_operator_1D_ = gradient_operator_1D_t(k=order, dx=(x_max - x_min)/cells, cells=cells) end procedure - + ! END CODE CHUNK #else ! PURPOSE: Definition of procedure to construct a new scalar_1D_t object by assigning each argument to a corresponding @@ -63,6 +63,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells end associate scalar_1D%gradient_operator_1D_ = gradient_operator_1D_t(k=order, dx=(x_max - x_min)/cells, cells=cells) end function + ! END CODE CHUNK pure function cell_center_locations(x_min, x_max, cells) result(x) double precision, intent(in) :: x_min, x_max @@ -97,6 +98,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) end associate end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to compute mimetic approximations to the Laplacian of a scalar field. ! KEYWORDS: Laplacian, differential operator @@ -115,7 +117,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) end associate end procedure - + ! END CODE CHUNK ! PURPOSE: Definition of procedure to provide the cell-centered values of scalar quantities. ! KEYWORDS: cell centers, staggered grid, scalar field @@ -124,6 +126,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x) module procedure scalar_1D_values cell_centers_extended_values = self%values_ end procedure + ! END CODE CHUNK pure function scalar_1D_grid_locations(x_min, x_max, cells) result(x) double precision, intent(in) :: x_min, x_max @@ -144,5 +147,6 @@ pure function scalar_1D_grid_locations(x_min, x_max, cells) result(x) module procedure scalar_1D_grid cell_centers_extended = scalar_1D_grid_locations(self%x_min_, self%x_max_, self%cells_) end procedure + ! END CODE CHUNK end submodule scalar_1D_s diff --git a/src/formal/scalar_x_divergence_1D_s.F90 b/src/formal/scalar_x_divergence_1D_s.F90 index 611d7a7..1d3ea8d 100644 --- a/src/formal/scalar_x_divergence_1D_s.F90 +++ b/src/formal/scalar_x_divergence_1D_s.F90 @@ -18,5 +18,6 @@ call_julienne_assert(size(integrand%weights_ ) .equalsExpected. size(integrand%values_)+2) integral = sum(integrand%weights_ * [0D0, integrand%values_, 0D0]) end procedure + ! END CODE CHUNK end submodule scalar_x_divergence_1D_s diff --git a/src/formal/tensor_1D_s.f90 b/src/formal/tensor_1D_s.f90 index 3611ab8..f7a6f09 100644 --- a/src/formal/tensor_1D_s.f90 +++ b/src/formal/tensor_1D_s.f90 @@ -17,6 +17,7 @@ tensor_1D%cells_ = cells tensor_1D%order_ = order end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to provide a uniform cell width along the x-coordinate spatial direction. ! KEYWORDS: abcissa, mesh spacing @@ -25,6 +26,6 @@ module procedure dx dx = (self%x_max_ - self%x_min_)/self%cells_ end procedure - + ! END CODE CHUNK end submodule tensor_1D_s diff --git a/src/formal/tensors_1D_m.F90 b/src/formal/tensors_1D_m.F90 index 5f0f5f2..3c817d1 100644 --- a/src/formal/tensors_1D_m.F90 +++ b/src/formal/tensors_1D_m.F90 @@ -37,6 +37,7 @@ pure function scalar_1D_initializer_i(x) result(f) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide values for initializing a vector function of one spatial dimension at cell faces ! as defined in the mimetic discretization scheme of Corbino-Castillo (2020). @@ -51,6 +52,7 @@ pure function vector_1D_initializer_i(x) result(v) double precision, intent(in) :: x(:) double precision, allocatable :: v(:) end function + ! END CODE CHUNK end interface @@ -75,6 +77,7 @@ pure function vector_1D_initializer_i(x) result(v) generic :: dV => dx procedure, non_overridable :: dx end type + ! END CODE CHUNK interface tensor_1D_t @@ -93,6 +96,7 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c integer, intent(in) :: order !! order of accuracy type(tensor_1D_t) tensor_1D end function + ! END CODE CHUNK end interface @@ -114,6 +118,7 @@ pure module function construct_1D_tensor_from_components(values, x_min, x_max, c procedure, non_overridable, private :: scalar_1D_values procedure, non_overridable, private :: scalar_1D_grid end type + ! END CODE CHUNK interface scalar_1D_t @@ -133,6 +138,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells double precision, intent(in) :: x_max !! grid location maximum type(scalar_1D_t) scalar_1D end function + ! END CODE CHUNK end interface @@ -160,6 +166,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells procedure, non_overridable, private :: vector_1D_grid procedure, non_overridable, private :: vector_1D_values end type + ! END CODE CHUNK ! PURPOSE: Definition of type to encapsulate a scalar/vector product weighted for integration on a surface ! KEYWORDS: type definition, 1D product abstraction @@ -170,6 +177,7 @@ pure module function construct_1D_scalar_from_function(initializer, order, cells generic :: operator(.SS.) => surface_integrate_vector_x_scalar_1D procedure, non_overridable, private :: surface_integrate_vector_x_scalar_1D end type + ! END CODE CHUNK interface vector_1D_t @@ -189,6 +197,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells double precision, intent(in) :: x_max !! grid location maximum type(vector_1D_t) vector_1D end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to construct a new vector_1D_t object from a parent tensor and a divergence operator object. ! KEYWORDS: 1D vector field constructor @@ -201,6 +210,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D type(divergence_operator_1D_t), intent(in) :: divergence_operator_1D type(vector_1D_t) vector_1D end function + ! END CODE CHUNK end interface @@ -217,6 +227,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D #endif procedure, non_overridable, private, pass(gradient_1D) :: dot end type + ! END CODE CHUNK ! PURPOSE: Definition of type for a tensor child type for capturing the scalar (dot) product of a vector and a gradient vector data ! KEYWORDS: type definition, 1D vector/gradient scalar product @@ -230,6 +241,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D generic :: operator(.SSS.) => volume_integrate_vector_dot_grad_scalar_1D procedure, non_overridable, private, pass(integrand) ::volume_integrate_vector_dot_grad_scalar_1D end type + ! END CODE CHUNK ! PURPOSE: Definition of type for a tensor child type capturing the divergence of a vector function of one spatial dimension. ! KEYWORDS: type definition, 1D, divergence @@ -248,6 +260,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D procedure, non_overridable, private :: divergence_1D_values procedure, non_overridable, private :: divergence_1D_grid end type + ! END CODE CHUNK ! PURPOSE: Definition of type for a tensor child type for capturing the product of a scalar and divergence ! KEYWORDS: type definition, 1D scalar/divergence product @@ -261,6 +274,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D generic :: operator(.SSS.) => volume_integrate_scalar_x_divergence_1D procedure, non_overridable, private, pass(integrand) :: volume_integrate_scalar_x_divergence_1D end type + ! END CODE CHUNK ! PURPOSE: Definition of type for a divergence child type capturing the result of applying a divergence operator to a gradient. ! KEYWORDS: type definition, 1D, laplacian @@ -274,6 +288,7 @@ pure module function construct_from_components(tensor_1D, divergence_operator_1D contains procedure reduced_order_boundary_depth end type + ! END CODE CHUNK interface @@ -288,6 +303,7 @@ pure module function dA(self) class(vector_1D_t), intent(in) :: self double precision dA end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide a uniform cell width along the x-coordinate spatial direction. ! KEYWORDS: abcissa, mesh spacing @@ -299,6 +315,7 @@ pure module function dx(self) class(tensor_1D_t), intent(in) :: self double precision dx end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide the staggered-grid locations at which scalar values are stored: cell centers plus domain boundaries. ! KEYWORDS: staggered grid, scalar field, cell centers @@ -311,6 +328,7 @@ pure module function scalar_1D_grid(self) result(cell_centers_extended) class(scalar_1D_t), intent(in) :: self double precision, allocatable :: cell_centers_extended(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide staggered-grid locations at which vector values are stored: cell faces. ! KEYWORDS: abcissa, cell faces @@ -323,6 +341,7 @@ pure module function vector_1D_grid(self) result(cell_faces) class(vector_1D_t), intent(in) :: self double precision, allocatable :: cell_faces(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide staggered-grid locations at which divergence values are stored: cell centers. ! KEYWORDS: cell centers, staggered grid, divergence @@ -335,6 +354,7 @@ pure module function divergence_1D_grid(self) result(cell_centers) class(divergence_1D_t), intent(in) :: self double precision, allocatable :: cell_centers(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide the cell-centered values of scalar quantities. ! KEYWORDS: cell centers, staggered grid, scalar field @@ -346,6 +366,7 @@ pure module function scalar_1D_values(self) result(cell_centers_extended_values) class(scalar_1D_t), intent(in) :: self double precision, allocatable :: cell_centers_extended_values(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide the cell face-centered values of vector quantities. ! KEYWORDS: staggered grid, vector field @@ -357,6 +378,7 @@ pure module function vector_1D_values(self) result(face_centered_values) class(vector_1D_t), intent(in) :: self double precision, allocatable :: face_centered_values(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to provide the cell-centered values of divergences. ! KEYWORDS: staggered grid, divergence @@ -368,6 +390,7 @@ pure module function divergence_1D_values(self) result(cell_centered_values) class(divergence_1D_t), intent(in) :: self double precision, allocatable :: cell_centered_values(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute mimetic approximations to the gradient of scalar fields. ! KEYWORDS: gradient, differential operator @@ -379,6 +402,7 @@ pure module function grad(self) result(gradient_1D) class(scalar_1D_t), intent(in) :: self type(gradient_1D_t) gradient_1D end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute mimetic approximations to the Laplacian of a scalar field. ! KEYWORDS: Laplacian, differential operator @@ -390,6 +414,7 @@ pure module function laplacian(self) result(laplacian_1D) class(scalar_1D_t), intent(in) :: self type(laplacian_1D_t) laplacian_1D end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to report the number of boundary-adjacent locations at which the Laplacian has reduced-order accuracy. ! KEYWORDS: Laplacian, boundary, order of accuracy @@ -401,6 +426,7 @@ pure module function reduced_order_boundary_depth(self) result(num_nodes) class(laplacian_1D_t), intent(in) :: self integer num_nodes end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute mimetic approximations to the divergence of a vector field. ! KEYWORDS: divergence, vector field @@ -412,6 +438,7 @@ pure module function div(self) result(divergence_1D) class(vector_1D_t), intent(in) :: self type(divergence_1D_t) divergence_1D !! discrete divergence end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to perform mimetic volume integration of a vector/scalar-gradient dot product. ! KEYWORDS: triple integral, volume integral @@ -424,6 +451,7 @@ pure module function volume_integrate_vector_dot_grad_scalar_1D(integrand) resul class(vector_dot_gradient_1D_t), intent(in) :: integrand double precision integral end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to perform mimetic volume integration of a scalar/divergence dot product. ! KEYWORDS: triple integral, volume integral @@ -436,6 +464,7 @@ pure module function volume_integrate_scalar_x_divergence_1D(integrand) result(i class(scalar_x_divergence_1D_t), intent(in) :: integrand double precision integral end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to perform mimetic surface integration of a scalar/vector product. ! KEYWORDS: double integral, surface integral, flux @@ -448,6 +477,7 @@ pure module function surface_integrate_vector_x_scalar_1D(integrand) result(inte class(weighted_product_1D_t), intent(in) :: integrand double precision integral end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute the scalar (dot) product of a vector and the gradient of a scalar. ! KEYWORDS: scalar product, dot product, inner product @@ -461,6 +491,7 @@ pure module function dot(vector_1D, gradient_1D) result(vector_dot_gradient_1D) type(vector_1D_t), intent(in) :: vector_1D type(vector_dot_gradient_1D_t) vector_dot_gradient_1D end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute the scalar (not) product of a vector and a differential area. ! KEYWORDS: dot product, flux, surface-normal @@ -476,6 +507,7 @@ pure module function dot_surface_normal(vector_1D, dS) result(v_dot_dS) double precision, intent(in) :: dS type(vector_1D_t) v_dot_dS end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute a scalar/vector product weighted for subsequent surface integration. ! KEYWORDS: integrand, surface integral, double integral @@ -489,6 +521,7 @@ pure module function weighted_premultiply(scalar_1D, vector_1D) result(weighted_ class(vector_1D_t), intent(in) :: vector_1D type(weighted_product_1D_t) weighted_product_1D end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute the quadrature weights for use in the mimetic inner products of a vector ! and the gradient of a scalar. @@ -503,6 +536,7 @@ pure module function gradient_1D_weights(self) result(weights) class(tensor_1D_t), intent(in) :: self double precision, allocatable :: weights(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute the quadrature weights for use in the mimetic inner products of a scalar ! and the divergence of a vector. @@ -517,6 +551,7 @@ pure module function divergence_1D_weights(self) result(weights) class(tensor_1D_t), intent(in) :: self double precision, allocatable :: weights(:) end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute the product of a scalar and a divergence ! KEYWORDS: scalar multiplication @@ -530,6 +565,7 @@ pure module function premultiply_scalar_1D(scalar_1D, divergence_1D) result(scal class(divergence_1D_t), intent(in) :: divergence_1D type(scalar_x_divergence_1D_t) scalar_x_divergence_1D end function + ! END CODE CHUNK ! PURPOSE: Interface for procedure to compute the product of a divergence and a scalar ! KEYWORDS: scalar multiplication @@ -543,6 +579,7 @@ pure module function postmultiply_scalar_1D(divergence_1D, scalar_1D) result(sca type(scalar_1D_t), intent(in) :: scalar_1D type(scalar_x_divergence_1D_t) scalar_x_divergence_1D end function + ! END CODE CHUNK end interface diff --git a/src/formal/vector_1D_s.F90 b/src/formal/vector_1D_s.F90 index c87f31f..65bbf25 100644 --- a/src/formal/vector_1D_s.F90 +++ b/src/formal/vector_1D_s.F90 @@ -31,6 +31,7 @@ v_dot_dS%tensor_1D_t = tensor_1D_t(vector_1D%values_*dS, vector_1D%x_min_, vector_1D%x_max_, vector_1D%cells_, vector_1D%order_) v_dot_dS%divergence_operator_1D_ = vector_1D%divergence_operator_1D_ end procedure + ! END CODE CHUNK #ifndef __GFORTRAN__ @@ -48,6 +49,7 @@ end associate vector_1D%divergence_operator_1D_ = divergence_operator_1D_t(k=order, dx=(x_max - x_min)/cells, cells=cells) end procedure + ! END CODE CHUNK #else @@ -72,6 +74,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells end associate vector_1D%divergence_operator_1D_ = divergence_operator_1D_t(k=order, dx=(x_max - x_min)/cells, cells=cells) end function + ! END CODE CHUNK #endif @@ -84,6 +87,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells vector_1D%tensor_1D_t = tensor_1D vector_1D%divergence_operator_1D_ = divergence_operator_1D end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to compute mimetic approximations to the divergence of a vector field. ! KEYWORDS: divergence, vector field @@ -113,6 +117,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells end associate end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to provide the cell face-centered values of vector quantities. ! KEYWORDS: staggered grid, vector field @@ -121,6 +126,7 @@ pure module function construct_1D_vector_from_function(initializer, order, cells module procedure vector_1D_values face_centered_values = self%values_ end procedure + ! END CODE CHUNK pure function faces(x_min, x_max, cells) result(x) double precision, intent(in) :: x_min, x_max @@ -141,6 +147,7 @@ pure function faces(x_min, x_max, cells) result(x) module procedure vector_1D_grid cell_faces = faces(self%x_min_, self%x_max_, self%cells_) end procedure + ! END CODE CHUNK ! PURPOSE: Definition of procedure to compute a scalar/vector product weighted for subsequent surface integration. ! KEYWORDS: integrand, surface integral, double integral @@ -234,5 +241,6 @@ pure function postmultiply_diagonal(A,d) result(AD) module procedure dA dA = 1D0 end procedure + ! END CODE CHUNK end submodule vector_1D_s diff --git a/src/formal/vector_dot_gradient_1D_s.F90 b/src/formal/vector_dot_gradient_1D_s.F90 index 72873f2..93a4149 100644 --- a/src/formal/vector_dot_gradient_1D_s.F90 +++ b/src/formal/vector_dot_gradient_1D_s.F90 @@ -18,5 +18,6 @@ call_julienne_assert(size(integrand%weights_ ) .equalsExpected. size(integrand%values_)) integral = sum(integrand%weights_ * integrand%values_) end procedure + ! END CODE CHUNK end submodule vector_dot_gradient_1D_s diff --git a/src/formal/weighted_product_1D_s.F90 b/src/formal/weighted_product_1D_s.F90 index bff3d19..23fcd4c 100644 --- a/src/formal/weighted_product_1D_s.F90 +++ b/src/formal/weighted_product_1D_s.F90 @@ -14,5 +14,6 @@ module procedure surface_integrate_vector_x_scalar_1D integral = sum(integrand%values_) end procedure + ! END CODE CHUNK end submodule weighted_product_s