Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cmu-ci-lab/mcspeckle
30 June 2024, 09:00:48 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
Revision 8572b98d593e12fddfdf90947c7f9fb937e0a685 authored by igkiou on 10 August 2017, 23:15:04 UTC, committed by igkiou on 10 August 2017, 23:15:04 UTC
flag
1 parent b21666c
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • 8572b98d593e12fddfdf90947c7f9fb937e0a685
    No releases to show
  • 154b76e
  • /
  • emc
  • /
  • deplength.cpp
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:8572b98d593e12fddfdf90947c7f9fb937e0a685
origin badgedirectory badge
swh:1:dir:6ed76ddfa4df728b5e365c3fdd579d7d1b5f67be
origin badgecontent badge
swh:1:cnt:56efb097f77474af44435bfdfba8f198c476844f
origin badgesnapshot badge
swh:1:snp:3a35cdb24ad67a89d2a1abf099040aff3c71b7b4

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 8572b98d593e12fddfdf90947c7f9fb937e0a685 authored by igkiou on 10 August 2017, 23:15:04 UTC
flag
Tip revision: 8572b98
deplength.cpp
#include "pol_montecarlo.h"
#include <math.h>

// Remember all the length and time units are in mfp=lsa.
//
// A test case for slabs to obtain the depolarization length
// incident CW plane wave
//
// Polystyrene sphere diamter 0.5micro
// refractive index: 1.59 with background refractive index 1.33
// incident wavelength 632.8nm
//                          X
//                          |              |
//			    |              |
//			    |              |
//			    |              |
//		   Analyzer |              |
//			+   |              |
//			+   |O             |
//	 incident-------+---|--------------+------ Z
//			+   |              |
//			+   |       L      |
//
//
//-

const double lambda=0.633;	// micro
const double n_water=1.33;
const double dia=0.94;		// diameter in micro
const double x=4; //pi*dia/lambda*n_water;
const double mr=1.2, mi=0.0;	// m=mr-i*mi is the refractive index

int main ()
{
    dcmplx Ex, Ey, Ez, Ed1, Ed2;
    double td, deposit, Q[3][3];
    dcmplx m(mr, mi);
    scatterer sct(x, m);

    double L, Ipar, Iper, IxyR, IxyI;
    int photons = 100000*10;

    photonPacket *ph = new photonPacket(&sct);

    printf("# L, photons, Ipar, Iper, IxyR, IxyI, DOP, DOCP\n");

    for (L=1; L<10; L+=2) {
	Ipar = Iper = IxyR = IxyI = 0;

	for (int i = 1; i <= photons; i++) {
	    // launch a linear polarized light
	    ph->launch ();
	    // launch a circular polarized light
	    //ph->launch (dcmplx(1/sqrt(2), 0), dcmplx(0, 1/sqrt(2)));

	    //if (i % 1000 == 0) fprintf(stderr, "%d\n", i);

	    while (1) {
	    // either choice is OK.

#if 0 	

		ph->move ();
		if (ph->z < 0) break;
		if (ph->z > L) {
		    // NOTE: 0.99 corresponds to a detecting half angle of 8 degree.
		    if (ph->P[2][2] > 0.995 && ph->nsct > 0) {
			Ex = ph->E1*ph->P[0][0] + ph->E2*ph->P[1][0];
			Ey = ph->E1*ph->P[0][1] + ph->E2*ph->P[1][1];
			Ez = ph->E1*ph->P[0][2] + ph->E2*ph->P[1][2];

			Ipar += norm(Ex)*ph->weight;
			Iper += norm(Ey)*ph->weight;
			IxyR += (Ex*conj(Ey)).real()*ph->weight;
			IxyI += (Ex*conj(Ey)).imag()*ph->weight;
		    }
		    break;
		}

#else

		if (ph->z < 0 || ph->z > L) break;
		if (ph->nsct >= 0) {
		    ph->pointestimator(&td, &deposit, Q, &Ed1, &Ed2, L, 0, 0, 1);
		    Ex = Ed1*Q[0][0] + Ed2*Q[1][0];
		    Ey = Ed1*Q[0][1] + Ed2*Q[1][1];
		    Ez = Ed1*Q[0][2] + Ed2*Q[1][2];

		    Ipar += norm(Ex)*deposit;
		    Iper += norm(Ey)*deposit;
		    IxyR += (Ex*conj(Ey)).real()*deposit;
		    IxyI += (Ex*conj(Ey)).imag()*deposit;
		}
		ph->move ();

#endif

		ph->scatter ();
	    }
	}
	printf("%f %d %f %f %f %f %f %f\n", L, photons, Ipar, Iper, IxyR, IxyI, (Ipar-Iper)/(Ipar+Iper), -2*IxyI/(Ipar+Iper));
    }
    delete ph;
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API