From f877473ec7bbfcd8015500c8fcb84e58accd2f0a Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Wed, 4 May 2016 12:37:30 +0200
Subject: [PATCH] [PL] Add multicomponent boundary conditions.

The main work was done before, but the parser was missing.
---
 ProcessLib/ProcessVariable.cpp | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/ProcessLib/ProcessVariable.cpp b/ProcessLib/ProcessVariable.cpp
index d9760141fb5..618c2857534 100644
--- a/ProcessLib/ProcessVariable.cpp
+++ b/ProcessLib/ProcessVariable.cpp
@@ -86,8 +86,25 @@ ProcessVariable::ProcessVariable(BaseLib::ConfigTree const& config,
                 "Found geometry type \"%s\"",
                 GeoLib::convertGeoTypeToString(geometry->getGeoType()).c_str());
 
-            // TODO, the 0 is the component_id. Need parser.
-            _bc_configs.emplace_back(std::move(bc_config), *geometry, 0);
+            auto component_id =
+                //! \ogs_file_param{boundary_condition__component}
+                bc_config.getConfigParameterOptional<int>("component");
+
+            if (!component_id)
+            {
+                if (_n_components == 1)
+                    // default value for single component vars.
+                    component_id = 0;
+                else
+                    OGS_FATAL(
+                        "The <component> tag could not be found for the "
+                        "multi-component boundary condition of the process "
+                        "variable `%s'.",
+                        _name.c_str());
+            }
+
+            _bc_configs.emplace_back(std::move(bc_config), *geometry,
+                                     *component_id);
         }
     } else {
         INFO("No boundary conditions found.");
-- 
GitLab