ICFERST  22-06
Reservoir simulator based on DCVFEM, Dynamic Mesh optimisation and Surface-based modelling
multi_tools.F90 File Reference
#include "fdebug.h"
#include "petsc_legacy.h"
Include dependency graph for multi_tools.F90:

Modules

module  multi_tools
 This module contains the generic subroutines required by ICFERST, for example quicksort.
 

Functions/Subroutines

real function multi_tools::r2norm (VEC, NVEC)
 
real function multi_tools::ptolfun (value)
 :This function is a tolerance function for strictly positive values used as a denominator. If the value of VALUE less than 1E-10, then it returns TOLERANCE otherwise VALUE. More...
 
pure real function multi_tools::tolfun (value)
 :This function is a tolerance function for a value which is used as a denominator. If the absolute value of VALUE less than 1E-10, then it returns SIGN(A,B) i.e. the absolute value of A times the sign of B where A is TOLERANCE and B is VALUE. More...
 
pure real function, dimension(size(val)) multi_tools::tolfun_many (val)
 :This function is a tolerance function for a scalar which is used as a denominator. If the absolute value of VALUE less than 1E-10, then it returns SIGN(A,B) i.e. the absolute value of A times the sign of B where A is TOLERANCE and B is VALUE. More...
 
real function multi_tools::tetvolume (x0, y0, z0, x1, y1, z1, x2, y2, z2, x3, y3, z3)
 
pure real function, dimension(size(val)) multi_tools::vtolfun (val)
 :This function is a tolerance function for a vector which is used as a denominator. If the absolute value of VALUE less than 1E-10, then it returns SIGN(A,B) i.e. the absolute value of A times the sign of B where A is TOLERANCE and B is VALUE. More...
 
subroutine multi_tools::nan_check (a, k)
 :Checks if a number is a Nan More...
 
subroutine multi_tools::nan_check_arr (a, k)
 :Checks if an array is a Nan More...
 
pure real function, dimension(size(uc)) multi_tools::nvdfunnew_many (UF, UC, XI_LIMIT)
 : The function computes NVDFUNNEW, the normalised value of the advected variable on the face of the control volume, based on the normalised value of the advected variable in the donor CV, UC, and the high-order estimate of the face value UF. NVDFUNNEW is limited so that it is in the non-oscillatory region of normalised variable diagram (NVD). More...
 
real function, dimension(size(uc)) multi_tools::nvdfunnew_many_sqrt (UF, UC, XI_LIMIT)
 : The function computes NVDFUNNEW, the normalised value of the advected variable on the face of the control volume, based on the normalised value of the advected variable in the donor CV, UC, and the high-order estimate of the face value UF. NVDFUNNEW is limited so that it is in the non-oscillatory region of normalised variable diagram (NVD). More...
 
integer function, dimension(:), pointer multi_tools::get_ndglno (mesh)
 
recursive subroutine multi_tools::quicksort (vec, n)
 :Sort a list in increasing order Vec is the vector to sort and n is an starting point, like 1 More...
 
integer function partition (v)
 
subroutine insertion_sort (vec, n)
 
subroutine multi_tools::calc_face_ele (FACE_ELE, TOTELE, STOTEL, NFACE, FINELE, COLELE, CV_NLOC, CV_SNLOC, CV_NONODS, CV_NDGLN, CV_SNDGLN, CV_SLOCLIST, X_NLOC, X_NDGLN)
 : Calculate FACE_ELE - the list of elements surrounding an element and referenced with a face -ve values correspond to surface elements. More...
 
subroutine multi_tools::assign_val (outval, inval)
 :Copies the data from inval to outval safely. If the sizes are different outval is populated using the first value of inval More...
 
real function multi_tools::table_interpolation (X_points, Y_points, input_X)
 X_points, Y_points to form a linear (size == 2) or quadratic (size == 3) interpolation. More...
 
subroutine multi_tools::read_csv_table (data_array, path_to_table, extra_data)
 :Template of csv table OPTIONAL section (header) real1,real2,real3,..., size(extra_data) rows,columns 2,3 Pressure,Saturation 1000,0.9 250,0.5 100,0.1 More...
 
