/[escript]/trunk/paso/src/Functions.c
ViewVC logotype

Annotation of /trunk/paso/src/Functions.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1628 - (hide annotations)
Fri Jul 11 13:12:46 2008 UTC (11 years, 3 months ago) by phornby
File MIME type: text/plain
File size: 1433 byte(s)

Merge in /branches/windows_from_1456_trunk_1620_merged_in branch.

You will find a preserved pre-merge trunk in tags under tags/trunk_at_1625.
That will be useful for diffing & checking on my stupidity.

Here is a list of the conflicts and their resolution at this
point in time.


=================================================================================
(LLWS == looks like white space).

finley/src/Assemble_addToSystemMatrix.c - resolve to branch - unused var. may be wrong.....
finley/src/CPPAdapter/SystemMatrixAdapter.cpp - resolve to branch - LLWS
finley/src/CPPAdapter/MeshAdapter.cpp - resolve to branch - LLWS
paso/src/PCG.c - resolve to branch - unused var fixes.
paso/src/SolverFCT.c - resolve to branch - LLWS
paso/src/FGMRES.c - resolve to branch - LLWS
paso/src/Common.h - resolve to trunk version. It's omp.h's include... not sure it's needed,
but for the sake of saftey.....
paso/src/Functions.c - resolve to branch version, indentation/tab removal and return error
on bad unimplemented Paso_FunctionCall.
paso/src/SolverFCT_solve.c - resolve to branch version, unused vars
paso/src/SparseMatrix_MatrixVector.c - resolve to branch version, unused vars.
escript/src/Utils.cpp - resloved to branch, needs WinSock2.h
escript/src/DataExpanded.cpp - resolved to branch version - LLWS
escript/src/DataFactory.cpp - resolve to branch version
=================================================================================

This currently passes tests on linux (debian), but is not checked on windows or Altix yet.

This checkin is to make a trunk I can check out for windows to do tests on it.

Known outstanding problem is in the operator=() method of exceptions
causing warning messages on the intel compilers.

May the God of doughnuts have mercy on my soul.


1 gross 1476 /* $Id:$ */
2    
3     /*******************************************************
4     *
5     * Copyright 2008 by University of Queensland
6     *
7     * http://esscc.uq.edu.au
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13    
14     #include "Common.h"
15     #include "Functions.h"
16 artak 1479 #include "Util.h"
17 gross 1476 /*
18     * numerical calculation of the directional derivative J0w if F at x0 in the direction w. f0 is the value of F at x0.
19     * setoff is workspace
20     */
21    
22     err_t Paso_FunctionDerivative(double* J0w, const double* w, Paso_Function* F, const double *f0, const double *x0, double* setoff)
23     {
24     err_t err=0;
25     dim_t n=F->local_n;
26     double norm_w,epsnew,norm_x0;
27     epsnew=10.*sqrt(EPSILON);
28     norm_w=Paso_l2(n,w,F->mpi_info);
29    
30     if (norm_w>0) {
31     Paso_zeroes(n,J0w);
32     } else {
33     epsnew = epsnew/norm_w;
34     norm_x0=Paso_l2(n,x0,F->mpi_info);
35     if (norm_x0>0) epsnew*=norm_x0;
36     Paso_LinearCombination(n,setoff,1.,x0,epsnew,w);
37     err=Paso_FunctionCall(F,J0w,setoff);
38     if (err==0) {
39     Paso_Update(n,1./epsnew,J0w,-1./epsnew,f0); /* J0w = (J0w - f0)/epsnew; */
40     }
41     }
42     return err;
43     }
44    
45     err_t Paso_FunctionCall(Paso_Function * F,double* value, const double* arg)
46     {
47 phornby 1628 err_t err=0;
48 gross 1476
49 phornby 1628 /* Not yet please */
50     err = 1;
51    
52     return err;
53 gross 1476 }

  ViewVC Help
Powered by ViewVC 1.1.26