From 94ec5c500de8877dc462df6ef86af5ae0187625f Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Thu, 22 Aug 2019 13:59:52 +0200 Subject: [PATCH] add new sub-key TIME_INTERVAL to BC --- ogs5py/fileclasses/bc/core.py | 196 +++++++++++++++++----------------- 1 file changed, 99 insertions(+), 97 deletions(-) diff --git a/ogs5py/fileclasses/bc/core.py b/ogs5py/fileclasses/bc/core.py index f598fe2..556a944 100644 --- a/ogs5py/fileclasses/bc/core.py +++ b/ogs5py/fileclasses/bc/core.py @@ -1,97 +1,99 @@ -# -*- coding: utf-8 -*- -""" -Class for the ogs BOUNDARY CONDITION file. -""" - -from __future__ import absolute_import, division, print_function -from ogs5py.fileclasses.base import BlockFile - - -class BC(BlockFile): - """ - Class for the ogs BOUNDARY CONDITION file. - - Parameters - ---------- - task_root : str, optional - Path to the destiny model folder. - Default: cwd+"ogs5model" - task_id : str, optional - Name for the ogs task. - Default: "model" - - Notes - ----- - Main-Keywords (#): - - BOUNDARY_CONDITION - - Sub-Keywords ($) per Main-Keyword: - - BOUNDARY_CONDITION - - - COMP_NAME - - CONSTRAINED - - COPY_VALUE - - DIS_TYPE - - DIS_TYPE_CONDITION - - EPSILON - - EXCAVATION - - FCT_TYPE - - GEO_TYPE - - MSH_TYPE - - NO_DISP_INCREMENT - - PCS_TYPE - - PRESSURE_AS_HEAD - - PRIMARY_VARIABLE - - TIME_CONTROLLED_ACTIVE - - TIM_TYPE - - Standard block: - :PCS_TYPE: "GROUNDWATER_FLOW" - :PRIMARY_VARIABLE: "HEAD" - :DIS_TYPE: ["CONSTANT", 0.0] - :GEO_TYPE: ["POLYLINE", "boundary"] - - Keyword documentation: - https://ogs5-keywords.netlify.com/ogs/wiki/public/doc-auto/by_ext/bc - - Reading routines: - https://github.com/ufz/ogs5/blob/master/FEM/rf_bc_new.cpp#L228 - - See Also - -------- - add_block - """ - - MKEYS = ["BOUNDARY_CONDITION"] - SKEYS = [ - [ - "PCS_TYPE", - "PRIMARY_VARIABLE", - "COMP_NAME", - "GEO_TYPE", - "DIS_TYPE", - "TIM_TYPE", - "FCT_TYPE", - "MSH_TYPE", - "DIS_TYPE_CONDITION", - "EPSILON", - "TIME_CONTROLLED_ACTIVE", - "EXCAVATION", - "NO_DISP_INCREMENT", - "COPY_VALUE", - "PRESSURE_AS_HEAD", - "CONSTRAINED", - ] - ] - - STD = { - "PCS_TYPE": "GROUNDWATER_FLOW", - "PRIMARY_VARIABLE": "HEAD", - "DIS_TYPE": ["CONSTANT", 0.0], - "GEO_TYPE": ["POLYLINE", "boundary"], - } - - def __init__(self, **OGS_Config): - super(BC, self).__init__(**OGS_Config) - self.file_ext = ".bc" - self.force_writing = True +# -*- coding: utf-8 -*- +""" +Class for the ogs BOUNDARY CONDITION file. +""" + +from __future__ import absolute_import, division, print_function +from ogs5py.fileclasses.base import BlockFile + + +class BC(BlockFile): + """ + Class for the ogs BOUNDARY CONDITION file. + + Parameters + ---------- + task_root : str, optional + Path to the destiny model folder. + Default: cwd+"ogs5model" + task_id : str, optional + Name for the ogs task. + Default: "model" + + Notes + ----- + Main-Keywords (#): + - BOUNDARY_CONDITION + + Sub-Keywords ($) per Main-Keyword: + - BOUNDARY_CONDITION + + - COMP_NAME + - CONSTRAINED + - COPY_VALUE + - DIS_TYPE + - DIS_TYPE_CONDITION + - EPSILON + - EXCAVATION + - FCT_TYPE + - GEO_TYPE + - MSH_TYPE + - NO_DISP_INCREMENT + - PCS_TYPE + - PRESSURE_AS_HEAD + - PRIMARY_VARIABLE + - TIME_CONTROLLED_ACTIVE + - TIME_INTERVAL + - TIM_TYPE + + Standard block: + :PCS_TYPE: "GROUNDWATER_FLOW" + :PRIMARY_VARIABLE: "HEAD" + :DIS_TYPE: ["CONSTANT", 0.0] + :GEO_TYPE: ["POLYLINE", "boundary"] + + Keyword documentation: + https://ogs5-keywords.netlify.com/ogs/wiki/public/doc-auto/by_ext/bc + + Reading routines: + https://github.com/ufz/ogs5/blob/master/FEM/rf_bc_new.cpp#L228 + + See Also + -------- + add_block + """ + + MKEYS = ["BOUNDARY_CONDITION"] + SKEYS = [ + [ + "PCS_TYPE", + "PRIMARY_VARIABLE", + "COMP_NAME", + "GEO_TYPE", + "DIS_TYPE", + "TIM_TYPE", + "FCT_TYPE", + "MSH_TYPE", + "DIS_TYPE_CONDITION", + "EPSILON", + "TIME_CONTROLLED_ACTIVE", + "TIME_INTERVAL", + "EXCAVATION", + "NO_DISP_INCREMENT", + "COPY_VALUE", + "PRESSURE_AS_HEAD", + "CONSTRAINED", + ] + ] + + STD = { + "PCS_TYPE": "GROUNDWATER_FLOW", + "PRIMARY_VARIABLE": "HEAD", + "DIS_TYPE": ["CONSTANT", 0.0], + "GEO_TYPE": ["POLYLINE", "boundary"], + } + + def __init__(self, **OGS_Config): + super(BC, self).__init__(**OGS_Config) + self.file_ext = ".bc" + self.force_writing = True