subroutine multi_tools::extract_strings_from_csv_file (csv_table_strings, path_to_table, Nentries)
 :This subroutine reads a csv file and returns them in an array More...
 
subroutine multi_tools::printmatrix (Matrix)
 :Subroutine to print Arrays by (columns,rows) Matrix = 2D Array More...
 
subroutine multi_tools::rotationmatrix (a, R)
 : Roates a matrix A using the toration matrix R???? More...
 
subroutine multi_tools::read_nastran_file (filepath, node, edges)
 :This subroutine reads a nastran file that contains the information defining the 1D path of a well the input relative filepath should include the file format, for example: well.bdf More...
 
subroutine get_nodes_edges (Nnodes, Nedges)
 
subroutine multi_tools::least_squares_solver (A, b, rank)
 Subroutine that solves the least squares problem |Ax-b|2 using LAPACK and blas Subroutine tested and compared with Matlab (not recommended changing it since it is a pain!) Only for serial: The best option is to solve in each processor the optimisation system by performing A' * A = A' *b; so the system becomes very small as COLUMS <<< ROWS. More...
 
subroutine multi_tools::multi_compute_python_field (states, iphase, option_path_python, scalar_result, sfield, vfield, tfield)
 : This subroutine uses python run string to run the python_scalar_diagnostic to read a field the only difference with the normal approach is that here the Dummy field is used and the returned field is an array. IMPORTANT: state is used here, NOT packed_state It can be used for a given array, scalar_result, scalar fields, vector fields or tensor fields, but only one at a time More...
 
subroutine multi_tools::petsc_logging (func, stage, ierr, default, push_no, stage_name)
 Subroutines that can initialise, register and start/end a petsc performance profiling routin. The defauly behaviour is initiliased for time-loop profiling. More...
 
subroutine petsc_log_init (stage_name, no, stage, ierr)
 : This routine registers the stage for PETSC logging IMPORTANT: More...
 
subroutine petsc_log_push (no, stage, ierr)
 : This routine starts the current stage registered for PETSc profiling IMPORTANT: More...
 
subroutine petsc_log_pop (ierr)
 : This routine ends the current stage registered for PETSc profiling IMPORTANT: More...
 
logical function multi_tools::is_tracer_field (input_name)
 : Returns true if the input name is a Tracer type:PassiveTracer, Tracer, Species, Concentration or any other reserved word This function is used to easily identify Tracers that may have diffusion, sources/sinks, dispersion, etc. More...
 
logical function multi_tools::is_active_tracer_field (input_name, ignore_concentration)
 : Returns true if the input name is an Active Tracer type, Tracer, Species, Concentration or any other reserved word This function is used to easily identify Tracers that may have diffusion, sources/sinks, dispersion, etc. More...
 
logical function multi_tools::is_passivetracer_field (input_name)
 : Returns true if the input name is a PassievTracer type. More...
 

Function/Subroutine Documentation

◆ get_nodes_edges()

subroutine read_nastran_file::get_nodes_edges ( integer, intent(inout)  Nnodes,
integer, intent(inout)  Nedges 
)
Here is the caller graph for this function:

◆ insertion_sort()

subroutine quicksort::insertion_sort ( integer, dimension(n)  vec,
integer  n 
)
Here is the caller graph for this function:

◆ partition()

integer function quicksort::partition ( integer, dimension(:), intent(inout)  v)
Here is the caller graph for this function:

◆ petsc_log_init()

subroutine petsc_logging::petsc_log_init ( character( len = * ), intent(in)  stage_name,
integer  no,
dimension(0:9)  stage,
intent(inout)  ierr 
)

: This routine registers the stage for PETSC logging IMPORTANT:

Here is the caller graph for this function:

◆ petsc_log_pop()

subroutine petsc_logging::petsc_log_pop ( intent(inout)  ierr)

: This routine ends the current stage registered for PETSc profiling IMPORTANT:

Here is the caller graph for this function:

◆ petsc_log_push()

subroutine petsc_logging::petsc_log_push ( integer  no,
dimension(0:9)  stage,
intent(inout)  ierr 
)

: This routine starts the current stage registered for PETSc profiling IMPORTANT:

Here is the caller graph for this function: