Giter Site home page Giter Site logo

fm's People

Contributors

patnr avatar rlcamp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fm's Issues

About errors from mex fm2dc.cpp util.cpp heap.cpp

Hi, Patrick! When I run CompileMexFile.m. The error shows in the following.
/home/users3/fx592/3D eikonal equation/utils.cpp: In function ‘mxArray* myCreateIntScalar()’:
/home/users3/fx592/3D eikonal equation/utils.cpp:129:67: error: cannot convert ‘int*’ to ‘const mwSize* {aka const
long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray_730(mwSize, const mwSize*, mxClassID,
mxComplexity)’
return mxCreateNumericArray(1,dimsOfAScalar,mxINT32_CLASS,mxREAL);

I revise the function into the following

mxArray * myCreateIntScalar() {
mwSize dimsOfAScalar[2] = {1,1};
return mxCreateNumericArray(1,dimsOfAScalar,mxINT32_CLASS,mxREAL);
}
I change int into mwSize. Finallly, I can get through it.

Could you confirm and explain this? I just want to make sure.

Thank you
Timothy

Unrecognized function or variable 'fm2dc'.

Hi I am trying to run the example TS_strata.m but I get the following error:

Error in fm (line 208)
[T eFlag] = fm2dc(F,SourcePoints,dy,dx,opts.order);

Error in TS_strata (line 26)
T4 = fm(F,SPs,Dxyz,struct('implementation','C++','order',2));

I am using Matlab 2021b

Inconsistent units in expression

There appears to be a unit issue in the algorithm. The expression "time = min(xmin1, ymin1) + 1/Fij" implies that 1/Fij has the same units as the other quantities, which it does not. A possible correction is time = xmin1 + dx / Fij or time = ymin1 + dy / Fij, depending on whether xmin1 or ymin1 is smaller.

time = min(xmin1, ymin1) + 1/Fij;

Ray trace not finding the right path

Hi, I am running the following code (based on TS_maze.m example). It is a medium with varying velocity at the layers. The wavefields are calculated nicely. However, the ray trace function doesn't find the travelled path between the source and the receiver. I am I missing something?
The code is attached below.

`% code source: https://github.com/patnr/FM
%% Inputs
clc; clear;
addpath('./functions'); % Add path of functions for FMM
%% Meshing
h = 0.0041; % Step h
nx = 161; % Depth (z) nodes #
nz = 166; % Length (x) nodes #
lx = (nx-1)h; % LZ length m
lz = (nz-1)h; % LX Length (m)
%% Anisotropic velocity field
v0 = 1752.85; % Phase velocity
matrix = ones(nx,nz);
th = linspace(-180,180,nx);
alpha = (0.329
ones(1,length(th))+ ... %Anisotropy parameter
0.1055
cosd(th))./...
(0.329ones(1,length(th))+ 0.1055ones(1,length(th)));

V = (v0./alpha)'.*matrix; % Velocity field
SPs = [83;81]; % Source
RPs = [166;81]; % Receiver

%% Calculations V
T1 = fm(V,SPs,[1 1],struct('implementation','Matlab','order',2));
settings = struct('useFD',1,'stepSize',2);
path1 = rayTrace(T1,SPs,RPs,settings);
%% Plot
figure
contourf(flipud(T1),'DisplayName','Wavefronts');
hold on;
plot(path1(2,:),path1(1,:),'k','LineWidth',1,'DisplayName','Ray path');
plot(RPs(1),RPs(2),'sk','MarkerFaceColor','k','MarkerSize',14,'DisplayName','Receiver')
plot(SPs(1),SPs(2),'ok','MarkerFaceColor','k','MarkerSize',18,'DisplayName','Source')
lgd = legend;
lgd.NumColumns = 1;
lgd.Location='southeast';
hold off;
title('Wave fronts in an anisotropic medium');

`

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.