A powerful object oriented programming language.

learn more… | top users | synonyms

0
votes
0answers
27 views

C++ - Starting paraller instances of an executable from a C++ code

Can I start parallel run of LAMMPS from inside a C++ code. Is it possible to compile my code and then do mpirun with my compiled code. I also have one system command inside the code, which starts ...
0
votes
1answer
47 views

How to apply the equation of d^2/dt^2 i(t) + 2 d/dt i(t) + 4 i(t) = V into?

How to apply these equation using second order DE using RK4 in c++ and how top plot a graph with it?? ...
0
votes
1answer
32 views

Why is MPI/PETSc only showing 1 processor even though it works for helloworld?

I am a beginner with Unix and MPI. For the serial program, I run the program by typing make in /directory/buildagain and then ...
1
vote
2answers
85 views

Parallelization of element-wise matrix multiplication

I use Armadillo as an interface to OpenBLAS. In my current program, I have a loop, in which I do multiplications of the form ...
0
votes
0answers
36 views

Elemental vs DPLASMA

I want to use one of these two libraries into my C++ project to basically invert a dense matrix (with Cholesky). Of course, I am interested in a distributed environment. Both libraries seem nice so ...
6
votes
6answers
1k views

Super C++ optimization of matrix multiplication with Armadillo

I'm using Armadillo to do very intensive matrix multiplications with side lengths $2^n$, where $n$ can be up to 20 or even more. I'm using Armadillo with OpenBLAS for matrix multiplication, which ...
3
votes
1answer
141 views

Software for triangulating a point set (with restrictions)

I want to triangulate a point-set like the one below. I would like the triangulation of the point-set to have the following properties The triangles must have as vertices the black and orange ...
0
votes
0answers
26 views

Solving the Wilberforce pendulum using Runge-Kutta method [duplicate]

I'm writing a program in C++ (almost from scratch) for solving the coupled equations that rise from the Wilberforce pendulum: $m\ddot{z}+kz+\frac{1}{2}\epsilon \theta = 0$ $I\ddot{\theta}+\delta ...
1
vote
1answer
157 views

eigenvalues of a general complex matrix in C++

Is there a free C or C++ library including a routine for the eigenvalues of a general complex matrix? I checked a number of linear algebra packages like Eigen, but there does not seem to be support ...
0
votes
0answers
60 views

Sparse MatrixExp acting on a vector

I am looking for a library implemented in C++ which would be able to compute action of matrix exp on a vector $$w = e^{A}v$$ I want to operate on sparse matrices with complex entries, not on real ...
3
votes
2answers
96 views

Why is SIMD programming on such a low level in CPU's compared to GPU's?

Just speaking from my experience in c++ - Its really tricky to take advantage of the SIMD capabilities of modern CPU's for more complex algorithms. If I see an opportunity from a high level OO ...
5
votes
1answer
884 views

Applying the Runge-Kutta method to second order ODEs

How can I replace the Euler method by Runge-Kutta 4th order to determine the free fall motion in not constant gravitional magnitude (eg. free fall from 10 000 km above ground)? So far I wrote simple ...
2
votes
1answer
65 views

Mathematica NIntegrate function in C++

I am working on computing a challenging integral. I am working with someone else who wrote some code in Mathematica to compute it. I do not have mathematica so I am trying to do the same thing in C++. ...
3
votes
2answers
439 views

literature on scientific computing

Maybe, this is a dump question. But anyway. I developed a finite difference code for a class of problems in dynamo theory. I used GNU Octave (MATLAB) which is good for testing. The problem size ...
0
votes
0answers
61 views

Compute left and right eigenvectors in c++ using Eigen library

The zgeev routine of the Lapack library computes the eigenvalues and left and/or right eigenvectors of a given matrix. I want to use c++ and the eigen library to do the same. A ...
0
votes
1answer
217 views

Order of eigenvalue problem using c++ Eigen library

I have the following 6x6 matrix (taken from Google Books p. 129): For background info: All the entries depend on the momentum $k$. Getting the eigenvalues of this matrix for each $k$ corresponds to ...
2
votes
0answers
43 views

Bracket Algebra, Straightening Algorithm

