从混合偏导到 李微分到 黎曼张量

连续混合偏导数与其求导顺序无关, 即
(1)       $\partial_{,xy}f=\partial_{,yx}f$
其几何意义是函数f从A点出发到B=A+dx再到C=B+dy和从A点出发到D=A+dy再到C=D+dx, 其函数值的变化是相同的.






图1




上式也可用李括号写为
(2)   $[\frac{\partial}{\partial\lambda},\frac{\partial}{\partial\mu}]f=(\frac{\partial}{\partial\lambda}\frac{\partial}{\partial\mu}-\frac{\partial}{\partial\lambda}\frac{\partial}{\partial\mu})f=0$
或者干脆写成
(3)  $[\frac{\partial}{\partial\lambda},\frac{\partial}{\partial\mu}]=0$
由于该式在任意坐标系下成立, 我们在这里不再用x,y为下标.反过来说,如果两个向量V=$d_{,\lambda}$和U=$d_{,\mu}$线性无关且其李括号为零,则这两个变量$\lambda$和$\mu$可为坐标基底(证明过程可参见[1]p47~49).
图2


方程式(3)的几何意义可解释为A点的切矢(当AB为无限小时,AB为A点的切矢)沿$d_{,\lambda}$方向被拖带到D时,如与D点的切矢方向相同,则$d_{,\lambda}$和$d_{,\mu}$的李括号为零([1]p46).

  图3
图4


从拖带的观点出发,李括号也可解释为向量U沿向量V方向的李微分
(4)    $L_VU=[V,U]$
上述李微分不一定为零. 图3的红线标明的向量就是李微分的值, 表征着某种不均匀性. 如图4所示的表征晶体内位错分布的Burgers向量([2]).

  注意到上述李微分的定义并没有用到长度(度规张量)和向量的平行移动概念. 如果把上面的向量的李拖带解释为向量的平行移动,我们可以得到下面的结果.
    现在考虑在曲面上平行移动的导数

将其代入上式可得

定义

称为挠度张量.

上述方程(1),(2)表示了函数f沿不同路径时的变化差, 而黎曼曲张量$R^i_{,jkl}$则用来表征向量V=$f^i$沿不同环路时的变化的差.
图5([3]p74)

(5)     $\delta V^\rho=\delta a\delta bA^\nu B^\mu R^\rho_{,\sigma\mu\nu}V^\sigma$
其几何意义见下图.黎曼张量表征向量Vc'(r)和Vc(r)间的差.更加详细的议论可参见文献[4]或文献[1]的6.9节.如写成李括号形式,为
(6)    $[\nabla_\mu,\nabla_\nu]V^\rho=R^\rho_{,\sigma\mu\nu}V^\sigma-S_{\mu\nu},^\lambda\nabla_\lambda V^\rho$




主要参考文献:
1. B.F.Schutz, Geometrical methods of mathematical physics, 1980, Cambridge Univeristy
2.郭仲衡, 梁浩云, 变形体非协调理论的理性理论, 力学进展, 1989, 19(1), p36~48
3. S.M.Carroll. Lecture Notes on General Relativity ( http://arxiv.org/pdf/gr-qc/9712019.pdf)
4. http://academic.reed.edu/physics/courses/Physics411/html/411/page2/files/Lecture.13.pdf

How to avoid PATH type error when using cmake for Visual studio

When using cmake, you may find some "nod found" error for dll or exe files. Those can be avoided by add specific path into PATH definition of your PC. For visual studio c++, however, it is better to

1. Enter DOS command prompt and run vavars32.bat or vcvars64.bat, which is generally inside Microsoft Visual Studio XXX\VC\bin
        or
    Enter VSXXXX command prompt directly.
It would sets all variables needs for VC

2. Run cmake-gui.exe in command line afterwards.

Build Calculix2.6.1 in Mingw64

There is detailed description here http://mechanicalhacks.wordpress.com/2011/03/29/building-calculix-to-run-native-on-64-bit-windows/. But it doesnot works well, at least for ccx2.6.1. Here are some complemetation

1. Build  ARPACK.
    Modify ARmake.inc at follows
1) home="your current ARPACK home";
2) PLAT=anything you like. It would be appended in your library name.
3) Change the DIRS as
     DIRS = $(UTILdir)  $(SRCdir)
