Compare commits
No commits in common. "master" and "master" have entirely different histories.
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,9 +1,5 @@
|
||||
.idea/
|
||||
*.h5
|
||||
|
||||
__pycache__
|
||||
*.py[cod]
|
||||
build/
|
||||
dist/
|
||||
*.egg-info/
|
||||
*.h5
|
||||
*.pyc
|
||||
|
||||
|
@ -78,8 +78,7 @@ int p{{r}} = + (int) di{{r}};
|
||||
int wrap_{{r}} = (s{{r}} - 1) * (int) di{{r}};
|
||||
if ( {{r}} == 0 ) {
|
||||
m{{r}} = wrap_{{r}};
|
||||
}
|
||||
if ( {{r}} == s{{r}} - 1 ) {
|
||||
} else if ( {{r}} == s{{r}} - 1 ) {
|
||||
p{{r}} = -wrap_{{r}};
|
||||
}
|
||||
{% endfor %}
|
||||
|
@ -170,7 +170,7 @@ class Simulation(object):
|
||||
ctype = type_to_C(self.arg_type)
|
||||
|
||||
def ptr(arg: str) -> str:
|
||||
return ctype + ' *' + arg
|
||||
return ctype + ' * restrict ' + arg
|
||||
|
||||
base_fields = OrderedDict()
|
||||
base_fields[ptr('E')] = self.E
|
||||
@ -286,13 +286,13 @@ class Simulation(object):
|
||||
alpha_max = pml['cfs_alpha']
|
||||
|
||||
def par(x):
|
||||
scaling = (x / pml['thickness']) ** pml['m']
|
||||
scaling = ((x / (pml['thickness'])) ** pml['m'])
|
||||
sigma = scaling * sigma_max
|
||||
kappa = 1 + scaling * (kappa_max - 1)
|
||||
alpha = ((1 - x / pml['thickness']) ** pml['ma']) * alpha_max
|
||||
p0 = numpy.exp(-(sigma / kappa + alpha) * self.dt)
|
||||
p1 = sigma / (sigma + kappa * alpha) * (p0 - 1)
|
||||
p2 = 1 / kappa
|
||||
p2 = 1/kappa
|
||||
return p0, p1, p2
|
||||
|
||||
xe, xh = (numpy.arange(1, pml['thickness'] + 1, dtype=self.arg_type)[::-1] for _ in range(2))
|
||||
|
Loading…
Reference in New Issue
Block a user