How can I cite G+Smo in a publication/presentation ?

There are currently two entries that can be used, here are the bibtex data:

  • This webpage:
  author = {Angelos Mantzaflaris and ... and others (see website)},
  title  = {G+Smo (Geometry plus Simulation modules) v0.8.1},
  howpublished = {http://gs.jku.at/gismo},
  year         = {2017}

If you are referring to code which you have developped and is (or will become) part of the library then you can add your name (or other relevant authors) in the list of authors.

  • The following publications:
  title =	 {Multipatch discontinuous {G}alerkin isogeometric analysis},
  author =	 {Ulrich Langer and Angelos Mantzaflaris and Stephen Moore and Ioannis Toulopoulos},
  year =	 {2015},
  arxiv =        {http://arxiv.org/abs/1411.2478},
  booktitle =    {Isogeometric Analysis and Applications},
  series =	 {Lecture Notes in Computational Science and Engineering},
  url =		 {http://link.springer.com/chapter/10.1007/978-3-319-23315-4_1},
  publisher= {Springer},
  pages= {1-32},

  author    =  {Bert Juettler and Ulrich Langer and Angelos Mantzaflaris and Stephen Moore and Walter Zulehner},
  title     =  {Geometry + Simulation Modules: Implementing Isogeometric Analysis},
  journal   =  {Proc. Appl. Math. Mech.},
  volume    =  14,
  number    =  1,
  publisher =  {Wiley},
  issn      =  {1617-7061},
  pages     =  {961-962},
  year      =  2014,
  url       =  {http://dx.doi.org/10.1002/pamm.201410461},
  note      =  {Special Issue: 85th Annual Meeting of the Int. Assoc. of Appl. Math. and Mech. (GAMM), Erlangen 2014}

How to compile only one executable instead of all ?

On the linux prompt, inside you build folder issue (e.g., for compiling only gsView)

make -j2 gsView

"-j2" is optional and means that the computer will use two processors (Cores) to do the compilation (so it is faster).

On QtCreator go to Build options and choose the executable you want from the check-list.

I compiled the library. How can I use the tutorials in the "examples" folder ?

The executables are found in the "bin" subfolder of your build fodler after successfull compilatation. On linux, running e.g. "./bin/tutorial/tutorialBSplineSurface" will execute the file. To see the available command-line arguments, run an executable with the "-h" flag. Most executables can take options as command-line arguments, for instance, "./bin/poisson -h" will give you the available options for the poisson executable.

I try to compile an application using the G+Smo library, but I get linker errors (eg. function not found), what is wrong?

First make sure that you link with gismo.dll or libgismo.so ( -lgismo flag on GCC).

If this does not solve the problem, make sure that G+Smo and your application are compiled with compatible compilation flags. In particular if the GISMO_EXTRA_DEBUG option set to ON, then your application should be compiled with the compiler flag -D_GLIBCXX_DEBUG (GCC) or on Visual C++ the flag /D_SECURE_SCL=1 must be passed to the compiler.

The reason is that when this option is set to ON, then the library is compiled using the debug version of the standard library. It is more likely that this is the problem if the function which is not found by the linker contains templates from the standard library (for instance std::vector).

On linux, if you don't compile your application with the flag -D_GLIBCXX_DEBUG, then use GISMO_EXTRA_DEBUG=OFF when compiling G+Smo. On windows, compile with /D_SECURE_SCL=0 to disable the debug libraries.

How can I get the row data of an isogeometric solution out of a computation, i.e. just the raw knot vectors and B-spline coefficients ?

The simplest way to do this is to save the data to an XML file. If you have at hand a gsTensorBSpline<2> or a gsField≠ then for instance:

gsTensorBSpline<2> bs;

gsWrite(bs, "outfile_bs");

gsField<> field;

gsWrite( field.igaFunction(), "outfile_fun");

will create corresponding file outfile_bs.xml and outfile_fun.xml.

When do I have to use typename in front of a type declaration and when not ?

The general C++98/03 rule (C++11 changes slightly) says that typename is mandatory before a qualified, dependent name which refers to a type (unless that name is naming a base class, or in an initialization list).

  • typename must be used when refering to a type which is nested inside a template. For instance, we use typename std::vector<T>::iterator, since vector<T> is a template.

Note: an explicit template specialization is not itself a template, because there are no missing template parameters! Thus typename is always prohibited in this case, for instance no typename when saying std::vector<int>::iterator, because vector<int> is NOT a template (it is the instantization of a template).

  • typename is prohibited in each of the following scenarios:
    • Outside of a template definition (Note: an explicit template specialization is not itself a template, because there are no missing template parameters! Thus typename is always prohibited in this case).
    • Before an unqualified type, like int or boxSide.
    • In a constructor initialization list.

My linux prompt does not allow for bash completion when I use "make gsV TAB" to get "make gsView". What is wrong ?

Probably you miss a related package. Install (or ask your administrator to do it) a package called usually bash_completion or bash-completion and then this should work.

How to write math (LaTeX) formulas within Doxygen comments ?

Have a look at the Doxygen manual pages at: http://www.stack.nl/~dimitri/doxygen/manual/formulas.html

My program seems to run OK, I sometimes get wrong results, but I cannot figure it out. What to do ?

First of all compile with GISMO_EXTRA_DEBUG=ON (i.e., add -DGISMO_EXTRA_DEBUG=ON while executing CMake). This enables iterator and index checking in the STD library, i.e., if you access an std::vector at an invalid position or an invalid iterator you get an error (without this you DON'T get the errors). Running your debugger (e.g., GDB) with your program cpmpiled with DGISMO_EXTRA_DEBUG=ON points you to the file and line of the error.

Secondly, use valgrind to detect and fix memory leaks, since these are strongly related to bad results.

I have a std::vector<double> and I want to use it as a gsMatrix object. Do I have to copy it ?

It is possible to have a matrix object without copying any data. However note than if the object is passed as an argument to a function that expects a gsMatrix≠, a copy will occur. The gsAsMatrix and gsAsConstMatrix objects are placeholders and do not copy data:

std::vector<double> a;

gsAsMatrix<double> b(a, 2, 3);

const std::vector<double> c;

gsAsConstMatrix<double> d(a, 2, 3);

The order of the matrix is column-wise, that is, the data fill the first column of b and d, then when the second, and so on.

What kind of operation does the gsMatrix≠ support ?

The gsMatrix≠ class an object that inherits from Eigen::Matrix



Similarly for the gsSparseMatrix≠ class:



How do I change a gsVector<T> object to a one collum gsMatrix<T> without having copy or store a new object? For instance, in case that the argument to a function is a gsMatrix<T> object and I have gsVector<T> variables.

Currently this is not possible. There are some solutions that may be implemented, other easy or more complicated (http://eigen.tuxfamily.org/dox/TopicFunctionTakingEigenTypes.html). We will update this answer with a solution later..

I want to solve a linear least-squares problem. I constuct the matrix A and the right-hand side vector b. How to solve it ?

As described in http://eigen.tuxfamily.org/dox-devel/group__LeastSquares.html, an overdetermined system of equations, say Ax = b, has no solutions. In this case, it makes sense to search for the vector x which is closest to being a solution, in the sense that the difference Ax - b is as small as possible. There are many ways to get such a the solution:

// Using the QR decomposition (with column pivoting for accuracy)
gsVector<T> x = A.colPivHouseholderQr().solve(b); 

// Using the QR decomposition  (with full pivoting for more accuracy - but slower)
gsVector<T> x = A.fullPivHouseholderQr().solve(b); 

// Using the SVD decomposition (most accurate method)
gsVector<T> x = A.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(b);

// Using the normal equations (will not work good if A is ill-conditioned)
gsVector<T> x = (A.transpose() * A).ldlt().solve(A.transpose() * b);

I try to compile with MS Visual C++ 2013 but I get that the compiler failed with a fault. What can I do ?

This error is related to the function call:

secDerToHessian<T,ParDim>(funcSecDir.template block<parSecDirSize,1>(i*parSecDirSize,k), parFuncHessian);

To overcome it, please install the latest update for MS Visual C++ 2013, for instance the Update 4 from the corresponding link:

Then the compilation should succeed.

I work with the MS Visual C++ 2013 compiler. I configure the project with CMake, but when compiling I get the error that the /FS compiler flag is missing. What is the problem ?

The error in question is:

fatal error C1041: cannot open program database ..; if multiple CL.EXE write to the same .PDB file, please use /FS

This is a bug of an older version of CMake. Please grab the latest CMake version from http://www.cmake.org/download, uninstall the old CMake programs and re-configure with the new one.

Changing used compiler (with cmake)

Create a build folder. Inside this folder, call CC=[compiler] CXX=[compiler++] cmake [PathToGismo] where [compiler] and [compiler++] are your preferred compilers executables and [PathToGismo] is the (relative) path to your gismo-subversion folder. It could also be done by entering the cmake menu with ccmake . and going into the advanced mode, but it's preferred to do it with a new folder instead.

GCC and clang are in the folder /usr/bin. The Intel Compilers - if you suppossed to use it - are under /opt/intel/compilers_and_libraries_xxxx.x.xxx/linux/bin/intel64/. You may need to run the script for the paths before a build: source /opt/intel/compilers_and_libraries_xxxx.x.xxx/linux/bin/compilervars.sh intel64. If the Intel Compiler doesn't work, it could be a problem with the license file - found under /opt/intel/licenses/network.lic.

To change from C++ 11 Standard to 98 or 14, type cmake . -DCMAKE_CXX_STANDARD=xx where xx is 98, 11 or 14.

Your question ?

Send an e-mail to our mailing list gismo@ricam.oeaw.ac.at or join us in IRC channel #G+Smo on Freenode and ask a question. The reply will be added here to help others.

Last modified 7 months ago Last modified on 2017-05-12T13:01:58+01:00