4) Make sure file second.f, which would in standard LAPACK library, in folder UTIL is not in your compile list.
5) RANLIB  = touch

2. Build spooles
   Following modifictions
1) Modify line 9 of SPOOLES.2.2/Tree/src/MakeGlobalLib from drawTree.c to draw.c
2) Modify line 204 of SPOOLES.2.2/MT/src/QRfactorMT.c from
   tids[myid]=0;
to memset(&tids[myid], 0, sizeof(pthread_t) );
3) Modify Make.inc
  THREAD_LIBS= -lpthread
4) Modify makefile
  uncomment
  #  cd MT               ; make lib
in make lib option

3. Build Calculix
1) Add #include "pthread.h" into file CalculiX.h
2) Modify Makefile as follows
  ・ Indicate where library of spooles, ARAPCK, BLAS and Lapack in in include in your LIBS, just like

DIR=../../../../solver/SPOOLES.2.2
BLASDIR = ../../../../solver/lapack-3.4.2
LIBDIR=/c/mingw64/x86_64-w64-mingw32/lib


LIBS = \
    $(DIR)/MT/src/spoolesMT.a \
       $(DIR)/spooles.a \
       ../../../../solver/ARPACK/libarpack_WIN64.a \
    $(BLASDIR)/liblapack.a $(BLASDIR)/librefblas.a \
       $(LIBDIR)/libpthread.a \
       $(LIBDIR)/libm.a


 Then just make it. That's all!


 


矢量沿曲线的平移

话说黄帝蚩尤大战于涿鹿, 其时浓雾弥漫, 不知东西. 黄帝造指南車辨识道路......
Fig.1 Parralel transport of a vector along a great circle of the sphere

现在考虑A部落的士兵在指南車的指引下向正南C, D部落的士兵在指南車的指引下也向正南C前进, 当他们在C点汇合时发现A,D指南車的指向是不同的!这一结果与我们在欧式空间的平行的概念大不相同.

  1. 曲面上的"平行移动"・协变导数
  上面的例子说明我们需要重新定义所谓平行这一概念. 不与欧式空间的平行的概念相冲突, 我们小心地定义所谓平行是矢量V沿曲线U的方向导数为零

  注意到上述导数其实尚未有明确的定义,我们把球面上的矢量V写成球坐标形式
,其在欧式空间中沿 轴的方向导数为

将基矢的偏导表述为基矢和球面法向n的线性函数

该式称为高斯方程. 这里为克氏符,为Weingarten方程. 注意到, K和$\Gamma$的两个下标是对称的.

   但对于黄帝部落而言,他们只知道球面上的东西,对球面外的法线一无所知! 在球面世界上来看, 上述方向导数为

在这里称为矢量V沿$\nu$轴的协变或绝对导数, 与欧式空间中方向导数相比较, 它去掉了球面法向的变化, 如下图
Fig.2 欧式空间的平行移动(V->V')和曲面空间的平行移动(V->V'')([1]p.102)

   矢量沿曲线的协变导数为零就是矢量沿曲线的平行移动条件.

   现在把矢量V沿方向U的协变导数写成.可以看出是一(1,1)张量, 称为协变导数.

   2. 克氏符・联络
   在欧式空间中克氏符的计算方法在高斯方程中给出.在曲面(黎曼)空间中,我们先要定义其度规, 然后设度规沿任一曲线的协变导数为零,由此推出克氏符的计算方法,称为与度规相适配的克氏符.

交换上式下标abc的顺序可的


由此可以得到

称为Levi-Civita联络. 克氏联络还有一个简单的表达式([3]p106-108)

由此


   3. 1形式的协变导数
   考虑一标量

可定义

为1形式的协变导数.由于上面方程的左边和倒数第二项都是张量, 该1形式的协变导数也是张量. 此时



主要参考文献
1. A. Zee, Einstein Gravity in a Nutshell, 2013, Princeton University
2. B.F.Schutz, Geometrical methods of mathematical physics, 1980, Cambridge Univeristy
3. S. Weinberg, Gravitation and cosmology: Principles and applications of the general theory of relativity, 1971, John Wiley & Sons

连续体的数学定义

在JE. Marsden & TJR Hughes的Mathematical foundations of elasticity(1993)中,变形体定义为
   A simple body is an open set $B\in R^3$

JT. Oden(Applied Functional Analysis, 1979)的定义为
  A continuous body is an open subset of the three-dimensional Euclidean space $R^3$

但这些定义不足于基本的变形计算, 连续体的数学定义似乎定义为带边的微分流形(Manifold with boundary)为好.

Build Elmer in MingW64

To compile Elmer-trunk-svn4252

1. Refer to the script suggested,  following script is adopted

#!/bin/sh -f
export ELMER_HOME=/c/Myprograms/Fortran/Elmer/elmertest
export ELMER_POST_HOME=$ELMER_HOME/share/elmerpost
export ELMER_FRONT_HOME=$ELMER_HOME/share/elmerfront

export PATH=$ELMER_HOME/bin:$PATH

export CC=x86_64-w64-mingw32-gcc
export CXX=x86_64-w64-mingw32-g++
export FC=x86_64-w64-mingw32-gfortran
export F77=x86_64-w64-mingw32-gfortran
export CPP=x86_64-w64-mingw32-cpp
export LDFLAGS="-L/c/Myprograms/Fortran/Elmer/elmertest/lib -Xlinker --stack=1000000000 "

modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem post front"

for m in $modules; do
  cd $m
  ./configure --prefix=$ELMER_HOME
  make
  make install
  cd ..
done

2. Type in ./configure. Several problems exists
1)  Makefiles generated includes -lm', which is supposed to link libm.a. You may need delete all of them.
2) cpp is needed even if you use export CPP=***. Just copy one with exactly this name.
3) Delete link of _muldc3.o in your Makefiles.

