连续体的数学定义

在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

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

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