My apologies if the question is simple. I need to write a code for straightening algorithm. Which includes defining bracket algebra. I tried to write it in CoCoA-5, but it wasn't possible because ...
1
vote
0answers
52 views

Get a single value from a global Vec in petsc [closed]

I don't understand the concept with local and global vec's in petsc when it come to DMDAVecGetArray and VecGetValues. I'm creating some DMDA Vec in parallel which works well. Now I want to access ...
2
votes
1answer
82 views

What are the tradeoffs of using statically allocated arrays vs. pointers and dynamic allocation? [closed]

I am learning Monte Carlo simulation by C++. I begin with reading codes (from the internet and text books) of the 2D Ising model and the XY model. I find some people define spins simply by a two ...
0
votes
1answer
41 views

Unexpected behavior, values tend to converge instead of fluctuate. (MD)

I am writing a molecular dynamics program to create an lattice and populate it with atoms/molecules. These then are given random velocities and the system is initialized. Then throughout time the ...
-2
votes
1answer
58 views

Simulating dipoles/quadrupoles

Does anyone know how to simulate in C++ the beam-dynamics of particles passing through an array of magnets like a quadrupole + dipole ? Or maybe in the thin lense approximation how to simulate a FODO ...
1
vote
1answer
44 views

LAPACK DGGEVX: BALANC option

I'm using DGGEVX routine from LAPACKE with BALANC option as shown below, but to my surprise changing BALANC option from 'N' to ...
0
votes
1answer
64 views

How to give a simple estimation of errors for results obtained from 4th order Runge-Kutta

This question is a follow up of another one I have asked a while ago. I have successfully implemented my problem using odeint library and I get the results I expect. However I would like to give an ...
1
vote
1answer
240 views

Parallel vs Serial Thomas Algorithm

I am currently writing a code that solves a large tridiagonal matrix every iteration and runs for 1,000's of iterations. I am currently using a Thomas algorithm to solve the matrix serially. I found a ...
0
votes
0answers
98 views

Can you provide me with the source code of DMRG writen by C++?

I want to study the Density matrix renormalization Group(DMRG). Can some one provide me with the souce code which is writen by C++ for study purpose only? The code is not necessiary very professional, ...
3
votes
5answers
140 views

Speed of solving linear system with block diagonal matrix

I have a bunch of 3x3 linear systems of the form $Ax=b$. In general, would it be faster to solve each individual system, or to formulate it as a giant block diagonal system and solve that? I expect ...
0
votes
0answers
50 views

Debugging in parallel mode using Netbeans

I want to debug a c++ code with Netbeans. I can use the debugger in sequential mode but I dont know how to debug it when I want to run it in parallel. I would be grateful if anyone help me on this ...
0
votes
0answers
86 views

Eigen vector property: MATLAB 'chol' (LAPACK DSYGV) & MATLAB 'qz' (LAPACK DGGEVX)