3.  Some link to AMD function in UMFPACK fails. Use offically one instead.
http://www.cise.ufl.edu/research/sparse/amd/

4. You may also need tcl/tk installed to compile Elmer GUI.

TortoiseGit下GitHub环境的设定: 从登录到Repository的建立

1. 在https://github.com/ 登录一个新帐号
2. 在GiHub中建立一个新的Repository



3.  选定Repository类型为SSH


4.  回到GitHub主页

5. 安装TortoiseGit

6. 执行TortoiseGit下的Puttygen程序产生公开键和秘密键

7. 在GitHub中登录公开键






8.  在本地环境下使用TortoiseGit建立本地Repository.

9.  在本地Repository中增加文件add->commit->push
 
 
 
 
10. 在按下push后设定秘密键
 
 
 

11. 确认文件已经载入GitHub.


参考资料




 

A tool set to manage variables or curves with multi-layer dependence

1. Objective

   A variable, such as Young's modulus of a elastic media, or a curve, such as stress-strain relations may depends upon various variables as temperature, mass densities of purities etc. This tool provides function of reading and fetching relevant data as independent variables are given.

2. Algorithm

    A tree structure with its node composed by a std::vector<double> is adopted.

3. Functions

1) Read data in tabular form as below
  • Each line of input data must be
---------------------------------------------------------------------------------------------------
    Dependent data1, Dependent data2, ..., independent data1, independent data2, ...
---------------------------------------------------------------------------------------------------
The number of dependents and independents is not limited but constrained by the limit of layer of recursive functions of the compiler used. By the way, data in a line may separated by common or space.
  • Independent data must be inputted in increasing sequences, i.e, input minor value at first and max at last. No sort function here.
  • To define multi-layer dependents, define independent data j while independent j+1 keep constant.

An example,
1.0  3.3  5.0  10.
3.0  4.3  6.0  10.
2.0  5.3  7.0  10.
4.0  6.3  8.0  10.
1.0  3.5  4.0  20.
3.0  4.5  6.0  20.
5.0  5.5  8.0  20.
2.0  6.5  10.0  20.

In this table, the first two column are dependent data while the other two are independent data. Here, when independent data2=10, independent data1 changes from 5.0 to 8.0. When independent data2=20, independent data1 changes from 4.0 to 10.0.

  I think the above format is same with format using by ABAQUS in its field variable dependence definition of material data.

  To read the data and construct our tree structure, just call
------------------------------------------------------------------------
      XYLIB::CVectorTree a(int ncomp, std::ifstream& file)
------------------------------------------------------------------------
where ncomp is the number of dependent data.

