> For the complete documentation index, see [llms.txt](https://wiki.solids.group/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.solids.group/alamo/parmparse.md).

# ParmParse

## Selector

The `pp.select` automates the selection of polymorphic objects by instantiating the object (using either static dispatch or dynamic dispatch) and relaying the parser to the model's `Parse` function. For example:

```
    pp.select<Model::AllenCahn,Model::CahnHilliard>("phase_field", value.model);
```

sets `value.model` to either `Model::AllenCahn` or `Model::CahnHilliard` depending on what is set in `phase_field.type`. The string that is matched is set as the `name` field in the corresponding class, for example,

```
public:
    static constexpr const char* name = "allencahn";
```

indicating that an input value of `phase_field.type = allencahn` will relay to the Allen Cahn integrator, and any subsequent arguments will be given the `allencahn` prefix (e.g. `phase_field.allencahn.mobility=1` ).

### Argument forwarding

Sometimes the model that is selected requires additional arguments upon construction. The `IC::IC` family of classes requires an `amrex::Geometry` argument and optionally a unit. These can be passed in using the `pp.forward_args` function as:

```
pp.select<IC::Constant,IC::Expression>("ic",value.ic,pp.forward_args(value.geom));
```

{% hint style="warning" %}
This is a change introduced by [PR297](https://github.com/solidsgroup/alamo/pull/297). Previously, constructor arguments could be forwarded in simply as additional argument to select, like

```
pp.select<IC::Constant,IC::Expression>("ic",value.ic,value.geom);
```

i.e. without the `pp.forward_args` wrapper. This is no longer supported and will trigger compilation errors; all that you need to do to fix is to add the wrapper and it should compile as before.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.solids.group/alamo/parmparse.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