Two Eigen algorithms return Eigen vectors with different properties: 1st algorithm, LAPACK DSYGV (the same as MATLAB eig with ...
0
votes
2answers
92 views

Simulating a traveling sine wave

I'm trying to make an animation of a travelling sine wave (amplitude vs. position) would anyon here happen to know how to do so?
2
votes
1answer
106 views

non-smooth convex c++ solver

I happened to know that there are advanced established techniques for non-smooth convex optimization in research. For example, these two papers: Nesterov, "Smooth minimization of non-smooth ...
0
votes
0answers
239 views

Eigen-unsupported: Levenberg - Marquardt algorithm

I am using Eigen-unsupported: LevenbergMarquardt algorithm. I use this algorithm inside my model. I wrote the minimization code both in MATLAB (using fsolve) and C++ and both gave the similar results ...
1
vote
1answer
237 views

How can I call the Boost C++ odeint Runge-Kutta integrator for a system of ODEs?

I would like to use Boost C++ odeint Runge-Kutta integrator on a system that looks like this : $$\ddot x = - \frac A{||x||^3} * x $$ $ x $ is a vector in 3D space, so basicaly $ x(i, j, k) $ $ ...
-2
votes
1answer
90 views

Solving electron density function for Hydrogen and drawing in 3D

I recently stumbled upon interesting site that has interactive 3D representation of radial electron distribution (atomic orbital). here is the url: ...
3
votes
1answer
63 views

Computing the (non-convex) boundary of a set of paths between two points

I have a set of paths between two fixed points (marked in red below). Each of these paths consists of an ordered series of $\{x, y\}$ points (marked in blue). I am trying to find the ordered set of ...
3
votes
2answers
586 views

Programming Finite Element Methods in C++

I am trying to develop a library for finite element methods in C++ and for that I am looking at the data structures for meshes. Based on what I've read up on fenics and deal.ii, the general ...
0
votes
1answer
201 views

Domain Decomposition with PETSc

Does anyone have any experience on Domain Decomposition using PETSc library? I have used PETSc for creating my vectors and matrix within my C++ code. I also used KSP to solve the linear system. I ...
0
votes
0answers
25 views

Cardiac Excitation Threshold in C++ modelling

So I am trying to write a code in C++ about the cardiac excitation threshold. I know that this excitation threshold is the shortest stimulus2 value at which it can conduct an action potential (known ...
0
votes
0answers
159 views

total memory usage of MPI shared memory

I am trying to use the MPI share memory feature. I have several SMP nodes, and each of them has four cores. I need an array of size N for each node that should be accessed by all four cores in each ...
0
votes
1answer
158 views

Windows C++ library for operations on mesh with a mex-interface in Matlab?

Please recommend me a well documented C++ library that I could wrap with a mex-interface in Matlab. The library should have the capability to read meshes (optimal in different formats, at least in ...
0
votes
0answers
35 views

Sequence optimization for multithreading

Given a list of object I must compute an expensive operation on any couple of object of the list. So I need to create a sequence of tasks. I want to find the sequence of tasks such that there is the ...
0
votes
2answers
91 views

How to determine the number of c points in algebraic multi grid

I am trying to write an algebraic multi-grid solver (in c++). At a given level I determine which nodes are c-points and which nodes are f-points (where the total number of c and f points equals the ...
5
votes
2answers
684 views

Should I pass command line arguments to MPI_Init or not?

When writing MPI 3.0 code, should I pass argc and argv to the MPI_Init call or not, and why? ...
0
votes
1answer
122 views

Fastest linear solver for sparse positive semidefinite, striclty diagonally dominant matrix

What is the state of the art for fastest linear solver for sparse, positive semi definite and strictly diagonally dominant matrix with N varies from ~700 to ~3000, and about a 1/16 of the matrix is ...
0
votes
1answer
98 views

How can I use Scipy to fit data generated from a C++ model?

I currently have a functioning and blazing fast model written in C++ and CUDA. However, I'd like to use Scipy.minimize to fit the model to some experimental data. I was hoping it would be easy, but ...
4
votes
3answers
162 views

Machine precision and local error

I'm working with an RKF45 integrator that I have programmed using CUDA C++ on my GPU and am pondering a few questions as I'm trying to track down some issues with my code. I'm using double ...
3
votes
2answers
313 views

Looking for Runge-Kutta 8th order in C/C++

I would like to use Runge-Kutta 8th order method (89) in a celestial mechanics / astrodynamics application, written in C++, using a Windows machine. Therefore I wonder if anyone knows a good library / ...
0
votes
2answers
498 views

Most efficient library to diagonalize exactly large hermitian or unitary matrices

I am working on a physics problem which requires obtaining the exact eigenvalues and eigenvectors of Hermitian and Unitary matrices numerically. Naturally I would like to ask the experts what are the ...
1
vote
1answer
136 views

How to minimize the artefact of a cartesian to polar transform followed by a polar to cartesian transform?

I'm transforming cartesian images into polar images. (x,y) => (angle, radius) I fill the polar image by iterating on each of its pixels and filling them by doing the reverse polar transform. For a ...
2
votes
2answers
91 views

Suggestions for open source C++ library for medium scale non-linear solver

I need to find the root of a nonlinear system (which comes out of collocation, so I will change the order to test). I will likely have about 50-300 variables, and the Jacobian is going to be ...
2
votes
3answers
696 views

How to efficiently assemble global stiffness matrix in sparse storage format (c++)

I am writing a finite element solver in C++. The main bottle neck is assembling the global stiffness matrix in sparse compressed row storage (so far I am only solving steady problems). Because I don't ...