2)  Data fetch. Two types interface provides,
---------------------------------------------------------------------
bool GetValue(ValueType& idata,ValueType& odata )
bool GetGrad(ValueType& idata,ValueType& odata)
---------------------------------------------------------------------
Here, we provide independent data into idata and get value needed in odata. When using GetValue, eg., we can get the Young's modulus and Poisson's ratio at temperature T. When using GetGrad, eg., we can get the derivative of the stress-strain curve at temperature T and strain E etc. And, all the data are obtained by linear interpolation. If the independent variables run out the range of the table data defined, we try to find the nearest one (min or max value defined in table).

4. Usages

 1) Download the source code from: https://github.com/hillyuan/FEComponent/blob/master/include/misc/VectTree.h
2)  Just include the header file VectorTree.h

Example:

#include <iostream>
#include "VectTree.h"

int main()
{
    std::ifstream ifs( "input.txt" );
    if( ifs.fail() ) {
        std::cerr << "File do not exist.\n";
        exit(0);
    }
    XYLIB::CVectorTree a(2,ifs);
    a.Show(a.GetRoot());
    std::vector<double_t> idata, odata, odata1;
    idata.push_back(7.5);
    idata.push_back(15.0);
    if(  a.GetValue(idata, odata) ) {
        std::cerr << "Fails to get value.\n";
        exit(0);
    }
    std::cout << "result:"<<odata.size()<< "  "<<odata[0] <<"  "<<odata[1] << std::endl;
    if( a.GetGrad(idata, odata1) ) {
        std::cerr << "Fails to get gradient.\n";
        exit(0);
    }
    std::cout << "result:"<<odata1.size()<< "  "<<odata1[0] << "  "<<odata[1];
    return 0;
}

The example of context of input.txt here:
1.0 3.3 5.0 10.
3.0 4.3 6.0 10.
2.0 5.3 7.0 10.
4.0 6.3 8.0 10.
1.0 3.5 4.0 20.
3.0 4.5 6.0 20.
5.0 5.5 8.0 20.
2.0 6.5 10.0 20.

在cygwin或mingw中使用intel编译器

1. 在windows cmd shell环境下设定intel 编译环境
如;
# 进入command prompt, 执行ipsxe-comp-vars.bat or ifortvars.bat and iclvars.bat(该文件名和安装路径与版本有关)
# 直接执行上述, 如Start -> Programs -> Intel Software Development Tools -> Intel Fortran Compiler 10 -> Visual Fortran Build Enviornment

2. 键入C:\msys\1.0\ msys.bat进入msys, 或
    键入c:\cygwin\bin\bash.exe --login 进入cygwin

3. Ready

build FMDB in cygwin

1. Download build_Parallel_FMDB_GMI.sh .

2. export CC=; export CXX=; export MPIHOME=; 
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MPIHOME/lib
    To use iGeom/iMesh/iMeshP API, set ENABLE_ITAPS to 1 (default: 0)
    To use parmetis and/or zoltan already install export PARMETIS_HOME and/or ZOLTAN_HOME

3. Run the above shell script .

4. Modify /auxilaryBuildScripts/downloadAndBuildParmetis.sh as follow
        Modify all 'parmetis-3.1.0' to 'parmetis-4.0.2'

    Modify /auxilaryBuildScripts/downloadAndBuildZoltan.sh as follow
       Modify all 'v3.1' to 'v3.6'
       ../configure --with-parmetis-incdir=$PARMETIS_HOME to --with-parmetis-incdir=$PARMETIS_HOME/include and those relevent to parmetis dirs.

5. Modify 'make' command in downloadAndBuildParmetis.sh as
    make config
    make

6. Modify /FMDB-1.4.0/makefile, line 560 from ' /usr/local/include' to '-I/usr/local/include'
    Delete all setting about old-parallel in  /FMDB-1.4.0/makefile which use old-style interfaces of metis and parmetis.

7. Comment out  /FMDB-1.4.0/ghosting/pmGhostEntities.cc #include<mcheck.h>. It is not supported in cygwin.
   Comment out /test/serial/main.cc #include<sys/syscall.h>. It is not supported in cygwin.

8. A bug in zolton ver3.1. Modify line 291 of file parmetis_interface.c from #endif to #else and add #endif in line 347.

9. Modify setting of postdeps in /FMDB-1.4.0/libtool to
postdeps=" \
-L../../lib -lSCORECModel -lSCORECUtil -lipcomman \
-L../../zoltan/Zoltan_v3.6-install/lib -lzoltan \
-L../../parmetis/parmetis-4.0.2  -lparmetis -lmetis \
-lmpichcxx -lpmpich -lmpich -lopa -lmpl -lpthread -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32  -lstdc++ -lgcc_s -lgcc"

