Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F85330268
mini_mesh.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Sep 28, 09:27
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Sep 30, 09:27 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
21159516
Attached To
rCADDMESH CADD_mesher
mini_mesh.hh
View Options
#ifndef _MINI_MESH_H_
#define _MINI_MESH_H_
#include "common.hh"
#include "point_container.hh"
#include <vector>
/*! This class allows to create miniature meshes based on a connectivity and a
* point container for quality calculations and similar
*/
template
<
Uint
DIM
>
class
MiniMesh
{
public
:
MiniMesh
(
const
std
::
vector
<
const
int
*>
&
connectivity
,
const
std
::
vector
<
int
>
&
free_nodes
,
PointContainer
<
DIM
>
&
nodes
);
virtual
~
MiniMesh
(){};
class
StopIterError
:
public
std
::
runtime_error
{
public
:
StopIterError
(
std
::
string
str
)
:
std
::
runtime_error
(
str
){};
virtual
~
StopIterError
(){};
};
class
FiniteStepError
:
public
std
::
runtime_error
{
public
:
FiniteStepError
(
std
::
string
str
)
:
std
::
runtime_error
(
str
){};
virtual
~
FiniteStepError
(){};
};
class
NanStepError
:
public
FiniteStepError
{
public
:
NanStepError
(
std
::
string
str
)
:
FiniteStepError
(
str
){};
virtual
~
NanStepError
(){};
};
class
ZeroStepError
:
public
FiniteStepError
{
public
:
ZeroStepError
(
std
::
string
str
)
:
FiniteStepError
(
str
){};
virtual
~
ZeroStepError
(){};
};
Uint
relax
(
Real
imposed_step_size
,
Uint
max_iter
,
Real
threshold
,
Real
min_step_size
,
bool
verbose
=
false
);
private
:
/// returns the maximum quality (worst element) in the minimesh
Real
computeQuality
();
/// computes numerically the gradient of the quality
void
updateGradient
(
const
Real
&
step_size
);
/// normalize the gradient so that the largest point move is step_size
void
normGradient
(
Real
step_size
);
/// step along the gradient
void
stepGradient
(
Real
factor
=
1.
);
const
std
::
vector
<
const
int
*>
&
connectivity
;
const
std
::
vector
<
int
>
&
free_nodes
;
PointContainer
<
DIM
>
&
nodes
;
std
::
vector
<
Real
>
grad
;
};
#endif
/* _MINI_MESH_H_ */
Event Timeline
Log In to Comment