Skip to content

Commit

Permalink
test_spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
menon-karthik committed Jun 25, 2024
1 parent 97ec859 commit be78f3b
Showing 1 changed file with 3 additions and 37 deletions.
40 changes: 3 additions & 37 deletions docs/pages/add_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,6 @@ Below are details on the steps required to implement a new block in svZeroDSolve

# 2. Create a class for the new block

## The new class will be inherited from `Block`.

## Define a constructor of the form:
```
GenericBlock(int id, Model *model)
: Block(id, model, BlockType::block_type, BlockClass::block_class,
{{Param_1, InputParameter()},
{Param_2, InputParameter()},
...,
{Param_N, InputParameter()}}) {}
```
* `GenericBlock` is the name of the new class
* `block_type` and `block_class` are the same as what was added in Step 1 above.
* The names of the input parameters of the block are `Param_1`, ... , `Param_N`.
* The properties of each parameter are defined by `InputParameter`, which specifies whether it is optional, an array, a scalar, a function, and its default value.
* The names `Param_1`, ... , `Param_N` should be the same as the parameter names within the block definition in the `.json` configuration/input file.

## The class should have a `setup_dofs(DOFHandler &dofhandler)` function.
* This function typically only includes a call to the following function:
```
Block::setup_dofs_(DOFHandler &dofhandler, int num_equations, const std::list<std::string> &internal_var_names)
```
* In the above function, `num_equations` is the number of governing equations for the new block.
* `internal_var_names` is a list of strings that specify names for variables that are internal to the block, i.e. all variables for the block apart from the flow and pressure at the block's inlets and outlets.

## The class should have a `TripletsContributions num_triplets{*, *, *}` object.
* This specifies how many elements the governing equations of the block contribute to the global `F`, `E` and `dC_dy` matrices respectively. Details are in Step 3 below.

## The class should have an `update_constant` function and may also contain `update_time` and `update_solution` functions. These functions implement the governing equations for the block. Details are in Step 4 below.

## *(Optional)* The class can have an `enum ParamId` object that relates the parameter indices to their names.
* This makes it easier to reference the parameters while implementing the governing equations of the block (discussed below).
* The order of parameters in the `ParamId` object should match the order in the constructor.

# 2. Create a class for the new block

* The new class will be inherited from `Block`.
<p> <br> </p>
* Define a constructor of the form:
Expand All @@ -75,10 +39,12 @@ Below are details on the steps required to implement a new block in svZeroDSolve
```
* In the above function, `num_equations` is the number of governing equations for the new block.
* `internal_var_names` is a list of strings that specify names for variables that are internal to the block, i.e. all variables for the block apart from the flow and pressure at the block's inlets and outlets.

<br>
* The class should have a `TripletsContributions num_triplets{*, *, *}` object.
* This specifies how many elements the governing equations of the block contribute to the global `F`, `E` and `dC_dy` matrices respectively. Details are in Step 3 below.

<p> <br> </p>

* The class should have an `update_constant` function and may also contain `update_time` and `update_solution` functions. These functions implement the governing equations for the block. Details are in Step 4 below.

* *(Optional)* The class can have an `enum ParamId` object that relates the parameter indices to their names.
Expand Down

0 comments on commit be78f3b

Please sign in to comment.