10. Compile.

Build Trilinos in cygwin

Compared to build Trilinos by visual studio, it is easier to build Trilinos in cygwin. Because lots of external libararies, such as  pthread, zlib, HDF5, blas and lapack, suitesparse, could be installed by setup script of cygwin by just one click. There are also many libararies be compilered by cygwin much easier that VS. But, we could only obtains a win32 library by cygwin!

The build process is quite like that here. The configure files looks like:

#!/bin/sh
EXTRA_ARGS=$@
rm -r CMakeCache.txt CMakeFiles/
cmake \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D CMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/mpic++ \
-D CMAKE_CXX_FLAGS:STRING="-D__cplusplus" \
-D CMAKE_C_COMPILER:FILEPATH=/usr/local/bin/mpicc \
-D CMAKE_Fortran_COMPILER:FILEPATH=/usr/local/bin/mpif90 \
-D TPL_ENABLE_MPI:BOOL=ON \
-D TPL_ENABLE_HDF5:BOOL=ON \
-D TPL_ENABLE_UMFPACK:BOOL=ON \
-D TPL_ENABLE_AMD:BOOL=ON \
-D TPL_ENABLE_BLAS:BOOL=ON \
-D TPL_ENABLE_LAPACK:BOOL=ON \
-D TPL_ENABLE_Zlib:BOOL=ON \
-D TPL_ENABLE_Pthread:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_AztecOO:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_Amesos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_FEI:BOOL=ON \
-D Trilinos_ENABLE_ML:BOOL=ON \
-D Trilinos_ENABLE_NOX:BOOL=ON \
-D Trilinos_ENABLE_Rythmos:BOOL=ON \
-D Trilinos_ENABLE_Thyra:BOOL=ON \
-D Trilinos_ENABLE_Zoltan:BOOL=ON \
-D UMFPACK_INCLUDE_DIRS:PATH="/usr/include/suitesparse" \
-D AMD_INCLUDE_DIRS:PATH="/usr/include/suitesparse" \
$EXTRA_ARGS \
../../Trilinos-11.0.3

However, all the config file generated by the cmake are not accessible. We need modify their attribute like below

#!/bin/sh
chmod u+wr packages/teuchos/src/Teuchos_config.h
chmod u+wr packages/teuchos/src/Teuchos_DLLExportMacro.h
chmod u+wr packages/ThreadPool/src/ThreadPool_config.h
chmod u+wr packages/sacado/src/Sacado_config.h
chmod u+wr packages/rtop/src/RTOp_Config.h
chmod u+wr packages/kokkos/classic/NodeAPI/KokkosClassic_config.h
chmod u+wr packages/kokkos/NodeAPI/Kokkos_config.h
chmod u+wr packages/epetra/src/Epetra_config.h
chmod u+wr packages/epetra/src/Epetra_DLLExportMacro.h
chmod u+wr packages/zoltan/src/Zoltan_config.h
chmod u+wr packages/triutils/src/Triutils_config.h
chmod u+wr packages/kokkos/LinAlg/Kokkos_config.h
chmod u+wr packages/kokkos/classic/LinAlg/KokkosClassic_config.h
chmod u+wr packages/kokkos/classic/NodeTSQR/Tsqr_Config.hpp
chmod u+wr packages/tpetra/src/Tpetra_config.h
chmod u+wr packages/epetraext/src/EpetraExt_config.h
chmod u+wr packages/thyra/core/src/Thyra_Config.h
chmod u+wr packages/isorropia/src/Isorropia_config.h
chmod u+wr packages/aztecoo/src/AztecOO_config.h
chmod u+wr packages/galeri/src/Galeri_config.h
chmod u+wr packages/amesos/src/Amesos_config.h
chmod u+wr packages/ifpack/src/Ifpack_config.h
chmod u+wr packages/ml/src/ml_config.h
chmod u+wr packages/belos/src/Belos_config.h
chmod u+wr packages/stratimikos/src/Stratimikos_InternalConfig.h
chmod u+wr packages/stratimikos/src/Stratimikos_Config.h
chmod u+wr packages/fei/base/FEI_config.h
chmod u+wr packages/fei/support-Trilinos/FEI_config.h
chmod u+wr packages/fei/test_utils/FEI_config.h
chmod u+wr packages/anasazi/src/Anasazi_config.h
chmod u+wr packages/anasazi/src/Anasazi_DLLExportMacro.h
chmod u+wr packages/anasazi/epetra/src/Anasaziepetra_DLLExportMacro.h
chmod u+wr packages/anasazi/epetra/util/ModeLaplace/Anasaziepetra_ModeLaplace_DLLExportMacro.h
chmod u+wr packages/nox/src/NOX_Config.h
chmod u+wr packages/rythmos/src/Rythmos_config.h

