Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
phys_tp_elec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
boris.stefanov
phys_tp_elec
Commits
0ea1da04
Commit
0ea1da04
authored
3 years ago
by
Boris Stefanovic
Browse files
Options
Downloads
Patches
Plain Diff
FIX: rewrite compute_total_normalized_e(...)
parent
2c62c72e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/field.c
+9
-1
9 additions, 1 deletion
src/field.c
with
9 additions
and
1 deletion
src/field.c
+
9
−
1
View file @
0ea1da04
...
...
@@ -21,9 +21,17 @@ bool compute_e(charge_t c, vec2 p, double eps, vec2 *e) {
// Compute the normalized sum of Ei*qiP/norm(qiP)
// Return false if for some qiP, norm(qiP) < eps
bool
compute_total_normalized_e
(
charge_t
*
charges
,
int
num_charges
,
vec2
p
,
double
eps
,
vec2
*
e
)
{
return
EXIT_SUCCESS
;
*
e
=
vec2_create_zero
();
vec2
ei
=
vec2_create_zero
();
for
(
int
i
=
0
;
i
<
num_charges
;
++
i
)
{
if
(
!
compute_e
(
charges
[
i
],
p
,
eps
,
&
ei
))
return
false
;
*
e
=
vec2_add
(
*
e
,
ei
);
}
*
e
=
vec2_normalize
(
*
e
);
return
true
;
}
// Compute and then draw all the points belonging to a field line,
// starting from pos0.
// Returns false if pos0 is not a valid position
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment