|
Flow123d
|
Unified interface to various linear solvers. More...
#include <ctype.h>#include <strings.h>#include "system/system.hh"#include "system/sys_profiler.hh"#include "system/xio.h"#include "input/input_type.hh"#include "input/accessors.hh"#include "la/distribution.hh"#include "la/solve.h"#include "la/linsys.hh"Go to the source code of this file.
Macros | |
| #define | TEST_TYPE(name_str, id) if ( strcmpi( solver->name, name_str ) == 0 ) solver->type = (id); |
| Set solver type from its name. More... | |
| #define | SET_GENERIC_CALL sprintf( cmdline, "%s %s",solver->executable,solver->params.c_str()) |
| #define | SET_MATLAB_CALL sprintf( cmdline, "matlab -r solve" ) |
Functions | |
| static void | solver_set_type (struct Solver *solver) |
| static void | RunExtern (struct Solver *solver, char *cmdline, void(*write_sys)(struct Solver *), void(*read_sol)(struct Solver *)) |
| static void | clean_directory (void) |
| Clean temporary directory of external solver. More... | |
| void | solver_init (Solver *solver, Input::AbstractRecord in_rec) |
| Initialize a solver structure. More... | |
| void | solve_system (struct Solver *solver, struct LinSys *system) |
| Solves a given linear system. More... | |
| void | RunExtern (Solver *solver, char *cmdline, void(*write_sys)(Solver *), void(*read_sol)(Solver *)) |
| Call an external solver. More... | |
| void | solver_petsc (Solver *solver) |
| static void | write_sys_matlab (struct Solver *solver) |
| MATLAB call functions. More... | |
| static void | write_matlab_linsys (LinSys *mtx, int write_nz) |
| Write MATLAB system. More... | |
| static void | read_sol_matlab (struct Solver *solver) |
| Read MATLAB solution into solver->LinSys->vx. More... | |
| static void | isol_params_init (ISOL_params *par) |
| ISOL calling functions. More... | |
| static void | write_sys_isol (struct Solver *solver) |
| Write down input for ISOL. More... | |
Unified interface to various linear solvers.
Copyright (C) 2007 Technical University of Liberec. All rights reserved.
Please make a following refer to Flow123d on your project site if you use the program for any purpose, especially for academic research: Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
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., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
$Id$ $Revision$ $LastChangedBy$ $LastChangedDate$
The only internal (linked) solver is PETSC KPS which is already interface to the number of direct and iterative solvers. Further several external solvers are supported: MATLAB, ISOL (due to Pavel Jiranek)
Definition in file solve.cc.
| #define SET_GENERIC_CALL sprintf( cmdline, "%s %s",solver->executable,solver->params.c_str()) |
| #define SET_MATLAB_CALL sprintf( cmdline, "matlab -r solve" ) |
| #define TEST_TYPE | ( | name_str, | |
| id | |||
| ) | if ( strcmpi( solver->name, name_str ) == 0 ) solver->type = (id); |
|
static |
|
static |
|
static |
|
static |

| void RunExtern | ( | Solver * | solver, |
| char * | cmdline, | ||
| void(*)(Solver *) | write_sys, | ||
| void(*)(Solver *) | read_sol | ||
| ) |
Call an external solver.
Make temporary directory, write down matrix and RHS vector. Then perform system call of given program and read solution form given file.
| [in,out] | solver | solver structure to use (solution in linear system) |
| [in] | cmdline | calling command line |
| [in] | write_sys | function to write down linear system |
| [in] | read_sol | function to read the solution |
prepare data
if user provides an explicit control file, use that one instead
run the solver
read the solution
Solves a given linear system.
Call user selected internal or external solver.
| [in] | solver | solver structure to use |
| [in,out] | system | linear system to solve, conatains also result |
set command line for external solvers
| void solver_init | ( | Solver * | solver, |
| Input::AbstractRecord | in_rec | ||
| ) |
|
static |
|
static |
1.8.4