System Preprocessors
Defines | Functions
scaling.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "petsc.h"
#include "syspro.h"
#include "sysprotransform.h"
#include "sysprolinear.h"
#include "petscmat.h"

Go to the source code of this file.

Defines

#define PREPROCESSOR   "scaling"

Functions

static PetscErrorCode set_intelligent_scaling (NumericalProblem theproblem, const char **type, const char **reason)
static PetscErrorCode scale_system (const char *type, int nopt, PetscTruth overwrite, NumericalProblem inproblem, NumericalProblem *outproblem, void *gctx, void **ctx, PetscTruth *success)
static PetscErrorCode unscale_system (const char *scaling_type, PetscTruth overwrite, void *gctx, void *ctx, NumericalProblem problem, NumericalProblem nextproblem, NumericalSolution scaled, NumericalSolution unscaled)
static PetscErrorCode setup_scaling_choices ()
static PetscErrorCode specific_scaling_choices (NumericalProblem theproblem, SalsaTransform scaling)
PetscErrorCode DeclareScalingPreprocessor (void)

Detailed Description

Definition in file scaling.c.


Define Documentation

#define PREPROCESSOR   "scaling"

Definition at line 16 of file scaling.c.

Referenced by DeclareScalingPreprocessor(), and setup_scaling_choices().


Function Documentation

PetscErrorCode DeclareScalingPreprocessor ( void  )
static PetscErrorCode scale_system ( const char *  type,
int  nopt,
PetscTruth  overwrite,
NumericalProblem  inproblem,
NumericalProblem outproblem,
void *  gctx,
void **  ctx,
PetscTruth *  success 
) [static]
static PetscErrorCode set_intelligent_scaling ( NumericalProblem  theproblem,
const char **  type,
const char **  reason 
) [static]

Definition at line 21 of file scaling.c.

References CHKERRQ(), ierr, SysProRetrieveQuantity(), and TRUTH.

Referenced by DeclareScalingPreprocessor().

static PetscErrorCode setup_scaling_choices ( ) [static]
static PetscErrorCode specific_scaling_choices ( NumericalProblem  theproblem,
SalsaTransform  scaling 
) [static]

This is the 'specific setup' phase of the scaling preprocessor. See Usage modes for details.

This routine eliminates unsymmetric scalings if we are dealing with a symmetric system.

Definition at line 265 of file scaling.c.

References CHKERRQ(), ierr, SysProRetrieveQuantity(), TransformGetObjects(), TransformObjectGetIntAnnotation(), and TransformObjectMark().

Referenced by DeclareScalingPreprocessor().

static PetscErrorCode unscale_system ( const char *  scaling_type,
PetscTruth  overwrite,
void *  gctx,
void *  ctx,
NumericalProblem  problem,
NumericalProblem  nextproblem,
NumericalSolution  scaled,
NumericalSolution  unscaled 
) [static]

Definition at line 190 of file scaling.c.

References CHKERRQ(), ierr, LinearSolutionCopyStats(), and LinearSolutionGetVector().

Referenced by DeclareScalingPreprocessor().