Skip to contents

Constructor for the OGS6 base class

Active bindings

sim_name

Simulation name. value must be string

sim_path

Simulation path. value must be string

logfile

Logfile path. value must be string

gml

.gml. read-only

geometry

.prj geometry tag. value must be string

meshes

.prj meshes tag. value must be list of strings

vtus

.vtus. value must be list of OGS6_vtu objects

python_script

.prj python_script tag. value must be string

search_length_algorithm

.prj search_length_algorithm tag. value must be prj_search_length_algorithm object

processes

.prj processes tag. value must be list of prj_process objects

time_loop

.prj time_loop tag. value must be prj_time_loop object

local_coordinate_system

.prj local_coordinate_system tag. value must be prj_local_coordinate_system object

media

.prj media tag. value must be list of prj_medium objects

parameters

.prj parameters tag. value must be list of prj_parameter objects

chemical_system

.prj chemical_system tag. value must be prj_chemical_system object

curves

.prj curves tag. value must be list of prj_curve objects

process_variables

.prj process_variables tag. value must be list of prj_process_variable objects

nonlinear_solvers

.prj nonlinear_solvers tag. value must be list of prj_nonlinear_solver objects

linear_solvers

.prj linear_solvers tag. value must be list of prj_linear_solver objects

test_definition

.prj test_definition tag. value must be list of prj_vtkdiff objects

insitu

.prj insitu tag. value must be prj_insitu object

pvds

.pvds. value must be list of OGS6_pvd objects

h5s

h5s value must be of class H5IdComponent as returned by rhdf5::h5read().

mshs

mshs value must be an object of class OGS6_msh.

include

include value must be a string.

Methods


Method new()

Creates new OGS6 object

Usage

OGS6$new(sim_name, sim_path)

Arguments

sim_name

string: Simulation name

sim_path

string: Path where all files for the simulation will be saved

Examples

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")


Method add()

Adds a .prj simulation component

Usage

OGS6$add(x)

Arguments

x

An object of any .prj `prj` class

Examples

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$add(prj_parameter(name = "foo", type = "bar"))


Method add_gml()

Adds a reference to a file with ending .gml and optionally, a OGS6_gml object

Usage

OGS6$add_gml(gml)

Arguments

gml

string | OGS6_gml: Either a path to a file with extension .gml or a OGS6_gml object.

Examples

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$add_gml("this_works.gml")
\dontrun{ogs6_obj$add_gml("this_doesnt.oops")}


Method add_mesh()

Adds a reference to a .vtu file and optionally, a OGS6_vtu object

Usage

OGS6$add_mesh(path, axisym = FALSE, read_in_vtu = FALSE)

Arguments

path

string: A path

axisym

flag: Is the mesh axially symmetrical?

read_in_vtu

flag: Optional: Should .vtu file just be copied or read in too?

Examples

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$add_mesh("this_works.vtu")
\dontrun{ogs6_obj$add_mesh("this_doesnt.oops")}


Method update_component()

Update a component of the OGS6 object.

Usage

OGS6$update_component(cmpts)

Arguments

cmpts

list(sublist, length(sublist) == 2): The first element of a sublist is a character that calls an OGS6 component, the second one is the corresponding value.

Examples

\dontrun{ogs6_obj$update_component(list(
                   list("ogs6_obj$parameters[[1]]$value", 2.3),
                   list("ogs6_obj$media[[1]]$properties[[2]]$value",
                        1.0e-3)))}


Method get_status()

Checks if the OGS6 object has all necessary parameters for starting a simulation

Usage

OGS6$get_status(print_status = TRUE)

Arguments

print_status

flag: Should the status be printed to the console?

Examples

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$get_status()


Method print()

Overrides default printing behaviour print_log

Usage

OGS6$print()


Method print_log()

Prints logfile to console (if it exists)

Usage

OGS6$print_log()


Method clear()

Clears components from the OGS6 object

Usage

OGS6$clear(which)

Arguments

which

character: The names of the components (all by default). If you want to delete only some components, run names(ogs6_prj_top_level_classes()) for the available options.


Method clone()

The objects of this class are cloneable with this method.

Usage

OGS6$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `OGS6$new`
## ------------------------------------------------

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")

## ------------------------------------------------
## Method `OGS6$add`
## ------------------------------------------------

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$add(prj_parameter(name = "foo", type = "bar"))

## ------------------------------------------------
## Method `OGS6$add_gml`
## ------------------------------------------------

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$add_gml("this_works.gml")
if (FALSE) ogs6_obj$add_gml("this_doesnt.oops")

## ------------------------------------------------
## Method `OGS6$add_mesh`
## ------------------------------------------------

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$add_mesh("this_works.vtu")
if (FALSE) ogs6_obj$add_mesh("this_doesnt.oops")

## ------------------------------------------------
## Method `OGS6$update_component`
## ------------------------------------------------

if (FALSE) ogs6_obj$update_component(list(
                   list("ogs6_obj$parameters[[1]]$value", 2.3),
                   list("ogs6_obj$media[[1]]$properties[[2]]$value",
                        1.0e-3)))

## ------------------------------------------------
## Method `OGS6$get_status`
## ------------------------------------------------

ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path")
ogs6_obj$get_status()
#> 'processes' has at least one element
#> 'time_loop' is defined
#> 'nonlinear_solvers' has at least one element
#> 'linear_solvers' has at least one element
#> 'parameters' has at least one element
#> 'process_variables' has at least one element
#> 'mesh' is defined
#> 'geometry' is defined
#> 'media' has at least one element
#> 'test_definition' has at least one element
#> 'curves' has at least one element
#> 'meshes' has at least one element
#> 'local_coordinate_system' is defined
#> 'search_length_algorithm' is defined
#> 'chemical_system' is defined
#> 'python_script' is defined
#> 'insitu' is defined