Komplex  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Functions
azk_create_vector.c File Reference

Creation routines for building Komplex vectors. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "az_aztec.h"
#include "azk_komplex.h"
Include dependency graph for azk_create_vector.c:

Functions

void AZK_create_vector_c2k (int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vc, double **vk)
 Create Komplex vector from Complex vector. More...
 
void AZK_create_vector_g2k (int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vr, double *vi, double **vk)
 Create Komplex vector from Real and Imaginary Parts. More...
 
void AZK_create_vector_ri2k (int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vr, double *vi, double **vk)
 Create Komplex vector from Real and Imaginary Parts. More...
 

Detailed Description

Creation routines for building Komplex vectors.

KOMPLEX is an add-on module to AZTEC that allows users to solve complex-valued linear systems.

KOMPLEX solves a complex-valued linear system Ax = b by solving an equivalent real-valued system of twice the dimension. Specifically, writing in terms of real and imaginary parts, we have

\[ (A_r + i*A_i)*(x_r + i*x_i) = (b_r + i*b_i) \]

or by separating into real and imaginary equations we have

\[ \left( \begin{array}{rr} A_r & -A_i\\ A_i & A_r \end{array} \right) \left( \begin{array}{r} x_r\\ x_i \end{array} \right) = \left( \begin{array}{r} b_r\\ b_i \end{array} \right) \]

which is a real-valued system of twice the size. If we find xr and xi, we can form the solution to the original system as x = xr +i*xi.

KOMPLEX accept user linear systems in three forms with either global or local index values.

1) The first form is true complex. The user passes in an MSR or VBR format matrix where the values are stored like Fortran complex numbers. Thus, the values array is of type double that is twice as long as the number of complex values. Each complex entry is stored with real part followed by imaginary part (as in Fortran).

2) The second form stores real and imaginary parts separately, but the pattern for each is identical. Thus only the values of the imaginary part are passed to the creation routines.

3) The third form accepts two real-valued matrices with no assumption about the structure of the matrices. Each matrix is multiplied by a user-supplied complex constant. This is the most general form.

Each of the above forms supports a global or local index set. By this we mean that the index values (stored in bindx) refer to the global problem indices, or the local indices (for example after calling AZ_transform).

Function Documentation

void AZK_create_vector_c2k ( int *  options,
double *  params,
int *  proc_config,
AZ_MATRIX *  Amat_komplex,
double *  vc,
double **  vk 
)

Create Komplex vector from Complex vector.

Transforms a complex-valued vector vc to a real vector where vc in Fortran complex format, i.e., if dimension of complex system is N then vc is of length 2*N and the first complex value is stored with the real part in vc[0] and the imaginary part in vc[1] and so on.

Parameters
options(In) Determines specific solution method and other parameters.
params(In) Drop tolerance and convergence tolerance info.
proc_config(In) Machine configuration. proc_config[AZ_node] is the node number. proc_config[AZ_N_procs] is the number of processors.
Amat_komplex(In) Komplex version of matrix stored as an AZ_MATRIX structure.
vc(In) Contains a complex vector with the real/imag parts interleaved as in Fortran complex format.
vk(Out) Komplex version of vc.

Referenced by AZK_create_linsys_c2k().

void AZK_create_vector_g2k ( int *  options,
double *  params,
int *  proc_config,
AZ_MATRIX *  Amat_komplex,
double *  vr,
double *  vi,
double **  vk 
)

Create Komplex vector from Real and Imaginary Parts.

Transforms a complex vector where double precision arrays hold the real and imaginary parts separately.

Parameters
options(In) Determines specific solution method and other parameters.
params(In) Drop tolerance and convergence tolerance info.
proc_config(In) Machine configuration. proc_config[AZ_node] is the node number. proc_config[AZ_N_procs] is the number of processors.
Amat_komplex(Out) Komplex version of matrix stored as an AZ_MATRIX structure.
vr(In) Real part of input vector.
vi(In) Imaginary part of input vector.
vk(Out) Komplex version of input vector.

References AZK_create_vector_ri2k().

Referenced by AZK_create_linsys_g2k().

void AZK_create_vector_ri2k ( int *  options,
double *  params,
int *  proc_config,
AZ_MATRIX *  Amat_komplex,
double *  vr,
double *  vi,
double **  vk 
)

Create Komplex vector from Real and Imaginary Parts.

Transforms a complex vector where double precision arrays hold the real and imaginary parts separately.

Parameters
options(In) Determines specific solution method and other parameters.
params(In) Drop tolerance and convergence tolerance info.
proc_config(In) Machine configuration. proc_config[AZ_node] is the node number. proc_config[AZ_N_procs] is the number of processors.
Amat_komplex(Out) Komplex version of matrix stored as an AZ_MATRIX structure.
vr(In) Real part of input vector.
vi(In) Imaginary part of input vector.
vk(Out) Komplex version of input vector.

Referenced by AZK_create_linsys_ri2k(), and AZK_create_vector_g2k().