Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
9ca41e67
Commit
9ca41e67
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
starting dof manager
parent
ce72931e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/dofManager.cpp
+24
-0
24 additions, 0 deletions
Solver/dofManager.cpp
Solver/dofManager.h
+82
-0
82 additions, 0 deletions
Solver/dofManager.h
with
106 additions
and
0 deletions
Solver/dofManager.cpp
0 → 100644
+
24
−
0
View file @
9ca41e67
#include
"dofManager.h"
template
<
>
double
DofManager
<
double
,
double
>::
getDofValue
(
long
int
entity
,
int
type
)
const
{
return
1.2345
;
/*
if("find in fixed")
return ...
else if("find in init")
return ...
else if("find in constraint")
...
else
...
*/
}
template
<
>
void
DofManager
<
double
,
double
>::
createFixedDof
(
long
int
entity
,
int
type
,
const
double
&
value
)
{
fixed
[
Dof
(
entity
,
type
)]
=
value
;
}
This diff is collapsed.
Click to expand it.
Solver/dofManager.h
0 → 100644
+
82
−
0
View file @
9ca41e67
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _DOF_MANAGER_H_
#define _DOF_MANAGER_H_
#include
<vector>
#include
<string>
#include
<map>
class
gmshLinearSystem
;
class
Dof
{
private:
// v(x) = \sum_f \sum_i v_{fi} s^f_i(x)
long
int
_entity
;
// "i": node, edge, group, etc.
int
_type
;
// "f": basis function type index, etc.
public:
Dof
(
long
int
entity
,
int
type
)
:
_entity
(
entity
),
_type
(
type
)
{}
inline
long
int
getEntity
()
const
{
return
_entity
;
}
inline
int
getType
()
const
{
return
_type
;
}
};
template
<
class
dataVec
,
class
dataMat
>
class
DofAffineConstraint
{
public:
std
::
vector
<
std
::
pair
<
Dof
,
dataMat
>
>
linear
;
dataVec
shift
;
};
// data=float, double, complex<double>, smallVec<double>, smallVec<complex<double> >...
template
<
class
dataVec
,
class
dataMat
>
class
DofManager
{
private:
// general affine constraint on sub-blocks, treated by adding
// equations:
// dataMat * DofVec = \sum_i dataMat_i * DofVec_i + dataVec
std
::
map
<
std
::
pair
<
Dof
,
dataMat
>
,
DofAffineConstraint
>
constraint
;
// fixations on full blocks, treated by eliminating equations:
// DofVec = dataVec
std
::
map
<
Dof
,
dataVec
>
fixed
,
initial
;
// numbering of unknown dof blocks
std
::
map
<
Dof
,
long
int
>
unknown
;
// associatations
std
::
map
<
Dof
,
Dof
>
associatedWith
;
private:
// linear system(s):
std
::
vector
<
gmshLinearSystem
<
dataMat
>*>
linearSystems
;
public:
DofManager
(
/* linAlgOptions &opt */
){}
dataVec
getDofValue
(
long
int
entity
,
int
type
)
const
;
void
createFixedDof
(
long
int
entity
,
int
type
,
const
dataVec
&
value
);
};
/*
class
termOfFormulation
{
public:
// hard-coded OR not!
};
class
field
{
private:
std
::
string
_name
;
// unique mapping between dofs and names:
static
std
::
map
<
int
,
std
::
string
>
_names
;
static
int
typeFromName
(
std
::
string
name
);
static
std
::
string
nameFromType
(
int
type
);
// size of a dof block
static
int
blockSizeFromType
(
int
type
);
// doit pouvoir etre evalu
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