Coder Social home page Coder Social logo

lrsplines's Introduction

LR B-splines

Locally Refined B-splines

LR B-splines is a technology which enables users to perform local refinement on B-spline surfaces or volumes, which traditionally have been limited to tensor products. This has a wide variety of applications within computer-aided design (CAD) and computer-aided engineering (CAE). While this library was written with the latter in mind, it is also possible to take use of it in a design environment. For more information consult the website : http://lrbsplines.com

Getting the code

Simply press the green button on the top right of the github screen that states "Clone or download". On ubuntu (or with git bash on any OS) you can clone the library by typing in

git clone https://github.com/VikingScientist/LRsplines

Compiling the code

This is a c++ library and you will have to compile and link this to your applications accordingly. It uses CMake as the compilation tools. There are two optional dependencies which is boost and GoTools. These will expand the capabilities of the library, but are not required for compilation.Boost allows for more linear dependency testing and GoTools is a tensor product B-spline library.

Ubuntu

  1. Install all compilation tools that we are going to need

sudo apt-get install cmake g++

  1. [Optional]: Install boost

sudo apt-get install libboost-dev

  1. [Optional]: Install GoTools. This is compiled on launchpad. Add https://launchpad.net/~ifem/ (follow the instructions on site) followed by typing

    sudo apt-get install libgotools-core-dev libgotools-trivariate-dev

To compile the code, first navigate to the root catalogue of LR-splines, here denoted by <LRSpline root>

  1. cd <LRSpline root>
  2. mkdir Release
  3. cd Release
  4. cmake -DCMAKE_BUILD_TYPE=Release ..
  5. make
  6. [Optional]: make test
  7. [Optional]: sudo make install

Point 6 will run a series of test to verify that the library compiled correctly and is running as it should. Point 7 will install this on your system by placing the header-files, library-files and cmake-files in their right place (default: /usr/local/lib and /usr/local/include): this will in turn make it much easier to compile your own applications which uses this library. Changing any instance of Release with Debug makes the library compile with debug-flags on.

Windows

  1. Download and install cmake: https://cmake.org/download/
  2. Download and install visual studio: https://www.visualstudio.com/downloads/
  3. Compile a visual studio project by using cmake. See https://cmake.org/runningcmake/ for instructions
  4. Open the LRspline project in visual studio and build the project.

CMake will generate a big red warning that it cannot find GoTools. This is as expected and it will compile fine without it.

Using the Code

See the Examples/ folder for a sample c++ program that uses the LRSpline library. It assumes that CMake is able to find the config files LRSplineConfig.cmake as well as all header and library files. If these are not installed on default location (by sudo make install), then you will have to specify them manually. Hello_LRSpline.cpp is compiled and run by

  1. cd Examples
  2. cmake .
  3. make
  4. ./hello_lrspline

lrsplines's People

Contributors

vikingscientist avatar akva2 avatar thebb avatar fabienpean avatar kmokstad avatar

Stargazers

Lavender Lee avatar  avatar  avatar  avatar  avatar BIAN, Pei-Liang avatar Krunal Raval avatar  avatar Tiger avatar Devin avatar Alexander Tereshin avatar SHUGANG avatar  avatar Steven K. Baum avatar John A. Turner avatar gnzlbg avatar luke chen avatar Nico Zahn avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Yanpeng avatar Devin avatar

lrsplines's Issues

Implement renumberElement()

Implement LRSpline.renumberElements() which gives a consistent element enumeration which is independent of refinement order. Same topological mesh should produce identical element enumeration regardless of scaling or refinement order.

cmake .

Hey Kjetil,

I cannot install LRsplines as I got followings bugs:

CMake Error at CMakeLists.txt:15 (TARGET_COMPILE_FEATURES):
Unknown CMake command "TARGET_COMPILE_FEATURES".

-- Configuring incomplete, errors occurred!

Best

Crash on higher derivatives

Will crash when requesting derivatives which vanish completely, i.e. 2nd order derivatives of linear functions. Needs fixing: should return all zero vector

