Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
68 lines (54 loc) · 1.17 KB

File metadata and controls

68 lines (54 loc) · 1.17 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package symjava.examples.fem;
import java.util.ArrayList;
import java.util.List;
import symjava.domains.Domain;
import symjava.math.Transformation;
import symjava.symbolic.Expr;
public class Element extends Domain {
public List<Node> nodes = new ArrayList<Node>();
int index;
int dim;
public Element(String label, Expr ...coordVars) {
this.label = label;
this.coordVars = coordVars;
}
public int getIndex() {
return this.index;
}
public void setIndex(int index) {
this.index = index;
}
public int getLocalIndex(Node node) {
for(int i=0; i<nodes.size(); i++) {
if(nodes.get(i) == node)
return i;
}
return -1;
}
public Element setNodes(Node ...nodes) {
for(Node n : nodes) {
this.nodes.add(n);
}
this.dim = nodes[0].getDim();
return this;
}
@Override
public Domain transform(String label, Transformation trans) {
// TODO Auto-generated method stub
return null;
}
@Override
public int getDim() {
return dim;
}
public double[] getNodeCoords() {
double[] rlt = new double[nodes.size()*dim];
int index = 0;
for(int j=0; j<dim; j++) {
for(Node n : nodes) {
rlt[index++] = n.coords[j];
}
}
return rlt;
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.