Commit b8755c18 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Create rule to build np_sphere.cpp

parent 432f5809
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
SUBDIRS := cluster sphere trapping
BUILDDIR=../build
SRCDIR=$(PWD)
BUILDDIR=$(SRCDIR)/../build
CC=g++

all: $(SUBDIRS)

$(SUBDIRS):
	$(MAKE) -C $@

np_sphere: $(BUILLDDIR)/sphere/np_sphere.o $(BUILLDDIR)/sphere/Configuration.o $(BUILLDDIR)/sphere/Parsers.o $(BUILLDDIR)/sphere/sphere.o
	$(CC) -o $(BUILDDIR)/sphere/np_sphere $(BUILDDIR)/sphere/np_sphere.o $(BUILDDIR)/sphere/Configuration.o $(BUILDDIR)/sphere/Parsers.o $(BUILDDIR)/sphere/sphere.o

clean:
	rm -f $(BUILDDIR)/cluster/*.o
	rm -f $(BUILDDIR)/sphere/*.o
@@ -17,3 +22,15 @@ wipe:
	rm -f $(BUILDDIR)/trapping/*

.PHONY: all $(SUBDIRS)

$(BUILLDDIR)/sphere/np_sphere.o:
	$(CC) -c np_sphere.cpp -o $(BUILDDIR)/sphere/np_sphere.o

$(BUILLDDIR)/sphere/Configuration.o:
	$(CC) -c Configuration.cpp -o $(BUILDDIR)/sphere/Configuration.o

$(BUILLDDIR)/sphere/Parsers.o:
	$(CC) -c Parsers.cpp -o $(BUILDDIR)/sphere/Parsers.o

$(BUILLDDIR)/sphere/sphere.o:
	$(CC) -c sphere/sphere.cpp -o $(BUILDDIR)/sphere/sphere.o
+1 −0
Original line number Diff line number Diff line
@@ -891,6 +891,7 @@ void sscr0(std::complex<double> &tfsas, int nsph, int lm, double vk, double exri
			c1->sqexs[i12 - 1] = extsec / gcss;
			c1->sqabs[i12 - 1] = abssec / gcss;
			c1->fsas[i12 - 1] = sum21 * csam;
			//printf("DEBUG: FSAS( %d ) = (%lE,%lE)\n", i12, c1->fsas[i12 - 1].real(), c1->fsas[i12 - 1].imag());
		}
		tfsas += c1->fsas[iogi - 1];
	}
+0 −0

File moved.

+17 −11
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@ void sphere() {
					}
				}
				double cs0 = 0.25 * vk * vk * vk / half_pi;
				//printf("DEBUG: cs0 = %lE\n", cs0);
				sscr0(tfsas, nsph, gconf->l_max, vk, exri, c1);
				printf("DEBUG: TFSAS = (%lE,%lE)\n", tfsas.real(), tfsas.imag());
				double sqk = vk * vk * sconf->exdc;
@@ -320,10 +321,15 @@ void sphere() {
						);
						fprintf(output, "  FSAS=%15.7lE%15.7lE\n", c1->fsas[i170 - 1].real(), c1->fsas[i170 - 1].imag());
						double csch = 2.0 * vk * sqsfi / c1->gcsv[i170 -1];
						//printf("DEBUG: csch = %lE\n", csch);
						s0 = c1->fsas[i170 - 1] * exri;
						//printf("DEBUG: s0 = (%lE,%lE)\n", s0.real(), s0.imag());
						double qschu = csch * s0.imag();
						//printf("DEBUG: qschu = %lE\n", qschu);
						double pschu = csch * s0.real();
						//printf("DEBUG: pschu = %lE\n", pschu);
						double s0mag = cs0 * sqrt((s0.real() + s0.imag()) * (s0.real() - s0.imag()));
						//printf("DEBUG: s0mag = %lE\n", s0mag);
						fprintf(
								output,
								"  QSCHU=%15.7lE, PSCHU=%15.7lE, S0MAG=%15.7lE\n",
@@ -462,12 +468,12 @@ void sphere() {
								for (int ns226 = 1; ns226 <= nsph; ns226++) {
									fprintf(output, "     SPHERE %2d\n", ns226);
									fprintf(
											output, "  SAS(1,1)=%15.7lE,%15.7lE, SAS(2,1)=%15.7lE,%15.7lE\n",
											output, "  SAS(1,1)=%15.7lE%15.7lE, SAS(2,1)=%15.7lE%15.7lE\n",
											c1->sas[ns226 - 1][0][0].real(), c1->sas[ns226 - 1][0][0].imag(),
											c1->sas[ns226 - 1][1][0].real(), c1->sas[ns226 - 1][1][0].imag()
									);
									fprintf(
											output, "  SAS(1,2)=%15.7lE,%15.7lE, SAS(2,2)=%15.7lE,%15.7lE\n",
											output, "  SAS(1,2)=%15.7lE%15.7lE, SAS(2,2)=%15.7lE%15.7lE\n",
											c1->sas[ns226 - 1][0][1].real(), c1->sas[ns226 - 1][0][1].imag(),
											c1->sas[ns226 - 1][1][1].real(), c1->sas[ns226 - 1][1][1].imag()
									);