The latest update is no good :-(

After the last LRsplines update, I get the following in IFEM:

The following tests FAILED:
	 43 - TestFieldFunctions.2D2PLR (SEGFAULT)
	184 - TestLRSplineField.Value2D (SEGFAULT)
	185 - TestLRSplineField.Grad2D (SEGFAULT)
	190 - TestASMu2D.TransferGaussPtVars (SEGFAULT)
	191 - TestASMu2D.TransferGaussPtVarsN (SEGFAULT)
	195 - TestLRSplineFields.Value2D (SEGFAULT)
	197 - TestLRSplineFields.Grad2D (SEGFAULT)

As far I can see, they all crash within the LRspline library.

Tag release

Would it be possible to tag a release with 6b67bc5 and #49 ? I'm working on an easybuild config for IFEM and it would be cleaner to work with a release/tag than with a git commit.
Thanks

Implement LRSpline.renumberBasisfunctions()

Implement LRSpline.renumberBasisfunctions() which gives a consistent basisfunctino enumeration which is independent of refinement order. Same topological mesh should produce identical element enumeration regardless of scaling or refinement order.

This is a bit harder than #39 since Basisfunctions are wrapped into a HashSet container and you can't rearrange these terms at your own will. However, you don't need to enumerate function according to the hashfunction ordering. One can devise some form of geometric ordering of the basisfunction in the parametric space which produces unique and repeatable enumerations. However be advised that while you can sort on "lower left" corner for elements since these are unique, this is no longer the case for the support of the basisfunctions. Neither "lower left corner", "controlpoint value" or "greville absiccae" are unique geometric points. You will have to take into account potentially the entire knot vector in this sorting logic.

Does not compile with latest GoTools

When compiling with latest GoTools from Github I get the following error:

[ 18%] Building CXX object CMakeFiles/LRSpline.dir/src/Profiler.cpp.o
In file included from /home/gemuend/IFEM/LRsplines/src/LRSplineSurface.cpp:1:
/home/gemuend/IFEM/LRsplines/include/LRSpline/LRSplineSurface.h:27:8: error: redefinition of ‘struct Go::BasisDerivsSf3’
   27 | struct BasisDerivsSf3
      |        ^~~~~~~~~~~~~~
In file included from /home/gemuend/IFEM/LRsplines/include/LRSpline/LRSplineSurface.h:7,
                 from /home/gemuend/IFEM/LRsplines/src/LRSplineSurface.cpp:1:
/home/gemuend/IFEM/install/include/GoTools/geometry/SplineSurface.h:153:8: note: previous definition of ‘struct Go::BasisDerivsSf3’
  153 | struct BasisDerivsSf3
      |        ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/LRSpline.dir/src/LRSplineSurface.cpp.o] Error 1

Is this expected, should we be using an older version of GoTools? Or is LRSplines now part of GoTools and we dont need to install it separately?

Add getElementContaining(const Element*)

In user code dealing with mixed finite elements you often see constructs like

int elem = surface->getElementContaining((elem2->umin()+elem2->umax())/2.0, ...).

it would be great to see

  int elem = surface->getElementContaining(elem2);

in particular it could be used to work with 'LRSpline' objects rather than LRSplineSurface|Volum, making it possible to unify some code.

Compilation error in TensorComparison app.

On Ubuntu 12.10, i get the following compilation error:
LRsplines/LRsplines-master/Apps/TensorComparison.cpp: In function ‘int main(int, char**)’:
LRsplines/LRsplines-master/Apps/TensorComparison.cpp:118:28: error: no matching function for call to ‘LR::LRSplineSurface::point(std::vectorGo::Point&, double&, double&, int)’

Disabling this, the packaged compiled successfully.

Possible bug in LRSplineVolume::insert_line ?

Context: I have 50 solutions, each with 204 patches, linear and quadratic. Of all these combinations, this bug reproduces only twice. I've attached the smallest of those two reproducing examples. For what it's worth, it does not repro on any of the quadratic cases I have, but it could be that they are just not fine enough.

The problem boils down to the following: create two patches (A and B) with the same order and parameter space, but potentially different topology and control points, or even physical dimension. Copy all mesh rectangles from A over to B, and then back again. The resulting two patches should be topologically identical. In particular they should have the same number of basis functions.

In each reproducing case, one of the patches (A) I picked had to be from a specific solution (out of the 50), but the bug reproed with any other solution playing the role of B. Whether you copy from A to B first or vice-versa does not seem to matter.

Two patch files and a small program that demonstrates the mismatching lengths can be found here:
https://gist.github.com/TheBB/a9c22ee1acc96caed2b7bff7884cd822

Output:

A: 1433 B: 208
A: 1433 B: 1425
A: 1433 B: 1425

Append mode for postscript output

For a multi-patch model you can now only get a single eps-file for each patch.
It would be better to store all patches in the same file to display the assembled model.
You essentially only need to concatenate the files for each patch while changing the %%BoundingBox statement. One could do this manually, except there appears to be some automatic scaling of each patch that makes it difficult, unless all patches have the same size.

Therefore, an append mode would be better, where the bounding box is set by the caller, and each patch is appended to the provided file, if it already exists.

This makes sense only for the physical mesh, of course (and without the dots).

libLRSpline.so.1.4:

How can I solve this bug?
At the last step:
./hello_lrspline
./hello_lrspline: error while loading shared libraries: libLRSpline.so.1.4: cannot open shared object file: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.