#!@PYTHON@
# -*- coding: utf-8 -*-
# @configure_input@

#-------------------------------------------------------------------------------

# This file is part of Code_Saturne, a general-purpose CFD tool.
#
# Copyright (C) 1998-2013 EDF S.A.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA.

#-------------------------------------------------------------------------------

#===============================================================================
# Import required Python modules
#===============================================================================

import sys

# Trick so that one doesn't have to set the PYTHONPATH variable
sys.path.insert(0, '@pkgpythondir@')

from cs_package import package
from cs_exec_environment import *
from cs_case import *
from cs_case_coupling import *

#===============================================================================
# User variable settings to specify a coupling computation environnement
#
# Variables set to 'None' will be determined automatically
#===============================================================================

casedir = 'CASEDIRNAME'

# A coupling case is defined by a dictionnary, containing the following:

# Solver type ('Code_Saturne', 'SYRTHES', 'NEPTUNE_CFD' or 'Code_Aster')
# Domain directory name
# Run parameter setting file
# Number of processors (or None for automatic setting)
# Optional command line parameters. If not useful = None

# Define coupled domains
domains = [
APP_DICTS
    ]

#-------------------------------------------------------------------------------

if __name__ == '__main__':

    # Run coupling case

    case = coupling(package(),
                    domains,
                    casedir)

    # Select run id
    # (usually date+time; defined automatically when preparing data, but we need
    # to set this so as to match an existing run when only running the solver or
    # saving results with previously prepared data)

    run_id = None

    # Execute script

    case.run(n_procs=None,
             run_id=run_id,
             prepare_data=True,
             run_solver=True,
             save_results=True)

