CEPS
Extended syntax for input and inline parameters

General reading format

According to current files options a new way is introduced here to add some definitions of scalar constants, functions and other objects to be used as source terms, boundary conditions or physical coefficients. For the moment, the way to define some objects in the input file is quite simple and follows the following standard definition policy :

<main_keyword> : <value>...

Add to dictionary

Adding objects to the dictionary follows the same policy, that is to say a standardized policy using keywords and a lazy syntax for options under the main keyword DEFINE. In addition, extra rules are available here and follows the following general syntax

DEFINE : name [<field_type>] <options>

where the symbol [...] means that this argument is an option in some cases.

Details

A few field types are avalaible for the moment:

FIELD string tag Explanation
CONSTANT CONSTANT Hold a real constant
FUNCTION FUNCTION Hold a function, see below for more options
PIECEWISE PIECEWISE Define a piecewise scalar field
OPERATOR OPERATOR Define an operator between two objects or two constants
[ALIAS] nothing Not necessary but means that you attribute an alias for an internal already set object

Here are the possible options for each type:

<!-- Define an ALIAS to an internal object -->
DEFINE : name [ALIAS] <internal_tag>
<!-- Define a real CONSTANT -->
DEFINE : name CONSTANT <value>
<!-- Define a PIECEWISE variable -->
DEFINE : name PIECEWISE [<attr_1> <value_1>] [<attr_2> <value_2>] ...
<!-- Define a new relation or an OPERATOR between two things -->
DEFINE : name OPERATOR [<dico_tag_1>, <value>] [*, /, +, -] [<dico_tag_2>, <value>]
<!-- Define a FUNCTION which depends on time, space or solution u -->
DEFINE : name FUNCTION [TIME <options>] [SPACE <options>] [UFUNC <options>]
@ PIECEWISE
piecewise field
@ FUNCTION
function field, some options are needed here
@ CONSTANT
constant field, aka real_t or tensor [future]
@ OPERATOR
operator field [*, /, +, -]
@ ALIAS
no tag, an internal tag is needed

Functions can be defined in different ways relative to the desired type. For now, three different types are avalaible and each type can be mixed with others

  • time function $f(x)$
  • space function $(t)$
  • solution function $f(u)$ where u is data from a DistributedVector.

For time and space functions you can use a predefined profile, known under the name of bell-type :

Type of bell string TAG Explanation
CONST CONSTANT, CONST constant bell
C4 C4, D4, 4 C4 bell
C5 C5, D5, 5 C5 bell
CINF CINF, DINF, I Cinf bell
GAUSSIAN GAUSSIAN, GAUSS, G gaussian bell
HEAVISIDE HEAVISIDE, HEAVY, H heaviside bell
RECTANGLE RECTANGLE, REC, R rectangle bell

List of options for <tt>TIME</tt> to create time functions

Create an time function (aka $f(t)$) is very simple with this syntax. All parameters are optional.

<!-- Definition for activation function : f(t) -->
DEFINE : name FUNCTION TIME PROFILE <bell_type> \\
START <time_start> \\
END <time_end> \\
DURATION <duration> \\
PERIOD <period> \\
SCALE <scale>

with default values

<time_start> = 0.0 <!-- means 'start at 0.0'-->
<time_end> = 5000.0 <!-- means 'end at 0.0'-->
<duration> = 0.0 <!-- means 'activate during 0.0'-->
<period> = -1.0 <!-- means 'no periodicity'-->
<scale> = 1.0 <!-- means 'factor of amplitude is 1.0'-->

In addition you can, here again, define your excitation time function by internal tag like

DEFINE : name FUNCTION TIME <internal_tag>

List of options for <tt>SPACE</tt> to create space functions

If you want to create a space function, an activation function with a space bell, you can in addition create a spatial bell function (the name here is generic for centralized spatial function) like

<!-- Definition for stimulation -->
DEFINE : name FUNCTION SPACE PROFILE <bell_type> \\
CENTER <ox> <oy> <oz> \\
DIAMETER <diameter> \\
SCALE <scale>

with default values

<bell_type> = "C4" <!-- means 'constant bell'-->
<ox> <oy> <oz> = 0.0 0.0 0.0 <!-- means 'center at origin 0.0 0.0 0.0'-->
<diameter> = 1.0 <!-- means 'diameter is 1.0'-->
<scale> = 1.0 <!-- means 'factor is 1.0'-->

In addition you can, here again, define your spatial function by internal tag like

DEFINE : name FUNCTION SPACE <internal_tag>

List of options for <tt>UFUNC</tt> to create solution functions

For now, you can only used predefined solution function (internal tag) like

DEFINE : name FUNCTION UFUNC <internal_tag>

Add a source term

Add a source term from its definition in the dictionary is quite simple and you can add some extra options. You can set the source term type like : DEFAULT, KTERM, IAPP

SOURCE_TERM : name <dico_tag> \\
COMPONENT <component> \\
[TYPE <st_type> \\]
[ATTRIBUTE <attr> \\]
[SCALE <factor> ]

by default no restriction are enabled, the scale is 1.0 and TYPE is DEFAULT, component default is 0.

Add boundary condition

In the same way, you can set any boundary condition with some extra options

BOUNDARY_CONDITION : name <BC_TYPE> <dico_tag> \\
COMPONENT <component> \\
[ATTRIBUTE <attr> \\]
[MESH_DIMENSION <dimension> \\]
[SCALE <factor> \\]
[VOLUMIC ]]
@ VOLUMIC
3D mesh
Definition: GeometryReader.hpp:47

with the same default value for scale factor (1.0) and no restriction, component default is 0 and the searching mesh dimension is the higher presented mesh by default.

The options for BC_TYPE are DIRICHLET, NEUMANN and ROBIN.

A special consideration is made for DIRICHLET boundary conditions : if the VOLUMIC keyword is present so we are searching node with attribute ATTRIBUTE inside the domain. In other cases, (NEUMANN or ROBIN) this keyword has no effect and we considere only boundary nodes/elements.

Some examples

Here some examples :

// dico definitions
// define constant everywhere
DEFINE : j_e CONSTANT 2.6 // define constant everywhere
// define a stimulation function
DEFINE : stim1 FUNCTION SPACE PROFILE CINF \\
CENTER -1.48443 -19.2075 18.6753 \\
DIAMETER 1.0 \\
SCALE 1.0 \\
TIME PROFILE CINF \\
START 1.0 \\
END 15.0 \\
DURATION 1.0 \\
PERIOD -1
// define an excitation function from internal tag
DEFINE : act1 FUNCTION TIME sin(t)
// define an excitation function from parameters
DEFINE : act2 FUNCTION TIME START 15.0 \\
END 0.1 \\
DURATION 1.0 \\
PERIOD -1 \\
SCALE 1.0
// define an object read from file
DEFINE : ue2 FILE ./ue2.dat
// define a new relation/operator between two objects
DEFINE : Hue2 OPERATOR act1 * ue2
// define an alias for some internal object
DEFINE : chi standard_chi
// insert source terms and boundary conditions in the solver
// define a stimulation source term from dictionary object named 'stim' and restrict it to attribute 200 and on component 0
SOURCE_TERM : stim stim COMPONENT 0 ATTRIBUTE 200 TYPE IAPP
// define another source term from dictionary of type KTERM on attribute 200
SOURCE_TERM : Hue2 Hue2 COMPONENT 0 ATTRIBUTE 200 TYPE KTERM
// define an external boundary condition on entire boundary
BOUNDARY_CONDITION : external NEUMANN Hue2 COMPONENT 0
@ FILE
file field, set the object from file