Build trilinos in windows by visual studio

1. You need cmake installed in your computer.

2. You need msys installed in your computer.

3. Of course, visual studio also. The free express edition is OK.

4. You need BLAS and LAPACK compiler in you computer. I choose clapack beacuse it need no Fortran compiler which could be compiler by express edition of visual studio.

5. Optional: MPI ( MPICH2 or MS-MPI ) for parallel computation.
    And, HDF5, MUMPS、UMFPACK etc

6. Download Trilinos and  uncompress it.

7. Make a new dir in your Trilinos home, e.g. &(TRILINOS_HOME)\build

8. Write down a shell script in this new folder like below

#!/bin/sh

EXTRA_ARGS=&@
rm -r CMakeCache.txt CMakeFiles/

cmake \
-G "Visual Studio 11 Win64" \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D TPL_ENABLE_MPI:BOOL=ON \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_AztecOO:BOOL=ON \
-D Trilinos_ENABLE_Amesos:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_FEI:BOOL=ON \
-D Trilinos_ENABLE_ML:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos:BOOL=ON \
-D Trilinos_ENABLE_Fortran:BOOL=OFF \
-D TPL_ENABLE_BLAS:BOOL=ON \
-D TPL_ENABLE_LAPACK:BOOL=ON \
$EXTRA_ARGS \

${TRILINOS_HOME}

9. Just run it in msys, it will generate files neccesary for VS compiler.

10. Compile.

Compiler errors
1. Return type error in Teuchos_Array.hpp
2. std::insert not defined error in Teucho_array.hpp, Ifpack_ConfigDefs.hpp, MLAPI_MultiVector.h.
Just include <funtional> to resolve it.
3. Add the following line into file EpetraExt_ConfigDefs.h if you include both HDF5 and MPI. Otheriwise errors of H5Pset_fapl_mpio etc not defined exist.
#ifndef H5_HAVE_PARALLEL
#define H5_HAVE_PARALLEL
#endif
4. There exists many error in packages like anasazi, zoltan that is hard to resolve!

cygwin下unable to remap的对处方法

