Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove charge density #94

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def parse_args(self):
parser.add_argument('--plot-accuracy', action='store_true', help='Plot the accuracy as a function of time and number of elements')
parser.add_argument('--plot-geometry', action='store_true', help='Plot the geometry')
parser.add_argument('--plot-normals', action='store_true', help='When plotting geometry, show normals')
parser.add_argument('--plot-charge-density', action='store_true', help='When plotting geometry, base the colors on the computed charge density')
leon-vv marked this conversation as resolved.
Show resolved Hide resolved
parser.add_argument('--plot-charges', action='store_true', help='When plotting geometry, base the colors on the charge on each element')
parser.add_argument('--use-fmm', action='store_true', help='Use fast multipole method to solve 3D geometry')
parser.add_argument('--fmm-precision', type=int, default=12, help='Number of element (l_max) to use in multipole expansion')
Expand All @@ -55,14 +54,9 @@ def supports_fmm(self):
def supports_3d(self):
return True

def plot_geometry(self, MSF, symmetry, higher_order=False, plot_charges=False, plot_charge_density=False, plot_normals=False):
def plot_geometry(self, MSF, symmetry, higher_order=False, plot_charges=False, plot_normals=False):
geom = self.create_mesh(MSF, symmetry, higher_order)

if plot_charges or plot_charge_density:
exc, field = self.compute_field(geom, symmetry, use_fmm=use_fmm)
P.plot_charge_density(exc, field, density=plot_charge_density)
else:
P.plot_mesh(geom, show_normals=plot_normals, **self.plot_colors)
P.plot_mesh(geom, show_normals=plot_normals, **self.plot_colors)

def plot_accuracy(self, MSFs, symmetry, higher_order):
num_lines = []
Expand Down Expand Up @@ -139,14 +133,13 @@ def run_validation(self):

assert args.symmetry != '3d' or not args.higher_order, "Higher order meshes not supported in 3D"

plot = args.plot_geometry or args.plot_normals or args.plot_charge_density or args.plot_charges
plot = args.plot_geometry or args.plot_normals or args.plot_charges
symmetry = Validation.args_to_symmetry(args)
MSF = args.MSF if args.MSF != None else self.default_MSF(symmetry)[1]

if plot:
self.plot_geometry(MSF, symmetry, higher_order=args.higher_order,
plot_charges=args.plot_charges,
plot_charge_density=args.plot_charge_density,
plot_normals=args.plot_normals)
elif args.plot_accuracy:
self.plot_accuracy(self.default_MSF(symmetry), symmetry)
Expand Down
Loading