有关于fork()或dll加载的错误, 可通过执行rebaseall消除.过程如下(http://cygwin.wikia.com/wiki/Rebaseall)

1.  关闭所有cygwin程序
2. 进入cmd
3. 进入ash
4. 执行rebaseall

rebaseall似乎修正所有/bin/下dll的基地址. 对自装程序,可如

$ /bin/rebase -s -v /usr/local/lib/.../*.dll

用-s指定文件夹

Bugs in CMakeLists.txt of VTK

1. 将Utilities/MaterialLibray/CMakeLists.txt 第78_84行

IF (NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$")
  # Ensure that the Source and Build dir are not same.
  # In that case we don't need to copy anything.
  COPY_FILES_TO_DIR(${MaterialLibrary_SOURCE_DIR}/Repository
    ${VTK_DEFAULT_SHADERS_DIR})
ENDIF (NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$")

改写为
STRING(COMPARE EQUAL "${VTK_BINARY_DIR}" "${VTK_SOURCE_DIR}" INSOURCE)
IF (NOT INSOURCE)
  # Ensure that the Source and Build dir are not same.
  # In that case we don't need to copy anything.
  COPY_FILES_TO_DIR(${MaterialLibrary_SOURCE_DIR}/Repository
    ${VTK_DEFAULT_SHADERS_DIR})
ENDIF (NOT INSOURCE

2.  将Testing/Intsall/CMakeLists.txt内

if("x${CMAKE_INSTALL_PREFIX}" MATCHES "^x${VTK_BINARY_DIR}/InstallTest$")
  add_test(NAME Install
    COMMAND ${CMAKE_COMMAND} -DCONFIGURATION=$<CONFIGURATION>
                             -DVTK_BINARY_DIR=${VTK_BINARY_DIR}
                             -P ${CMAKE_CURRENT_SOURCE_DIR}/InstallTest.cmake
    )
endif()

改写为
STRING(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${VTK_BINARY_DIR}/InstallTest" INSOURCE)
if(INSOURCE)
  add_test(NAME Install
    COMMAND ${CMAKE_COMMAND} -DCONFIGURATION=$<CONFIGURATION>
                             -DVTK_BINARY_DIR=${VTK_BINARY_DIR}
                             -P ${CMAKE_CURRENT_SOURCE_DIR}/InstallTest.cmake
    )
endif()

mingw64的安装方法

1. 下载ming-w64
     http://sourceforge.net/projects/mingw-w64/files/
     or x86_64-w64-mingw32-gcc-4.7.2-release-win32_rubenvb.7z from
     http://en.sourceforge.jp/projects/sfnet_mingw-w64/

2. 下载MSYS - mingw-w64
     http://sourceforge.net/apps/trac/mingw-w64/wiki/MSYS

3. 将ming-w64解压后移至/c/mingw64
     将MSYS解压后移至/c/msys

4. 双击 C:\msys\msys.bat
5.  在/c/msys下执行sh /postinstall/pi.sh, 或直接修改/c/msys/fsta如下
     c:/mingw64 mingw
  此时在msys环境下执行mount可确认mount状态.

6. 修改windows PATH路径设定或修改/c/msys/profile如下
   export PATH=".:/mingw/x86_64-w64-mingw32/lib:/mingw/libexec/gcc/x86_64-w64-mingw32/4.7.2:/mingw/x86_64-w64-mingw32/bin:/mingw/bin:/bin:$PATH"

7. 下载并安装其他工具,如gdb, make, pthread等
   ming-w64中没有find,可转用mingw32 msys中的find.

8. 编译工具为/ming64/bin下的 x86_64-w64-mingw32-gcc. 直接用gcc出错.


    


cygwin下mpich的编译

1. ./configure
2. 将PATH设定为最小
        C:\cygwin\usr\local\bin
        C:\cygwin\bin
否则回出现如
    sh 3220 child_info_fork::abort: can't commit memory for stack 0x28A000(90112), Win32 error
487
的错误.
3. make
4. make install

MPICH2在Window 7(64bit)上的安装

0. 下载mpich2
     http://www.mcs.anl.gov/research/projects/mpich2/
1.  删除旧MPICH2
2.  以管理者权限执行command prompt
3.  键入"msiexec /i mpich2安装文件名.msi"
4. 选择对Everyone安装
5. 将$MPICHROOT\bin加入路径名列表
6. 顺次键入
   smpd -install
   mpiexec -remove
   mpiexec -register

   在此登陆用户名和密码(必须和计算机中登陆的相同)
   (上述步骤也可使用wmpiconfig)
7. 确认-键入
  mpiexec -validate

  须显示SUCCESS
    键入
    smpd -status

   须显示'smpd running on $hostname$'
8. 进入$MPICHROOT\examples, 键入
    'mpiexec -n 2 cpi'
   确认并行计算

远程管理程序设定的移转方法

Putty设定的保存和读出
1.  使用regedit将 HKEY_CURRENY_USER\Software\SimonTatham\PuTTY\Sessions内容export
   reg export HKEY_CURRENT_USER\Software\SimonTatham\PuTTY putty.reg
2.  双击export出的reg文件即可恢复该设定。或键入
   reg import putty.reg

WinSCP设定的保存和读出
1.  打开WinSCP->设定->环境设定->export输出WinSCP.ini文件
2.  将WinSCP.ini拷贝到WinSCP安装目录下
3.  左击WinSCP图标, 将该程序设定为管理者特权下可执行文件

    For version>5.0:
    In login page, Open tools->export/import settings

Microsoft Edges: Setting saved in

%LocalAppData%\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\MicrosoftEdge\User\Default\Datastore
just copy this folder

VS Code下cmake, c++编译,调试环境的构成步骤

1   下载必须extension      按[Ctrl+Shift+X]打开extension窗口,选择安装"C/C++", "CMake", "CMake Tools" 2   在VSCode下打开作业目录 ...